Skip to content

Instantly share code, notes, and snippets.

View sneak's full-sized avatar

Jeffrey Paul sneak

View GitHub Profile
# set l2arc fill rate to 300MB/sec until full and 100MB/sec thereafter
# more info: https://github.com/zfsonlinux/zfs/wiki/ZFS-on-Linux-Module-Parameters#zfs_compressed_arc_enabled
D="/sys/module/zfs/parameters"
echo 200000000 > $D/l2arc_write_boost
echo 100000000 > $D/l2arc_write_max
@sneak
sneak / gist:1458ad848f57d9f0bb441835cf6d98ef
Created March 27, 2019 13:55
slack's SMTP service does not allow me to send mail to it :/
Mar 27 06:53:51 REDACTED postfix/smtp[16574]: 4F78D16021D: to=<[email protected]>, orig_to=<[email protected]>, relay=inbound-smtp.us-east-1.amazonaws.com[205.251.243.46]:25, delay=9.8, delays=0.01/0/7.9/1.9, dsn=5.7.1, status=bounced (host inbound-smtp.us-east-1.amazonaws.com[205.251.243.46] said: 550 5.7.1 IP address blacklisted by recipient (in reply to RCPT TO command))
# put this file in /etc/sysctl.d
# and run `sysctl -p /etc/sysctl.d/99-10ge.conf`
net.core.rmem_max = 134217728
# Maximum send socket buffer size
net.core.wmem_max = 134217728
#
# # Minimum, initial and max TCP Receive buffer size in Bytes
net.ipv4.tcp_rmem = 4096 87380 134217728
ssh-keygen -t rsa -b 4096 -o -a 500
#!/bin/bash
watch --interval=1 'uptime; free -h; arcstat; zpool iostat -y -v 1 1 ; zpool status -v'
@sneak
sneak / syncthing.run
Created October 5, 2019 06:27
syncthing runscript
#!/bin/bash
export STNODEFAULTFOLDER=1
export STNOUPGRADE=1
export HOME=/secure/sneak/sync
if [[ ! -d "$HOME" ]]; then
echo "sync dir not mounted, exiting" > /dev/stderr
sleep 10
exit 1
certbot --nginx -d example.com -d www.example.com --non-interactive --agree-tos -m [email protected]
-- open new textedit document
-- open safari, open prefs, go to password list view and enter password/unlock
-- run this script
-- credit to Joseph Rees, MrC, pken, nickhass
--
-- if it fails, stop everything, put the selection in textedit on a new line, put the safari pw selection on the last good item in the textedit file, and rerun
-- does not get the first entry in the list, didn't feel like fixing it
set x to 1
repeat while (x ≤ 5000)
-- Switch To Safari --
@sneak
sneak / convert.sh
Last active November 7, 2019 00:22
my stupid hw flash audio player requires wav or mp3
#!/bin/bash
# converts from alac 24/96 m4a to 16/44 320 cbr mp3 for my stupid hardware
find . -type f -name '*.m4a' -print0 | parallel -0 'ffmpeg -i {} -vsync 0 -b:a 320k -sample_fmt s16p -ar 44100 "{.}.mp3"'
@sneak
sneak / dl.sh
Created November 7, 2019 18:25
download all mysteries of the deep podcast episodes
for URL in $(curl -sf https://feeds.soundcloud.com/users/soundcloud:users:15876127/sounds.rss | tr "<>" "\n\n" | grep enclosure | awk -F'"' '{print $4}'); do wget $URL ; done