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
| #include<stdio.h> | |
| #include<sys/prctl.h> | |
| __attribute__ ((constructor)) static void setup(void) { | |
| if(prctl(PR_SET_CHILD_SUBREAPER, 1) != 0){ | |
| perror("prctl"); | |
| } | |
| } |
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
| # Note: admin privileges is necessary | |
| import winreg | |
| i = 0 | |
| while True: | |
| key = winreg.EnumKey(winreg.HKEY_CLASSES_ROOT, i) | |
| value = winreg.QueryValue(winreg.HKEY_CLASSES_ROOT, key) | |
| if value.startswith('HaoZip.'): | |
| print(f'Deleting {key} ({value})...', end='', flush=True) |
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
| #!/bin/bash -e | |
| if [[ $# -gt 1 ]]; then | |
| idx=($@) | |
| else | |
| idx=(.git/objects/pack/pack-*.idx) | |
| fi | |
| objects=$(git verify-pack -v "${idx[@]}" | grep -v -e 'non delta' -e 'chain length' -e '.git/objects' | sort -k3nr | head) |
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 | |
| import os | |
| import sys | |
| from urllib.parse import parse_qs | |
| import subprocess | |
| import json | |
| from PyQt5 import QtWebKit, QtWebKitWidgets | |
| from PyQt5.QtCore import ( |
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 | |
| # inspired by https://github.com/busyloop/lolcat | |
| import sys | |
| import re | |
| import os | |
| from math import ceil | |
| from colorsys import hsv_to_rgb | |
| from unicodedata import east_asian_width |
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
| #include<stdio.h> | |
| #include<sys/time.h> | |
| #include<stdbool.h> | |
| #include<signal.h> | |
| #include<stdint.h> | |
| #include<sys/resource.h> | |
| volatile uint64_t count = 0; | |
| void alarm_handler() { |
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 | |
| import socket | |
| import struct | |
| import traceback | |
| import subprocess | |
| import time | |
| import signal | |
| import dnslib |
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/python3 | |
| import os | |
| def allrepofiles(): | |
| repo = '/var/lib/pacman/local' | |
| files = set() | |
| for dirpath, dirnames, filenames in os.walk(repo): | |
| for file in filenames: | |
| if file != 'files': |
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
| //===================================================================== | |
| // 让 zsh 的历史记录可读 | |
| //===================================================================== | |
| #include<stdio.h> | |
| #include<stdlib.h> | |
| #include<string.h> | |
| //--------------------------------------------------------------------- | |
| void readhist(); | |
| void writehist(); | |
| void usage(); |
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
| #include<sys/prctl.h> | |
| #include "subreap.mdh" | |
| #include "subreap.pro" | |
| /**/ | |
| static int | |
| bin_subreap(char *nam, char **args, Options ops, UNUSED(int func)) | |
| { | |
| int reaping = !OPT_ISSET(ops, 'u'); | |
| int result = prctl(PR_SET_CHILD_SUBREAPER, reaping); |
OlderNewer