Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
jfeilbach / gist:fd109c7dbc9798ce6e47358b82d0be76
Last active January 10, 2025 10:22
DNS over TLS (knot resolver) setup using 1.1.1.1 on macOS
# Configuring DNS-over-TLS on macOS
# Worked on macOS 10.13.4
brew -v update
brew -v doctor
# Next two commands are optional
sudo chown -R $(whoami) $(brew --prefix)/*
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile
# Install DNS client
brew install knot-resolver
# Should be installed to something like: /usr/local/Cellar/knot-resolver/2.3.0/sbin/kresd
Validating a broken DNSSEC domain:
trying to resolve a domain that has DNSSEC issues should only return a SERVFAIL returncode without any DNS data:
~ dig www.dnssec-failed.org
; <<>> DiG 9.7.2-P2 <<>> www.dnssec-failed.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 17692
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
@jfeilbach
jfeilbach / gist:811b73e790c8072fc8c38fba7da3b10e
Last active May 20, 2018 15:51
replace_tracker.sh update transmission client torrents matching tracker string with new tracker URL
#!/bin/bash
# Borrowed from https://gist.github.com/Adadov/e352c05cf2f90031e5b9b623509a02da
GNU='/usr/local/bin/gsed'
if [ "$(uname)" == "Darwin" ]; then
echo "macOS detected. Using GNU sed instead of built-in."
if [[ -f "$GNU" ]]; then
echo "GNU sed found at $GNU."
SED=${GNU}
@jfeilbach
jfeilbach / ffmpeg.sh
Last active September 22, 2018 16:46
mux multiple .ts files with ffmpeg
#!/bin/bash
START='0'
END='137'
for i in `seq $START $END`
do echo file "'${i}.ts'" >> input.txt
done
# ffmpeg concat
/usr/local/bin/ffmpeg -f concat -i input.file -c copy output.ts
$ sudo pmset -g live
System-wide power settings:
SleepDisabled 0
Currently in use:
standby 1
Sleep On Power Button 1
womp 1
autorestart 0
hibernatefile /var/vm/sleepimage
powernap 1
rsync -P -avz user@host:/onefolder otherfolder/ | python $basename.py
import progressbar
import sys
def read_stdin():
line = ''
while sys.stdin:
try:
c = sys.stdin.read(1)
The Publish production Tomcat app servers have crashed. Please restart the app servers by running ' service tcat restart'. If OOM killer has been running reboot the hosts by running 'sudo shutdown -r now'. You can check by running. 'dmesg | egrep -i 'killed process''.
-- The hostnames are l14270 and l14271.
-- SSH alias is publish.app.prod[1,2]
@jfeilbach
jfeilbach / netserv.sh
Last active March 14, 2023 23:50
netserv.sh
#!/bin/bash
services=$(networksetup -listnetworkserviceorder | grep 'Hardware Port')
while read line; do
sname=$(echo $line | awk -F "(, )|(: )|[)]" '{print $2}')
sdev=$(echo $line | awk -F "(, )|(: )|[)]" '{print $4}')
#echo "Current service: $sname, $sdev, $currentservice"
if [ -n "$sdev" ]; then
ifout="$(ifconfig $sdev 2>/dev/null)"
@jfeilbach
jfeilbach / getinfo.sh
Last active March 14, 2023 23:50
getinfo.sh
#!/bin/sh
clear
sExternalMACALService="http://dns.kittell.net/macaltext.php?address="
# List all Network ports
NetworkPorts=$(ifconfig -uv | grep '^[a-z0-9]' | awk -F : '{print $1}')
#echo $NetworkPorts
# Function to convert IP Subnet Mask to CIDR
@jfeilbach
jfeilbach / transmission-daemon.service
Last active September 22, 2018 16:44
systemd unit file for transmission-daemon /lib/systemd/system/transmission-daemon.service
[Unit]
Description=Transmission BitTorrent Daemon
After=network.target
[Service]
Environment=TRANSMISSION_HOME=/home/jason/.config/transmission-daemon/
User=jason
Type=notify
ExecStart=/usr/bin/transmission-daemon -f --log-debug --logfile /var/log/transmission/transmission.log -g /home/jason/.config/transmission-daemon/
ExecStop=/bin/kill -s STOP $MAINPID