Ubuntu – Ripping Audio CDs to FLAC and MP3 with abcde

ubuntu-logo

I have an aging laptop that with Ubuntu 12.04 (Lucid) installed that I wanted to use to rip my CD collection to FLAC and MP3.

I didn’t want to have to use a GUI and I wanted the process to be as automated as possible – so I settled on the command line tool abcde (A Better CD Encoder).

First I installed all of the software required:

sudo apt-get install abcde cd-discid lame cdparanoia id3 id3v2

Then I made a backup of the abcde configuration file:

cp /etc/abcde.conf /home/myusername

I then copied and pasted a great abcde.conf file that I found online to /etc/abcde.conf:

sudo nano /etc/abcde.conf

This is the abcde.conf that I used:

# -----------------$HOME/.abcde.conf----------------- #
# 
# A sample configuration file to convert music cds to 
#       MP3 format using abcde version 2.3.99.6
# 
#       http://andrews-corner.org/abcde.html
# -------------------------------------------------- #

# Specify the encoder to use for MP3. In this case
# the alternatives are gogo, bladeenc, l3enc, xingmp3enc, mp3enc.
MP3ENCODERSYNTAX=lame 

# Specify the path to the selected encoder. In most cases the encoder
# should be in your $PATH as I illustrate below, otherwise you will 
# need to specify the full path. For example: /usr/bin/lame
LAME=lame

# Specify your required encoding options here. Multiple options can
# be selected as '--preset standard --another-option' etc.
LAMEOPTS='--preset extreme' 

# Output type for MP3.
OUTPUTTYPE="mp3"

# The cd ripping program to use. There are a few choices here: cdda2wav,
# dagrab, cddafs (Mac OS X only) and flac.
CDROMREADERSYNTAX=cdparanoia            

# Give the location of the ripping program and pass any extra options:
CDPARANOIA=cdparanoia  
CDPARANOIAOPTS="--never-skip=40"

# Give the location of the CD identification program:       
CDDISCID=cd-discid            

# Give the base location here for the encoded music files.
OUTPUTDIR="$HOME/music/"               

# Decide here how you want the tracks labelled for a standard 'single-artist',
# multi-track encode and also for a multi-track, 'various-artist' encode:
OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}.${TRACKFILE}'
VAOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${TRACKNUM}.${ARTISTFILE}-${TRACKFILE}'

# Decide here how you want the tracks labelled for a standard 'single-artist',
# single-track encode and also for a single-track 'various-artist' encode.
# (Create a single-track encode with 'abcde -1' from the commandline.)
ONETRACKOUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}'
VAONETRACKOUTPUTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | tr -d \'\"\?\[:cntrl:\]
}

# What extra options?
MAXPROCS=2                              # Run a few encoders simultaneously
PADTRACKS=y                             # Makes tracks 01 02 not 1 2
EXTRAVERBOSE=y                          # Useful for debugging
EJECTCD=y                               # Please eject cd when finished :-)

I found that this configuration work very well for me and I especially liked that it put my FLAC and MP3 files into different folders.

The only issue that I had was that abcde would ask me if I wanted to edit metadata for the CD that I was ripping, requiring user input to continue.

Fortunately I found a setting in my backed-up abcde.conf that lets abcde run in non-interactive mode:

# Define if you want abcde to be non-interactive.
# Keep in mind that there is no way to deactivate it right now in the command
# line, so setting this option makes abcde to be always non-interactive.
#INTERACTIVE=n

So, I simply added the following line to my abcde.conf and then I was set:

INTERACTIVE=n

All I have to do now is simply put a CD in the CD-ROM drive and then open a terminal and type:

abcde

Then when the CD ejects I simply put in the next CD, press the up arrow to bring up the last terminal command (abcde), and then press the Enter key to start the process over again.

Other than that I shared my music folder so that I can copy the FLAC and MP3 files to my desktop for backup.

All in all a great way to back up my CD collection with minimal fuss and interaction!

Update:

I did a clean install of Ubuntu 14.04 and there was an issue finding my cdrom drive. I successfully mounted the drive as follows:

sudo mkdir -p /mnt/cdrom
sudo mount -t iso9660 -o ro /dev/sr0 /mnt/cdrom
mount

After that I was able to run abcde as follows:

abcde -d /dev/sr0

Sources: Ubuntu Forum

ViMP – Upgrading From Version 2.2.x to 2.5 (Ubuntu Server 10.4 Lucid)

Yesterday I finally upgraded ViMP Community Edition to 2.2.x and so today I am upgrading to 2.5.x.

At the time of writing the latest version of ViMP is vimp.framework-2.5.4-r19900-community.tar.gz – which can be downloaded from here.

For clarification my system variables are as follows (obviously you may need to change them if yours are different):

  • ViMP installation directory – /var/www/showvid/data/
  • MySQL user – root
  • MySQL ViMP database – showvid

The upgrade process was as follows.

First backup the ViMP directory and copy the ViMP tarball to your server.

Copy the tarball to /var/www/showvid/data:

sudo cp vimp.framework-2.5.4-r19900-community.tar.gz 
/var/www/showvid/data/

Change directory to /var/www/showvid/data/:

cd /var/www/showvid/data/

Extract the vimp-framework tarball:

sudo tar xvzf vimp.framework-2.5.4-r19900-community.tar.gz

Delete lib/auth/stAuthProvider.php

cd /lib/auth/
sudo rm stAuthProvider.php

Next we need to run the data/sql/updates.sql file from the ViMP tarball – make sure that you extract the tarball on your computer so that you can import it to your server.

Note: there are other .sql files in the sql folder but they are only used if you have modules installed etc.

Updates.sql can be run from the command line but I found it easier to use phpmyadmin – which can be installed as follows:

sudo apt-get install phpmyadmin

I selected Apache2 as the webserver to reconfigure and then selected No to configure a database for phpmyadmin. Open a browser and open phpmyadmin on your ViMP server: http:\\<server-ip>\phpmyadmin. Log in with root and your mysql password.

Select the showvid database in the left hand panel and then click the import tab. Click the Browse button and select updates.sql in the data/sql folder. Then click the Go button.

Finally change directory to /var/www/showvid/data and rebuild the ViMP installation:

sudo ./symfony rebuild
sudo ./symfony i18:import

I did get an error when I imported updates.sql but ViMP did successfully upgrade.

ViMP – Upgrading From Version 2.1.x to 2.2 (Ubuntu Server 10.4 Lucid)

This post has been in my drafts folder for about a year as I had an unresolved issue trying to upgrade to ViMP version 2.2x. I finally had time to look at it again today and everything went smoothly – and I can’t remember what I did differently when it was not working. Note that I do not have any modules installed in ViMP and so I am not covering how to upgrade them (see here).

For clarification my system variables are as follows (obviously you may need to change them if yours are different):

  • ViMP installation directory – /var/www/showvid/data/
  • MySQL user – root
  • MySQL ViMP database – showvid

The upgrade process was as follows.

First I updated my Ubuntu 10.4 Server:

sudo apt-get update
sudo apt-get upgrade

Next backup the ViMP directory and then download vimp.framework-2.2.1-r19622-community.tar.gz from here.

Copy vimp.2.2.1 to the home directory of your ViMP server and then copy it from the home directory to /var/www/showvid/data:

sudo cp vimp.framework-2.2.1-r19622-community.tar.gz 
/var/www/showvid/data/

Change directory to /var/www/showvid/data/:

cd /var/www/showvid/data/

Delete the lib directory:

sudo rm -Rf lib/

Change directory to config:

cd config/

Delete databases.yml and propel.ini:

sudo rm databases.yml
sudo rm propel.ini

Return to the data directory and delete the contents of the cache directory:

cd ..
sudo rm -Rf cache/*

Extract the vimp-framework tarball:

sudo tar xvzf vimp.framework-2.2.1-r19622-community.tar.gz

Configure the showvid database and rebuild the ViMP installation:

sudo ./symfony configure:database mysql://DBUSER:DBPASSWORD@localhost
/DBNAME
sudo ./symfony rebuild
sudo ./symfony i18:import

Here my DBUSER is root and DBNAME is showvid.

Now that I have finally upgraded to 2.2.1 I can start work on upgrading to 2.5.x!

Ubuntu Server – Configuring Exim4 to Send Email Via Gmail

I am in the midst of trying to get Kaltura to work on Ubuntu 10.4 but am experiencing an error that is a bit of a show stopper.

The good news is that I needed to configure Exim4 to send email via Gmail – and that is what this post is about.

First install Exim4:

sudo apt-get install exim4

Configure Exim with the following command:

sudo dpkg-reconfigure exim4-config

Press the down-arrow key to select mail sent by smarthost; received via SMTP or fetchmail then press Tab, followed by Enter:

Enter a system mail name – this might be your company-name.com or a dummy domain name like I used below:

Next we specify an IP address to listen for incoming SMTP connections. This field was already completed for me with the value 127.0.0.1 ; ::1

The next screen was auto-completed with my host-name (which I had previously edited in /etc/hosts). The guide that I followed said to leave this blank but I left it as it was:

I left the Machines to relay for blank:

Select No don’t Hide local mail name in outgoing mail:

Select No to Keep number of DNS-queries minimal (Dial on-Demand):

For Delivery method for local mail choose mbox format in /var/mail/:

For Split configuration into small files select No:

Now we need to make several changes to the configuration to Exim4 in the file etc/exim4/exim4.conf.template:

sudo nano etc/exim4/exim4.conf.template

Find the line .ifdef DCconfig_smarthost DCconfig_satellite and add the following in that section (you can press Ctrl + W to search in nano):

send_via_gmail:
    driver = manualroute
    domains = ! +local_domains
    transport = gmail_smtp
    route_list = * smtp.gmail.com

The guide that I followed said to remove any other smarthost defined with domains = ! +local_domains in /etc/exim4/exim4.conf.template but I did not find any.

Next find the comment begin authenticators section and add the following:

gmail_login:
    driver = plaintext
    public_name = LOGIN
    client_send = : yourname@gmail.com : YourGmailPassword

Find the comment transport/30_exim4-config_remote_smtp_smarthost and add the following:

gmail_smtp:
    driver = smtp
    port = 587
    hosts_require_auth = $host_address
    hosts_require_tls = $host_address

Finally comment out the login section of /etc/exim4/exim4.conf.template:

#Commented out so that Gmail’s Public_name can equal “LOGIN”
#login:
# driver = plaintext
# public_name = LOGIN
#.ifndef AUTH_CLIENT_ALLOW_NOTLS_PASSWORDS
# Return empty string if not non-TLS AND looking up $host in passwd-file
# yields a non-empty string; fail otherwise.
# client_send = “<; ${if and{\
# {!eq{$tls_cipher}{}}\
# {!eq{PASSWDLINE}{}}\
# }\
# {}fail}\
# ; ${extract{1}{::}{PASSWDLINE}}\
# ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}”
#.else
# Return empty string if looking up $host in passwd-file yields a
# non-empty string; fail otherwise.
# client_send = “<; ${if !eq{PASSWDLINE}{}\
# {}fail}\
# ; ${extract{1}{::}{PASSWDLINE}}\
# ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}”
#.endif
#####################################################
### end auth/30_exim4-config_examples
#####################################################

Press Ctrl + O and then Enter to save and then Ctrl + X to save the file and exit nano.

Update Exim4 with the following command:

Run update-exim4.conf

Restart Exim4:

 /etc/init.d/exim4 restart

Finally test your configuration by sending an email via the command line:

mail user@example.com

Type a Subject and then press Enter.

Type a message and then press Enter.

Type a single . (dot) and then press Enter.

Press Enter again for a blank CC address.

Within a few minutes you should receive an email at the specified email address.

Sources:

http://www.manu-j.com/blog/wordpress-exim4-ubuntu-gmail-smtp/75/

http://basskozz.wordpress.com/2008/12/07/how-to-setup-a-raid5-software-mdadm-array-w-email-notifications-via-gmail-the-easy-way/ 

Ubuntu 10.4 / Linux Mint 9 Isadora – Flash Player Is Out Of Date

After using Ubuntu 11.4 (Natty) for a while I’ve decided to install Linux Mint 9 Isadora (which is built on Ubuntu 10.4 (the last Long Term Support release)). In the end Natty and Unity did not seem polished enough to me (so I will revisit Unity with subsequent releases to see how it is progressing).

I did like the almost full-screen browsing experience that Natty delivered as well as the ability to sync files, contacts and Tomboy Notes with Ubuntu One. With this in mind Mint 9 seemed like a good choice – I liked that it only featured one panel at the bottom of the screen and the Mint menu is well thought out. Add to that the fact that things like Flash are already installed and that I can type directly into the Mint menu to search for installed software and I was sold.

I installed Mint 9 on two machines this week and was surprised when one of them reported that Flash was out of date (in both Firefox and Chromium). I checked Update Manager and tried re-installing flashplugin-nonfree to no avail.

I soon found a fix on the Ubuntu Forum though, which cleans up possible conflicting versions of Flash that might be installed and then re-installs flashplugin-nonfree from the repositories:

sudo apt-get purge lightspark
sudo apt-get purge swfdec-mozilla
sudo apt-get purge mozilla-plugin-gnash
sudo apt-get purge adobe-flashplugin
sudo apt-get purge flashplugin-nonfree
sudo apt-get purge flashplugin-installer
rm -f /home/**/.mozilla/plugins/*flash*so
rm -rf /home/**/.wine/dosdevices/c:/windows/system32/Macromed/Flash
sudo rm -f /usr/lib/firefox-addons/plugins/libflashplayer.so
sudo rm -f /usr/lib/mozilla/plugins/libflashplayer.so
sudo apt-get install flashplugin-nonfree
sudo ln -s /usr/lib/mozilla/plugins/flashplugin-alternative.so
/usr/lib/firefox-addons/plugins/libflashplayer.so

This glitch aside I am quite impressed with Mint so far – it has a great selection of applications and is quite user friendly too.

Ubuntu Server 10.4 Lucid – Upgrading Feng Office (Community Edition)

It turns out that upgrading Feng Office is actually very simple. I had installed Feng Office Community Edition version 1.7.4 recently and a few days ago found out that version 1.7.5 had been released.

It is advisable to backup your current installation before upgrading.

Log in to Feng Office as Admin and then click the Administration link:

Click the Upgrade button:

Click Start automatic upgrade:

Wait a couple of minutes and then log back in to your new version of Feng Office.

Ubuntu Server 10.4 Lucid – Installing and Configuring the Feng Office Backup v1.0 Plugin

In my previous post I configured Ubuntu Server with a set of scripts and cron jobs to backup (and restore) the Feng Office installation folder and the MySQL database to a Windows share.

The Feng Office wiki mentions an alternative backup method – in the form of a plugin that can be installed and configured from the Administration panel. The current version of the backup is v1.0 and it can be downloaded from here.

The plugin does include a basic readme.txt file but it does not clearly detail the steps that are needed to install the plugin.

First you will need to have wget and unzip installed on your server:

sudo apt-get update
sudo apt-get install wget unzip

You can either download the plugin (if the version has changed since this post was written) and upload it to your Feng Office server or use wget to download the file as follows:

wget http://sourceforge.net/projects/opengoo/files/plugins/backup/
backup_1.0.zip

Extract the plugin to your Feng Office installation folder – for me this is /var/www/feng_community:

sudo unzip backup_1.0.zip -d /var/www/feng_community/

Now open a browser and log in to Feng Office as the Administrative user.

Copy and paste the following URL to install the backup plugin (replace <server-ip> with the IP address of your Feng Office server):

http://<server-ip>/feng_community/index.php?c=backup&a=install

You should now see that the plugin is successfully installed:

Click the back to opengoo link to return to Feng Office and then click the Administration link:

In the Administration Panel click the Backup icon:

Click the Launch backup process link:

Once the backup is complete you can download it to your local machine and then delete the backup from the server:

If you check the Cron Events section of the Administration Panel you will see that the backup plugin can be scheduled and enabled quite simply.

The only problem that I see is that the backups are saved locally on the Feng Office server – this still requires the Admin user to download the backups to store them somewhere else.

Sadly as far as I can tell restoring the backup is a manual process. While it doesn’t look too taxing it would involve copying the backup to the Feng Office installation folder and then manually restoring the MySQL database backup.

While this backup process seemed to work quite nicely (and it is nice to be able to do from within the Feng Office interface) I plan to use the scripts and cron jobs that I already have set up to back up Feng Office.