Skip to content

Instantly share code, notes, and snippets.

View sneak's full-sized avatar

Jeffrey Paul sneak

View GitHub Profile
Script started on Wed Feb 26 01:18:46 2020
command: bash -c make run
rsync -avP ./disktest.sh root@fsn1.datavibe.net:/root/disktest.sh
sending incremental file list
disktest.sh
700 23% 0.00kB/s 0:00:00 2,977 100% 2.17MB/s 0:00:00 (xfr#1, to-chk=0/1)
sent 1,003 bytes received 65 bytes 712.00 bytes/sec
total size is 2,977 speedup is 2.79
ssh root@fsn1.datavibe.net "bash /root/disktest.sh 2>&1"
#!/bin/bash
set -x
RAWDISKS=$(
cd /dev/disk/by-id ;
ls -1 nvme-SAMSUNG* | grep -v part
)
FULLPATHS=""
@sneak
sneak / get-tor-fingerprint.sh
Last active February 1, 2020 16:56
how to get the tls fingerprint for an onion service in a format compatible with weechat
#!/bin/bash
ONION="gg5kq3jrfshwr7qygs3tl5vwnwf4ocfh6jeahumejdct6frld3kvaqqd.onion"
PORT=6697
torify openssl s_client -connect $ONION:$PORT -showcerts 2>/dev/null |
openssl x509 -in /dev/stdin -noout -fingerprint |
awk -F'=' '{print $2}' |
tr -d ':'
@sneak
sneak / ntp.conf
Created January 11, 2020 21:25
ntpd stratum 1 timeserver config
driftfile /var/lib/ntp/ntp.drift
leapfile /usr/share/zoneinfo/leap-seconds.list
# Enable this if you want statistics to be logged.
statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
@sneak
sneak / run.sh
Created November 19, 2019 13:46
/etc/service/syncthing/run
if [[ ! -d /secure/sneak/sync/Sync ]]; then
echo "sync dir not mounted, exiting" > /dev/stderr
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$(hostname) cannot access sync dir \"}" https://hooks.slack.com/services/lolno &
sleep 600
exit 1
fi
echo 204800 > /proc/sys/fs/inotify/max_user_watches
export STNODEFAULTFOLDER=1
@sneak
sneak / bonnie.nostromo.txt
Created November 18, 2019 13:02
iMacPro1,1 bonnie++
sneak@nostromo:~$ bonnie++ -d ./tmp
Writing a byte at a time...done
Writing intelligently...done
Rewriting...done
Reading a byte at a time...done
Reading intelligently...done
start 'em...done...done...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...done.
@sneak
sneak / 100.spyware.sh
Last active November 18, 2019 15:15
bashrc include to disable (some) spywares
# https://consoledonottrack.com
export DO_NOT_TRACK=1
# the rest
export HOMEBREW_NO_ANALYTICS=1
export GATSBY_TELEMETRY_DISABLED=1
export STNOUPGRADE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
@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
@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"'
-- 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 --