full screen background image

sosto.net blog - montagne del ticino
sosto.net blog - montagne del ticino


Linux memo

Encouraged by this post on Dominik's blog I installed enscript. I tested it by formatting the source of a C program, using the following command:

enscript --ps-level 2 --highlight=html --header="Listing of Johnson.c|%W|Page $% of $=" -p Johnson.ps Johnson.c

The result is a PostScript file (in this case Johnson.ps) which can then be transformed to a pdf using ps2pdf.

Shell script to create thumbnails
When I create a new photo album for my picture gallery I need to create thumbails of about 200x200 pixels. In order to do this, I wrote a small shell (bash) script:


echo "Creating thumbnails, please wait..."

for i in `ls *.jpg`
echo "Processing image $i .."
/usr/bin/convert -sample 200x200 $i _thb_$i

This creates a thumbnail for each jpg image in the current folder, prefixing its name with the _thb_ string. Note that the command convert is provided by the ImageMagick software suite.

Emacs: convert tabs into spaces
In order to convert the tabulations into white spaces, in Emacs, add the following line in the ~/.emacs file (in your home directory):

(setq-default indent-tabs-mode nil)

This can be useful if you want to export the indented code (for example, if you have to insert it in a verbatim environment in LaTex).

Need to work late at night?
You are confronted to an approaching deadline and you need to work during the night: luckily, there's coffee. Surfing on the web I found this interesting article:

Scientists prove caffeine can increase memory performance
Using a brain imaging technique researchers have demonstrated that caffeine exerts a positive influence on short-term working memory and reaction times by its effect on distinct regions of the brain. [...]

sosto.net tombstone

Vuoi lasciare un commento?

nome* (massimo 20 caratteri)

e-mail di contatto (non sarà pubblicato)


Per evitare lo spam, per favore copia questo codice:
security code


View all hashtags.



clemspace.ch gallery


agosto (1)
luglio (1)
giugno (1)


articoli più letti

Perché sono contrario al ParcAdula

Via alta della Val Carassina

Cassarate, il fiume di Lugano



sosto.net - top of the page

cross cross cross sandwich fullscreen fullscreen resize resize fullscreen fullscreen fullscreen fullscreen fullscreen fullscreen fullscreen