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
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
# Context: https://stackoverflow.com/a/56701174/149900 | |
from io import StringIO | |
WHITESPACE = " \t\r\n" |
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/bash | |
for i in $(cut -s -d: -f4 /etc/passwd | sort -u ); do | |
if ! grep -q -P "^.*?:x:$i:" /etc/group; then | |
echo "Group $i is referenced by /etc/passwd but does not exist in /etc/group" | |
fi | |
done |
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 | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
# | |
# Copyright (C) 2024, Pandu POLUAN | |
import fileinput | |
import re |
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
; The purpose of this script is to start Need for Speed: Underground 2 (NFSU2) from TexMod, after loading a | |
; texture replacement package (TPF). This script also sets CPU Affinity of NFSU2's SPEED2.EXE, because SPEED2.EXE | |
; is not happy with a multicore processor; it wants to stay on one core and one core only. | |
#Include <Affinity_Set> | |
; Affinity_Set() is a function from affinity.ahk, which should be placed in | |
; a lib/ subdirectory (from where this script is located) | |
; My version was from https://github.com/dufferzafar/Autohotkey-Scripts/blob/master/lib/Affinity.ahk | |
; ===== TUNABLES ===== |
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.9 | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
import os | |
import time | |
import xxhash | |
from collections import namedtuple |
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
import pprint | |
import random | |
import timeit | |
MEMBS_COUNT = 100 | |
indexes = list(range(MEMBS_COUNT)) | |
random.shuffle(indexes) | |
orig_dict = {} |
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
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
facility = 23 # local7; see RFC 5424 | |
formatter = RFC5424Formatter(appname="my-awesome", facility=facility) | |
syslog_handler = UTF8DatagramHandler("127.0.0.1", 514) | |
syslog_handler.setFormatter(formatter) | |
syslog_handler.setLevel(logging.DEBUG) | |
logger.addHandler(syslog_handler) |
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
# This code is released to the Public Domain. | |
# Alternatively, you can use one of the following licenses: Unlicense OR CC0-1.0 OR WTFPL OR MIT-0 OR BSD-3-Clause | |
# IMPORTANT: | |
# Please do note that this does NOT attempt to perform complex guessing e.g. CP437 or CP850 or GB18030 or JIS or... | |
# Well, you get the idea. | |
# This function will simply try to guess the most common *Unicode* encoding, i.e., UTF-8, UTF-16, and UTF-32 | |
# More ... 'exotic' unicode encoding such as UCS-1, UCS-2, UTF-7, etc are NOT detected. (They would likely be | |
# detected as "utf-8" by this function) | |
# If you need more 'advanced' detection, use the heavyweight "chardet" library instead. |
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
import os | |
import socket | |
import sys | |
import struct | |
import contextlib | |
# Reference for the data structure / interaction: | |
# https://tools.ietf.org/html/draft-miller-ssh-agent-00 | |
# Good to read: |
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
# This code is released to the Public Domain. | |
# Alternatively, you can use one of the following licenses: Unlicense OR CC0-1.0 OR WTFPL OR MIT-0 OR BSD-3-Clause | |
param( | |
[Parameter(Mandatory=$True,Position=1)] | |
[string] $server, | |
[string] $iface = "Wi-Fi", # EDIT AS NEEDED | |
[string] $dns_service = "dnscrypt-proxy" # EDIT AS NEEDED | |
) |
NewerOlder