I will be adding and updating this list with new one-liners, corrections and so on ...
Find IP owner
dig +short myip.opendns.com @resolver1.opendns.com | xargs whois | grep -i org
CPU Usage
for i in $(seq $(getconf _NPROCESSORS_ONLN)); do yes > /dev/null & done
Find and Grep excluding folders
find / ! -path '/proc/' -type f -exec grep -lni "system.uuid" {} ;
Grep and show only lines without comments
grep -i -v ^# FILENAME
Converting all M4A files to MP3 using ffmpeg
for i in *.m4a; do ffmpeg -i "$i" -b:a 320k "${i/.m4a/.mp3}"; done
RSYNC using different SSH port
rsync -avzr -e "ssh -p $port" source/ user@remote:/destination
SED
Adding a character before a string
sed ’s/.*STRING/#&/‘ file
Removing specific line(s)
This will remove lines 5 through 10 and 12 - sed -i.bak -e '5,10d;12d' file
This will remove online line 12 - sed -i.bak -e '12d' file
Timelapse from lots of movies (example, you did a road trip and recorded lots of movies during the drive, this is an effortless way of creating a timelapse out of all the videos recorded)
for f in .mov; do echo "file $f" >> files.txt; done
[a file called "files.txt" is created]
ffmpeg -f concat -i files.txt -an -vcodec libx264 -filter:v 'setpts=0.05PTS' dashcam.mov
Network Troubleshooting
( grep sharedavail /proc/slabinfo|tr -d '#'; grep -i tcp /proc/slabinfo; grep -i udp /proc/slabinfo ) | column -t;
cat /proc/net/sockstat