Posts

Showing posts from October, 2011

Downloading from web folders without index.html file

Using the following wget 1-liners, it is possible to download a folders/files when there is no index.html files present. wget -r --no-parent http://www.site.com/folder_with_no_index/ (tested and working) wget -r -nH --cut-dirs=2 --no-parent --reject="index.html*" http://mysite.com/dir1/dir2/data

Count number of lines in a file

The following counts the number of lines in a given file: sed -n '$=' NAP_Books.txt

Delete lines based on a length limit

The following command deletes lines which have less than 10 characters. sed '/.\{10\}/!d'

Create qrcode under linux

This is achieved using the following command: qrencode -o $FILENAME -l M "$MESSAGE_GOES_HERE" M is the level of error correction (L (lowest) to H(highest)). (default=L)

Webcam as barcode reader

zbar is a great program under linux to achieve this. There are two ways to scan a barcode: directly from the webcam by using zbarcam from an image of the barcaode (or qrcode): zbarimg image.png

Syncronize two folders

The following command syncronizes two folders. rsync -avr --size-only --stats /source_folder/ /destination_folder/

Compare two folders

Use the following command to compare the following folders (note the trailing /): diff -rq /folder_1/ /folder_2/

Change GNOME border width

To change border widths, simply open up the theme's Metacity XML file. For example, Human's theme is located in /usr/share/themes/$THEME_NAME/metacity-1/metacity-theme-1.xml Then, change the values in the following lines: <distance name="left_width" value="3"></distance> <distance name="right_width" value="3"></distance> <distance name="bottom_height" value="4"></distance>