HowTo Archives

How To Backup Your iPod Music on Linux

As an iPod owner and Linux user, there are a few options I have on Linux for managing my iPod music library. In my opinion, the best option available is gtkpod. One great option of gtkpod is the ability to backup your iPod music to your hard drive for free. The purpose of this guide is to explain a little about gtkpod and show you how to backup your iPod to your hard drive on Linux. I am using Ubuntu to back up my iPod music with gtkpod. gtkpod is available for any Linux distribution that is running gnome libraries and has X installed.

About gtkpod

gtkpod is a platform independent Graphical User Interface for Apple’s iPod using GTK2. It supports the first to fifth Generation including the iPod mini, iPod Photo, iPod Shuffle, iPod nano, and iPod Video.

What can gtkpod do?

  • Read your existing iTunesDB (i.e. import the existing contents of your iPod including playcounts, ratings and on-the-go playlists).
  • Add MP3, WAV, M4A (non-protected AAC), M4B (audio book), podcasts, and various video files (single files, directories or existing playlists) to the iPod. You need a third party product to download podcasts, like ‘bashpodder’ or ‘gpodder’
  • View, add and modify Cover Art
  • Browse the contents of your local harddisk by album/artist/genre by adding all your songs to the ‘local’ database. From there the tracks can be dragged over to the iPod/Shuffle easily.
  • Create and modify playlists, including smart playlists.
  • You can choose the charset the ID3 tags are encoded in from within gtkpod. The default is the charset currently used by your locale setting.
  • Extract tag information (artist, album, title…) from the filename if you supply a template.
  • Detect duplicates when adding songs (optional).
  • Remove and export tracks from your iPod.
  • Modify ID3 tags — changes are also updated in the original file (optional).
  • Refresh ID3 tags from file (if you have changed the tags in the original file).
  • Sync directories.
  • Normalize the volume of your tracks (uses mp3gain or the replay-gain tag)
  • Write the updated iTunesDB and added songs to your iPod.
  • Work offline and synchronize your new playlists / songs with the iPod at a later time.
  • Export your korganizer/kaddressbook/thunderbird/evocalendar/evolution/webcalendar… data to the iPod (scripts for other programs can be added).

Go here to download gtkpod directly. For installation instructions on Ubuntu, see below.

Installing and Configuring gtkpod on Ubuntu

# sudo apt-get install gtkpod

Next, open gtkpod by navigating to the Applications > Sound & Video menu and selecting gtkpod.

Select gtkpod from Gnome Menu


Now with gtkpod open, plug in your iPod via USB to your computer and power on the iPod. gtkpod should load your iPod automatically.

Screenshot of gtkpod main screen

Next, select what tracks you would like to back up to your computer by highlighting the tracks.

Once you have selected the tracks (note: you can select All then highlight all of your music if you want to back up your entire iPod) select File > Export Tracks From Database > Selected Tracks

gtkpod Export tracks from database

You then will be prompted to select where you would like to save the tracks. Choose a directory and click Save.

Now sit back and let gtkpod back up your iPod music.

Heres a quick tip on how to find out what ports are open on your Linux computer without using a port scanner.

# netstat -anp --tcp --udp | grep LISTEN

Cheers!

Here is how to change the PostgreSQL root password from the Linux command line. Replace “root” with any user name to change any password. It is important to note that PostgreSQL does not have an actual “root” user name. The “postgres” user is the super-user for PostgreSQL.

# su postgres
# psql -d template1
template1=# ALTER USER postgres WITH PASSWORD '${POSTGRESQL_POSTGRES_PASSWORD}';

You can replace “postgres” with any user name.

Quickzi: How To Change MySQL Root Password

Here is how to change the mysql root password from the Linux command line. Replace “root” with any user name to change any mysql user password.

Change MySQL Password

# /etc/init.d/mysql stop
# mysqld --skip-grant-tables
# mysqladmin -u root password 'newpasswd'
# /etc/init.d/mysql start

Cheers!

If you are a hard core systems administrator or Linux engineer you’ll probably recognize most of these Linux command line tricks. The following Linux command line tips are not typically used by your everyday Linux user.

Quickly Find a PID with pgrep

pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout.

pgrep ssh

This will list all PIDs associated with the ssh process.

Execute The Last Executed Command

The heading sounds a bit confusing but it’s exactly what it does.

!!

This will execute the last command you used on the command line.

Execute The Last Command Starting With..

If you want to execute a command a command from history starting with the letter S you can use the following:

!s

This will execute the last command used on the command line that started with s.

Run a Command Repeatedly and Display the Output

watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds. watch is very similar to tail.

watch -d ls -l

This will watch the current directory for any file changes and highlight the change when it occurs.

Save Quickly in VI/VIM

If you’re in a hurry, you can save and quit the file you’re editing in vi by exiting insert mode, holding shift, and hitting z twice.

Quickly Log Out of a Terminal

You can quickly log out of a terminal session by using: CTRL+D

Navigate to the Last Directory You Were In

cd - will take you to the last directory you were in.

Make Parent Directories the Smart Way

mkdir -p /home/adam/make/all/of/these/directories/ will create all directories as needed even if they do not exist. Why waste time doing something silly like: mkdir make ; cd make ; mkdir all ; cd all ; mkdir of ; cd of … you get the point. Use mkdir -p!

Delete the Entire Line

If you’ve just typed a long string of commands that you don’t need to enter anymore, delete the entire line by using: CTRL+U.

Set the Time stamp of a File

touch -c -t 0801010800 filename.c will show the time stamp as 2008-01-01 8:00. The format is (YYMMDDhhmm).

Can you think of any other Linux commands that are less known to the general Linux community?

Subscribe to my RSS feed here.

How To Speed Up Linux

The Wired How-To Wiki has some great tips on how to speed up Linux.

Most of the tips covered in this article involve using the command line and editing system files. Therefore, it goes without saying that you should be fairly comfortable with your command line skills before attempting any of these tweaks. However, if you’re new to Linux, these system tweaks can serve as excellent feet-wetting exercises.

The tips for speeding up Linux are broken down into the following categories:

  • Get Rid of Unnecessary Processes
  • Swap Less Often
  • Speed Up Your Applications
  • Things That Probably Won’t Help

Read more

The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password.

Example:

adam@desktop:~$ sudo chage -l adam
Last password change : Mar 02, 2008
Password expires : Apr 11, 2008
Password inactive : never
Account expires : Mar 30, 2009
Minimum number of days between password change : 20
Maximum number of days between password change : 40
Number of days of warning before password expires : 7
adam@desktop:~$

Read the man page of chage here.

How To Run Linux Applications in Windows

Interested in running Linux Applications in Windows?  andLinux actually loads the Linux kernel on your Windows desktop and makes it appear as though your Linux applications are running like any other Windows application.

Linux fans that need a Windows app or two can take advantage of WINE, but what about Windows fans that need to run Linux apps? If you’re lucky someone has already ported your favorite Linux app over to Windows, but if they haven’t, you might want to check out andLinux.

Read more.. 

How to use a Bluetooth phone in Linux

Ryan Paul published a nice article on how to use a Bluetooth phone in Linux using a cheap USB Bluetooth adapter, GNOME’s Bluetooth tools, and Ubuntu.

Read more here ..

If you don’t want your mounted drives to show up on your Ubuntu GNOME desktop, all you need to do is mount them somewhere other than /media/. Here is an example:

mount /dev/sdb1 /mnt/usbdrive

Cheers!