Skip to content

Instantly share code, notes, and snippets.

View v0rts's full-sized avatar
💭
Excuse me... 😊

✦ v0rŦs ✦ v0rts

💭
Excuse me... 😊
View GitHub Profile
@v0rts
v0rts / docker
Created December 20, 2021 17:09
# <hash> = Docker file system overlay hash value
docker ps -qa | xargs -I{} bash -c "docker inspect {} | grep <hash> && echo {}"
aws ec2 describe-instances --filter "Name=instance-state-name,Values=running" --query "Reservations[*].Instances[*].[PrivateIpAddress, Tags[?Key=='Name'].Value|[0]]" --output tex
3s/\(.\{-}\zsPATTERN\)\{N}/REPLACE/
aws inspector preview-agents --preview-agents-arn arn:aws:inspector:{TEMPLATE_ARN}
aws ec2 describe-instances --filter "Name=instance-state-name,Values=running" --query "Reservations[*].Instances[*].[PrivateIpAddress, Tags[?Key=='Name'].Value|[0]]" --output text
@v0rts
v0rts / openssl_004
Last active January 17, 2021 00:07
echo -n "${String}" | openssl enc -d -aes-256-cbc -a -salt
@v0rts
v0rts / openssl_001
Last active January 15, 2021 15:58
openssl s_client -connect incomplete-chain-site.com:443 -servername incomplete-chain-site.com
@v0rts
v0rts / git001
Created December 24, 2020 21:26
git config --global init.defaultBranch main
SELECT relname, n_live_tup, n_dead_tup, trunc(100*n_dead_tup/(n_live_tup+1))::float "ratio%",
to_char(last_autovacuum, 'YYYY-MM-DD HH24:MI:SS') as autovacuum_date,
to_char(last_autoanalyze, 'YYYY-MM-DD HH24:MI:SS') as autoanalyze_date
FROM pg_stat_all_tables
ORDER BY last_autovacuum;
Enable SSH on a headless Raspberry Pi (add file to SD card on another machine)
For headless setup, SSH can be enabled by placing a file named ssh, without any extension, onto the boot partition of the SD card from another computer. When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled and the file is deleted. The content of the file does not matter; it could contain text, or nothing at all.
If you have loaded Raspbian onto a blank SD card, you will have two partitions. The first one, which is the smaller one, is the boot partition. Place the file into this one.