List of commands for day-to-day use
(Updated on Mar 04, 2017)
SOCKS proxy using SSH
1
| ssh -N -D 1080 user@server |
where
wget
a website
1
| wget -rkp -l5 -np -nH -cut-dirs=1 https://example.com |
where
Capture screenshot
1
| import -window root screenshot.png |
Reduce PDF size
1
| gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=new_file.pdf original_file.pdf |
Unlock PDF file
1
| gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf |
Rotate video
1
2
3
4
5
| # Using mplayer(watch rotated video)
mplayer -vf-add rotate=1 sample.mp4
# Using ffmpeg
ffmpeg -i infile.mp4 -strict -2 -vf "transpose=1" outfile.mp4 |
Convert 3GP to MP4
1
| ffmpeg -i VID_0050.3gp -strict -2 -q:a 0 -ab 64k -ar 44100 VID_0050.mp4 |
FLV to MP4
1
| ffmpeg -i input.flv -qscale 1 -ar 22050 output.mp4 |
1
2
3
4
| ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3
# or specify codec to use `libmp3lame` in this case.
ffmpeg -i video.mp4 -f mp3 -codec:a libmp3lame -ab 320000 -vn music.mp3 |
where
Cut video by time interval
Cut video starting from 19 min 49 seconds up to 04 mins 18 seconds.
1
| ffmpeg -y -i Video.mp4 -qscale 1 -ss 00:19:49.0 -t 00:04:18.0 -acodec copy -vcodec copy output.mp4 |
Note: -sameq
was removed in recent version of ffmpeg
1
| mplayer -dumpaudio movie.flv -dumpfile movie_audio_track.mp3 |
Reduce resolution
1
| ffmpeg -i Birdman.mp4 -strict -2 -s 720x480 birdman.mp4 |
recordmydesktop
1
| recordmydesktop -x 100 -y 100 --width 1280 --height 720 --freq 48000 --fps 30 -o ~/Videos/recordings/test-video.ogv |
Include subtitles(Use subtitleeditor
to create subtitle)
1
| ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi |
Resize image 50% of its original size
1
| convert dragon.gif -resize 50% half_dragon.gif |
Control compression level of an image
1
| convert input.png -quality 75 output.jpg |
Clean up ~/.ccache/
directory
1
2
3
4
5
| # View statistics using
ccache -s
# Clear cache using
ccache -C |