This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |