Articles

All my command lines

Here is a collection of commands lines, code and configuration snippets I collected for several years while working as an Open-Source Software Engineer: Files Management  Archives System & Shell  Network  Hardware  Apache  Web  Video  Audio Image Processing Text, Date & Document Processing dpkg, APT & Aptitude RPM, Urpmi & Yum  OpenSSH GPG & OpenSSL i18n …
‚ěü Read more

Image Processing commands

Conversion Convert several files from a format to another: $ convert img_*.bmp img_%04d.png Resize Resize images of the current folder to progressive jpeg. Resized images will not be greater than 600x600, but the aspect ratio will be respected: $ convert -resize 600x600 -sharpen 1 -interlace Line ./* ./pict%04d.jpg …
‚ěü Read more

PDF commands

Case-insensitive search of a string in a PDF, thanks to pdfgrep  : $ pdfgrep --page-number --ignore-case 'my_string' ./document.pdf Convert a PDF to a JPEG file at 150 dpi: $ convert -density 150 ./document.pdf ./document.jpg Extract images from a PDF document: $ pdfimages -j document.pdf prefix Compile all JPEG files in …
‚ěü Read more

Text, Date & Document processing commands

Search  ¶ Count the number of lines with at least one occurrence of the y character: $ cat test.txt asd dd :; > y YYYyy yyy . asdkjlyes kjkjhkjhy $ grep -o '.*y.*' ./test.txt | wc -l 3 Replace  ¶ Text replacement: $ sed 's/string to replace/replacement string/g' original-file.txt > new-file.txt Dynamic, in-place …
‚ěü Read more

Hardware commands

Computer Get Mac hardware¬†model: $ sudo dmidecode -s system-product-name MacBookAir5,2 Disk Show all S.M.A.R.T. info of a¬†disk: $ smartctl -a /dev/ada4 Low-level format of the hda¬†device: $ dd if=/dev/zero of=/dev/hda Same as above but for parano√Įd, as random bits will ‚Ķ
‚ěü Read more