Skip to content

Instantly share code, notes, and snippets.

View lestercheung's full-sized avatar
🫠

Lester Cheung lestercheung

🫠
View GitHub Profile
@leifg
leifg / Vagrantfile
Last active August 15, 2024 15:13
Add a second disk to system using vagrant
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
anonymous
anonymous / 900D30E8-2DD9-4EE9-81EC-F8163935CD4A-d7843028a9bc685a74cac82a1c75206a.lrprev
Created March 26, 2013 09:54
metadata embedded inside adobe lightroom preview files.
pyramid = {
colorProfile = "AdobeRGB",
croppedHeight = 213,
croppedWidth = 320,
digest = "d7843028a9bc685a74cac82a1c75206a",
fileTimeStamp = 319349647,
fingerprint = "C108BA19E3369F5631F97CAC61E54BBB",
formatVersion = 3,
levels = {
{
anonymous
anonymous / lsusb
Created November 15, 2015 10:12
ASUS ZenBook UX305CA
Bus 002 Device 002: ID 0bda:8153 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 8087:0a2a Intel Corp.
Bus 001 Device 003: ID 064e:9700 Suyin Corp. Asus Integrated Webcam
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
anonymous
anonymous / gist:4a752288b785312ca840
Created December 31, 2015 16:35
import string
import random
def pw_gen(size = 8, chars=string.ascii_letters + string.digits + string.punctuation):
return ''.join(random.choice(chars) for _ in range(size))
print(pw_gen(int(input('How many characters in your password?'))))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanlouisferey
jeanlouisferey / LXD_SSH_KEY.md
Last active August 26, 2024 23:53
How to create a LXD Container with your ssh key in it (and with ssh server in the container)
@alex-red
alex-red / blacklist.sh
Last active June 6, 2024 11:17
Geo-IP Block for Edgerouter
#Backup previous list
rm -f BLACKLIST_OLD.txt
mv BLACKLIST.txt BLACKLIST_OLD.txt
touch BLACKLIST.txt
#Download the file from PGL.YOYO
curl -O http://pgl.yoyo.org/as/iplist.php
#Download the file from emerging threats
curl -O http://rules.emergingthreats.net/fwrules/emerging-Block-IPs.txt
#Download the first file from SpamHaus
curl -O http://www.spamhaus.org/drop/drop.txt
@smoser
smoser / README.md
Last active November 4, 2024 18:19
qemu to linux mapping of smbios / dmi information

Mappings for DMI/SMBIOS to Linux and dmidecode

Information can be put into dmi tables via some qemu-system hosts (x86_64 and aarch64). That information is exposed in Linux under /sys/class/dmi/id and can be read with dmidecode. The names are very annoyingly inconsistent. The point of this doc is to map them.

Mappings

Example qemu cmdline:

qemu-system-x86_64 -smbios type=<type>,field=value[,...]

qemu-system-x86_64 -smbios type=0,vendor=superco,version=1.2.3

How to disable AAAA lookups?

Problem description

The corporate DNS server that is outside of our control doesn't handle AAAA queries properly. When sent a AAAA query, the DNS server doesn't respond. A properly working DNS server returns NOERROR, ANSWER: 0, if there is no AAAA record for a given name. Misconfigured DNS server doesn't send any response.

In an IPv6-enabled environment, the client tries to resolve both A and AAAA addresses. If the DNS server doesn't send any reply, the client repeats the query and eventually times out. Only after the AAAA query times out, the client will use the A address. Waiting for the timeouts renders utilities like curl, kubectl, oc, ... and others unusable.

Identifying the AAAA lookup problem