Convert a flac file into an mp3 file

Reading Time: < 1 minute On 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 minute For 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.