Ubuntu advanced home user’s useful commands
All the wonderfully useful commands in Ubuntu/Linux I need every year and then and therefore fail to remember …
history
nslookup
>set querytype=soa
>yourlookupdomain.com
sudo wondershaper eth0 2000 500
Resize all images to 640xn while preserving aspect ratio
mogrify -resize 640 *.jpg
Force images to exactly that size, disregarding aspect ratio
mogrify -resize 640×480! *.jpg
Resize image to x percent of previous size
mogrify -resize 20% *.jpg
cat /dev/scd0 > /media/CACHE/yourLegalBackupCopy.iso
/mysql -u username -p -h localhost databaseName < /home/you/Desktop/myDatabaseDump.sql
VBoxManage clonevdi sourceImage.vdi targetImage.vdi
ps ax | grep processName
env UBUNTU_MENUPROXY= gimp&
sudo shutdown -h 22:30
sudo alien -i package.deb
(copy this into a shell script and “chmod u+x scriptname” it in order to be able to execute it)
for f in *.flv
do
ffmpeg -i “$f” -acodec libmp3lame -ab 128k “${f%.flv}.mp3”
done
(you can also use the newer avconv -i input.flv output.mp3 for conversion)
ffmpeg -f image2 -i result%04d.jpg video.avi
This takes all images named like result0001.jpg, must be in a continuous range
use -sameq parameter if you want to preserve the original quality
Set the desired bitrate (here 1 mbit/s) -vb 1M
pdfimages mypdf.pdf imagePrefix
(and in order to convert the resulting ppm files to jpeg, requires sudo apt-get install imagemagick)
convert *.ppm result.jpg
convert *.jpg foo.pdf
rtmpdump -r “rtmp://apasfw.apa.at/cms-worldwide/” -a “cms-worldwide/” -y “mp4:2012-10-28_1635_sd_02_ERLEBNIS-OESTERREICH_Wer-was-wird–wird-W__4836103__o__0000294809__s4836105___ch_ORF2HiRes_16362424P_16592421P_Q4A.mp4” -v -o Beitrag.mp4
The url to the video can be retrieved from the respective video’s page source (needs to be url-decoded to be used like this)