How to find which files comes with a Ubuntu package

Reading Time: < 1 minute

apt-get install dlocate
dlocate -L <name_of_the_package>

ex:
dlocate -L sysstat
/.
/usr
/usr/lib
/usr/lib/sysstat
/usr/lib/sysstat/sa1
/usr/lib/sysstat/sa2
/usr/lib/sysstat/sadc
/usr/lib/sysstat/debian-sa1
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/mpstat.1.gz
/usr/share/man/man1/pidstat.1.gz
/usr/share/man/man1/sar.sysstat.1.gz
/usr/share/man/man1/sadf.1.gz
/usr/share/man/man1/iostat.1.gz
/usr/share/man/man8
/usr/share/man/man8/sa2.8.gz
/usr/share/man/man8/sa1.8.gz
/usr/share/man/man8/sadc.8.gz
/usr/share/doc

Ports and processes under windows

Reading Time: < 1 minuteIt is possible to know which process is listening on a specific port in Windows.
Do the following:

– Open a cmd window.
– Type "netstat -ano"
– Look right, there is the PID of the process you’re looking for in front of the port number.
– Type "tasklist /svc /FI "PID eq 4022"   Replace 4022 by your PID number.

How to make sushis

Reading Time: 3 minutesHow to make perfect rice for perfect sushis.

Buy the right rice. There are probably many good rice but the one we buy is called Kokuho Rose. If you live in Helsinki area, you can find some at Tokyokan in Annankatu. https://www.tokyokan.fi/

Cleaning the rice. You need to wash the rice before cooking it. Just pour some water in it, mix and empty. If the water is white it means the rice needed to be washed.

Cooking the rice.

Configure HTC Magic for Data and MMS on ELISA finland network

Reading Time: < 1 minuteI just upgraded my HTC Magic with Android 1.5 from the official release on the HTC website and I was surprised to see that all my settings, sms, contacts and pictures have been erased… So I had to reconfigure everything. Luckily one of my colleague is more persistant than me and got it all sorted.

Netact OSS System Administration licence test

Reading Time: < 1 minuteLast week I passed the Netact OSS 5.x system administration licence test. This test is a bit like some kind of certification.
We were 4 trainers in the room. Everybody failed except me.

Which port is this process listening to?

Reading Time: < 1 minuteThanks to the power of lsof:

lsof -i -P | grep -i process_lambda

Convert a flac file into an mp3 file

Reading Time: < 1 minuteOn Ubuntu, install flac.

#apt-get install flac lame

Put the following script in /usr/bin/ and give it a name (convert_flac.sh or flac2mp3.sh)

#!/bin/bash  
FLAC=$1
MP3="${FLAC%.flac}.mp3"
[ -r "$FLAC" ] || { echo can not read file \"$FLAC\" >&1 ; exit 1 ; } ;
metaflac --export-tags-to=- "$FLAC" | sed 's/=\(.*\)/="\1"/' >tmp.tmp
cat tmp.tmp
. ./tmp.tmp
rm tmp.tmp

How to set the $LANG and $LC_ALL properly

Reading Time: < 1 minute

How to view the current locale setting

# locale
LANG=en_US
LC_CTYPE= "en_US"
LC_NUMERIC= "en_US"
LC_TIME= "en_US"
LC_COLLATE= "en_US"
LC_MONETARY= "en_US"
LC_MESSAGES= "en_US"
LC_ALL=en_US

How to change the locale setting

To change the current locale setting, first confirm that the desired locale is
installed on the system with:

How to turn off the annoying speaker beep on Ubuntu

Reading Time: < 1 minute

There is a simple and easy way to make sure the speaker of your pc will stop beeping everytime you issue a wrong command.
Try

sudo lsmod | grep pcspkr

If you can see

pcspkr

Turn it off

How to flush the postfix queue

Reading Time: < 1 minuteFor some reason Postfix sometimes get stuck.
To see if there are some email stuck in the queue you can simply type:

oktober# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
38A1BF3B1* 1152 Thu Feb 12 00:22:39 www-data@oktober.momeunier.fr
momeunier@gmail.com

-- 1 Kbytes in 1 Request.

Fortunately there is a little binary called postqueue that can help.