This file contains 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
#define _DEFAULT_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <signal.h> | |
#include <sys/sysinfo.h> | |
#define LEDCTL "/sys/class/leds/led0/brightness" |
This file contains 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
#!/bin/sh | |
# This is free and unencumbered software released into the public domain. | |
if (file &> /dev/null; test $? -eq 127); then | |
file () { | |
# file -Lbi file | |
local l_mime | |
case "$(echo "$2" | rev | cut -d . -f1 | rev)" in | |
html) l_mime=text/html;; | |
css) l_mime=text/css;; |
This file contains 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
diff -udr a/libsrc/vhci_driver.c b/libsrc/vhci_driver.c | |
--- a/libsrc/vhci_driver.c 2018-03-18 22:07:40.126034770 +0800 | |
+++ b/libsrc/vhci_driver.c 2018-03-18 22:10:22.405106067 +0800 | |
@@ -150,7 +150,12 @@ | |
static int vhci_hcd_filter(const struct dirent *dirent) | |
{ | |
- return strcmp(dirent->d_name, "vhci_hcd") >= 0; | |
+ size_t l = strlen(dirent->d_name); | |
+ if (l < 8) |
This file contains 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 | |
import argparse | |
import logging | |
import os | |
import re | |
import requests | |
import shutil | |
import subprocess as sp | |
import tempfile |
This file contains 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> |
This file contains 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 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 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 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 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 }}} |
OlderNewer