The following is a collection of useful command line snippets that I use regularly.
- PDF modification
- Text edition
- File management
- Software development
- Network
- Photos
- Video
- Web
- Pro
- Miscellaneous
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=full.pdf page1.pdf page2.pdf page3.pdf
gs -sDEVICE=pdfwrite -dSAFER -o p%d.pdf multipage.pdf
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=1 -dLastPage=12 -sOutputFile=outfile_p1-p12.pdf original_input.pdf
pdfjam –suffix out –trim '6.5cm 4.5cm 6.5cm 4.5cm' – source.pdf
sed -i -e "1i Here\nIs\nMy\nHeader\n" file.txt
find . -type f -name '*~' -exec rm -f '{}' \;
fdupes -r ~/dir1 ~/dir2 -d
find . -type f | sed 's/\(.*\/\)\(.*\)/mv "\1\2" "\1\L\2"/' |sh
find . -name "*.java" -print | xargs grep "exampleOfString"
mvn clean
mvn release:prepare -Darguments=-Dgpg.passphrase="My\ passphrase"
mvn release:perform -Darguments=""
ifconfig wlan0 down
macchanger -A wlan0
ifconfig wlan0 up
# On server station (ip=192.168.1.10)
iperf -s -f m
# On client station
iperf -c 192.168.1.10 -f m
jhead -ta+0:30 *.jpg
exiv2 rename *.jpg
mencoder movie.ogv -ovc xvid -oac mp3lame -xvidencopts pass=1 -o movie.avi
ffmpeg -i movie.mts -vcodec libx264 -crf 23 -acodec libmp3lame -ac 2 -ab 192k -s 640x360 movie.avi
mplayer -vo caca movie.avi
wget -r -A '*.pdf' url/path
# Pulse Secure connection
"/path/to/Pulse Secure/Integration/pulselauncher.exe" -url "https://a.pulse.secure/url" -u "a_username" -p "a_password" -r "DOMAIN"
# Pulse Secure disconnection
"/path/to/Pulse Secure/Integration/pulselauncher.exe" -signout -url "https://a.pulse.secure/url"
echo -ne '\xaa\xbb\x06\x00\xff\xff\x06\x01\x64\x63' > /dev/ttyUSB0
apt-get install jpnevulator
jpnevulator --ascii --timing-print --tty "/dev/ttyUSB0" --read
shuf -i 1024-4096 -n 1