Commands
ADB Screen Record
adb exec-out screenrecord --output-format=h264 - | ffplay -framerate 60 -framedrop -bufsize 16M -
Combine PDFs
qpdf --empty --pages *pdf -- out.pdf
Connect to a website through a local socks proxy
proxychains -f <(echo "[ProxyList]\nsocks5 127.0.0.1 9050") openssl s_client -connect my.domain.com:443
Ffmpeg Video from Images
ffmpeg -framerate 10 -pattern_type glob -i '*.jpg' -r 30 -c:v h264 -pix_fmt yuv420p "out.mp4"
Json parse stdin line by line
./program-with-json-output | while IFS= read -r line; do echo "$line" | jq . 2> /dev/null; jqstatus=$?; if [ $jqstatus -ne 0 ]; then echo "$line"; fi; done
Remote tcp capture with wireshark and sudo
read -r -s pass
mkfifo -m 600 pipe.fifo
echo $pass | ssh -q myserver "sudo -Sp '' tcpdump -s 0 -n -w - -U -i eth0" > pipe.fifo &
wireshark -kni pipe.fifo
SSH public key from private key
ssh-keygen -y -f privkey.pem > pubkey.pem
View output of another process in bash
tail -f /proc/$(pgrep myprogramm)/fd/1 # 2 for stderr
Xrandr Monitor Merge/Unmerge
xrandr --listmonitors
xrandr --setmonitor <MyName> auto <Monitor 1 Name>,<Monitor 2 Name>
xrandr --delmonitor <MyName>
Links