This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. put bitunlocker.py in /etc/libvirt/hooks/qemu.d/ | |
2. run bitunlocker.py to configure unlock keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from contextlib import suppress | |
import logging | |
import os | |
import re | |
logger = logging.getLogger() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from collections import namedtuple | |
from contextlib import AsyncExitStack | |
from ipaddress import IPv4Address, IPv6Address, IPv4Network, IPv6Network | |
from signal import signal, SIGHUP, SIGINT, SIGTERM | |
from socket import socket, AF_INET, AF_INET6, SOCK_STREAM, IPPROTO_IP, IP_TRANSPARENT, SHUT_WR | |
import asyncio as aio | |
import logging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from contextlib import suppress | |
from functools import cached_property | |
from sys import argv, exit, stderr | |
from time import time | |
import dbus | |
import os | |
import shlex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%global descr DNF plugin to remove suid from packages | |
Name: dnf-plugin-remove-suid | |
Version: {{{ git_dir_version }}} | |
Release: 1%{?dist} | |
Summary: %{descr} | |
URL: https://gist.github.com/mentha/f02780b4889a2d03fbd9380ff33428d9 | |
License: MIT | |
VCS: {{{ git_dir_vcs }}} | |
Source: {{{ git_dir_pack }}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# update OTP auth file of pam_oath | |
OATHFILE = '/etc/users.oath' | |
from base64 import b16encode, b16decode, b32encode | |
from sys import argv | |
import os | |
import subprocess as sp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from traceback import print_exc | |
import libvirt | |
import os | |
import re | |
import subprocess as sp | |
class PortForward: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from pprint import pprint | |
from argparse import ArgumentParser | |
from ipaddress import IPv4Address | |
from tempfile import NamedTemporaryFile | |
import libvirt | |
import os | |
import xml.etree.ElementTree as ET |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Send wake-on-lan packets to targets of ARP packets | |
MAX_AGE = 86400 * 7 | |
from sys import argv, stderr | |
from time import time | |
import os | |
import subprocess as sp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compress CIDR list by aggregrating adjacent subnets. */ | |
#define _POSIX_C_SOURCE 200809L | |
#include <arpa/inet.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> |