full screen background image

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

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:

#!/bin/bash

echo "Creating thumbnails, please wait..."

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


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. [...]
source


sosto.net tombstone

coshomments
Do you want to say something?


name* (max 20 characters)

contact e-mail* (it won't be published)

comment*


hastags

View all hashtags.

search


galleries

Instagram
VSCO
clemspace.ch gallery

archive

December (0)
November (0)
October (1)

Archives

popular posts

Da Bosco Gurin alla Val Bedretto, via Basodino

Gazzirola e Camoghè

Via alta della Val Carassina

clemspace.ch

clemspace.ch

sosto.net - top of the page


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