Category Archives: Ubuntu 13.10

Use ffmpeg To Convert Audio And Video In Ubuntu 13.10 Saucy Salamander


From time to time you may need to extract the sound from a video file. Fortunately, using the ffmpeg program, it’s quite simple to take the sound from any video file and store it as a separate file. The ffmpeg utility can convert back and forth between multiple formats of both video and sound.

Here’s how to install and use ffmpeg on Ubuntu 13.10 Saucy Salamander.

First, you’ll need to install the Ubuntu Restricted Extras package so ffmpeg can effectively move files between formats, which you can do with this Terminal command:

sudo apt-get install ubuntu-restricted-extras

After you’ve installed the Ubuntu Restricted Extras, use this command to install ffmpeg:

sudo apt-get install ffmpeg

After the installation is complete, you can use ffmpeg to extract the audio from a video file. Say, for example, you have a video file named test.avi. To extract the audio to a file named audio.mp3, use ffmpeg with these options and arguments:

ffmpeg -i test.avi audio.mp3

This will create an audio file named audio.mp3 containing the sound from the video file. However, by default ffmpeg creates audio files with a bitrate of 64 kbps, which results in very low-quality audio. To force ffmpeg to create the mp3 file at the 256 kbps bitrate, add the -ab option to the command:

ffmpeg -i test.avi -ab 256k audio.mp3

This will create a higher-quality mp3 file, and you can use this modified command to extract the audio from any compatible video file.

The ffmpeg utility can do many other conversions as well – be sure to read the entire manual page for ffmpeg with this command:

man ffmpeg



The Ubuntu Beginner’s Guide

The Ubuntu Desktop Beginner’s Guide

Install And Configure Moodle On Ubuntu 13.10 Saucy Salamander


Moodle is a virtual learning environment used by tens of thousands of schools across the world. Using Moodle, you can create a fully online course, or use it to supplment a traditionally-taught classroom course. Best of all, Moodle is free, and you can install it on Ubuntu 13.10 Saucy Salamander. Installing Moodle on Ubuntu is a bit of work, but once it is finished, you’ll have a robust e-learning server application.

It’s quite possible to install Moodle on a machine running either the desktop or the server version of Ubuntu. This makes an excellent environment for testing and experimentation, since you can tweak and experiment to your heart’s desire without rendering your production site inoperable. Given that Moodle is free, if you have a bit of Linux knowledge, you can use Moodle in lieu of far more expensive alternatives.

Let’s begin!

First, install Ubuntu into your machine of choice. Once Ubuntu is installed and updated, you will need to install five pieces of software: the Apache web server, the MySQL database server version 5.5, PHP version 5, the MySQL module for PHP, and finally the Moodle software itself.

First, install the Apache web server. To install Apache, go to a Terminal window or a command prompt and type this command:

sudo apt-get install apache2

(Technically, you’ll be installing Apache 2, the latest version.)

Enter your password to authenticate, follow the default prompts, and apt will download and install the Apache web server for you.

Apache should now be working. To test it from the web server itself, go to a web browser and visit the address . Alternatively, you could test it from another computer on the same subnet. For instance, if you installed Apache on a computer with an IP address of, you could test it by going to another computer on the same subnet and visiting http://192.168.100 from the web browser.

Regardless, if Apache is working properly, you should see a web page with only two words on it:

It works!

Apache is now operational.

The next step to install Moodle is to install the MySQL database server. Return to the Terminal and type this command:

sudo apt-get install mysql-server-5.5

(As of this writing, MySQL Server version 5.5 is the latest version available in the Ubuntu repositories, though future versions of Ubuntu may receive the newer versions of MySQL.)

Enter your password to authenticate, and apt will download the MySQL files and install them for you. It’s a big set of files, so depending on the speed of your Internet connection, it might take a while to download. After the files are downloaded and are installing, the installer will ask you for a password for MySQL’s root user. Just like the root user in Linux, the root user in MySQL has absolute control over all databases, tables, permissions, and users. For obvious security reasons, you’ll want to create an extremely strong password (a mixture of uppercase, lowercase, numbers, and punctuation, the longer the better) for your MySQL root user.

(Note that in the password dialog box, you can’t get the <OK> field selected, you can use the tab key to jump from the text input line to the <OK> field.)

After you enter the root password, the installer will finish working with the MySQL files, and return you to the command line. You’ll then need to activate MySQL with the following command:

sudo mysql_install_db

This will set up MySQL Server for use with your Ubuntu system. Next, you’ll want to run the mysql_secure_installation script to tighten up security on your new MySQL server. Run this command from the prompt:

sudo mysql_secure_installation

First, the mysql_secure_installation script will ask you to enter the current password for the MySQL root user. After you do that, it will ask if you want to change the root password. Since you already set a root password, you can hit “n” (unless you want to change it again for some reason).

Next, the script will ask if you want to remove the anonymous user. The anonymous user, like anonymous access in FTP, lets someone log into MySQL without having a proper user account. For security reasons, it’s always best to remove the anonymous user, so hit “y” to continue.

After that, the script will ask if you want to prevent the MySQL root user from logging in remotely to the MySQL server. Always hit “y” to forbid root remote access, since if an attacker guesses your root password, he can destroy your databases or steal the information they contain.

After this, the script will ask if you want to remove the test database. MySQL includes a test database that anyone can access. Again, this is a security hole, so you’ll want to hit “y” to remove the test database.

The script will then ask to reload the privilege tables so the changes take effect. Hit “y”, and the mysql_secure_installation script will conclude and return you to the command line.

MySQL server is now installed on your Ubuntu system.

Now we’ll need to prepare MySQL for use with Moodle. Moodle requires a database and a database user, and full permission for its database user to access its database. To start the MySQL command-line client, use this command:

mysql -u root -p

Enter the password for the MySQL root user, and you’ll find yourself at the MySQL command prompt, which will look like this:


Our next steps are to create a Moodle database, create a user to access that database, and grant our new user all rights to the Moodle database.

(An important note before we continue, though. All commands made from the MySQL prompt must end with a semicolon to denote the end of the statement. Any commands that do not end with a semicolon will not work. With that in mind, let’s first create a database.)

To create a database for Moodle, use this command at the mysql> prompt:


The MySQL client will respond with a message that should say “Query OK, 1 row affect (0.00 sec).” This means the command was successful, and a new database named “newdatabase” has been created.

Next, you’ll create a user who will access that database:

CREATE USER moodleuser;

You should get the “Query OK” message again. Once the new user is created, we’ll need to set a password for the user before we can assign any permissions. In this example, we’ll assign a password of “1234″. However, in real life, just as with the root user, you’ll want to assign a much, much stronger password than this. (This database user won’t have full control over the MySQL user as the root user does, but we will give it full control over the database we just created, and a malicious user who guesses the password could cause all kinds of trouble.)  To create the password, use this command:

SET PASSWORD FOR moodleuser= PASSWORD(“1234”);

Again you should get the “Query OK” confirmation message. The final step is to assign all privileges on the “moodle” database to the “moodleuser” user. Use this command to assign the permissions:

GRANT ALL PRIVILEGES ON moodle.* TO moodleuser IDENTIFIED BY ‘1234′;

That isn’t a typo – those are single quote marks (‘) instead of the usual double quote marks (“) that were used in the command to set the password. MySQL’s internal syntax, alas, isn’t always consistent. Anyway, if you typed the command correctly, you should get the “Query OK” confirmation again.

Once you are done, use this command to quit the MySQL command-line interface:


The next step to installing Moodle is to install PHP version 5, along with the necessary PHP modules. First, install PHP 5 with this command:

sudo apt-get install php5

After this, you will need to install several different PHP extensions not included with the default PHP 5 implementation on Ubuntu. First, install the MySQL module for PHP:

sudo apt-get install php5-mysql

You must also install the GD library for PHP:

sudo apt-get install php5-gd

The JSON extension is also required:

sudo apt-get install php5-json

The CURL extension:

sudo apt-get install php5-curl

The XMLRPC extension:

sudo apt-get install php5-xmlrpc

And, finally, the INTL extension:

sudo apt-get install php5-intl

After all the plugins have installed, restart Apache so it recognizes the plugins properly:

sudo /etc/init.d/apache2 restart

Finally, download the Moodle software to your Desktop. You can obtain it from this address:

Move the Moodle files over to the /var/www directory. (In this command, I’ll assume you unpacked the moodle files to your home directory; you will have to adjust the command if you unpacked them in a different directory.)

sudo cp -r ~/moodle/* /var/www

After that, rename the old index.html file in /var/www so Apache uses Moodle’s PHP files for the site, not the index.html file:

sudo mv index.html index.html.old

Now that we’ve got our software downloaded, we’ll need to configure it.

You will need to create a location for Moodle to save data files. Traditionally, the location is in /var/moodledata. (Creating the data directory inside the web server directory is an extremely bad idea, due to the resultant security holes.) To create the data directory, use this command:

sudo mkdir /var/moodledata

Use this command to change the owner of the directory to the Apache system user. In Ubuntu, the Apache system user is usually named www-data:

sudo chown www-data /var/moodledata

Then use this command to make the /var/moodledata directory writable to Moodle:

sudo chmod -R 744 /var/moodledata

Now that configuration and setup is complete, we are actually read to begin installing Moodle!

Fire up a web browser and navigate to the Moodle location to launch the web-based installer. If your server’s IP address (for example) is, the address would look like this:

This will take you to the Moodle setup page.

First, select the language for your Moodle installation, and then click the Next button.

The installer will then ask for the locations of Moodle’s directories. The defaults will work, especially if you already created the /var/moodledata directory as indicated above. Click the Next button to continue.

Moodle will then ask what kind of database server to use. Since we already set up our MySQL database, select “Improved MySQL” and then hit the Next button.

Then installer will then need you to input the information for the database and database user we created above. Since our MySQL server is on the same machine as Moodle, leave “localhost” for the Database Host field. Enter “moodle” for Database Name, “moodleuser” for Database User, and then ‘1234’ for Database Password. Leave the other fields blank, and then click Next.

Moodle will then generate a config.php file. Copy and paste the data of the config.php file, save it as “config.php”, and then transfer it to your server. Make sure to put it in the directory containing the Moodle installation – in this example, /var/www. Once the config.php is in place, make sure to mark it as executable with this command, otherwise the installation will halt:

sudo chmod 744 /var/www/config.php

Save config.php file, and then go back to the web browser and click the Next button.

Moodle will then ask if you agree to the terms of service. If you do, click the Continue button.

The installer will then run a system check to make sure your server has all the necessary software to support Moodle. If not (it’s common to forget one of the PHP extensions), the installation will pause to allow you to install the missing software. Once you have, click Reload. If all the checks are passed, you can click the Continue button to continue.

The Moodle installer will then start building the database tables it requires in the database we created earlier. The Moodle database is large and complex, and building the database may take a considerable amount of time, so be patient. As the installer successfully builds database tables, they will scroll down in the browser window. Once the database construction is complete, the Continue button will appear at the very bottom of the page. Click on it to continue.

Moodle will then display a form for you to set up an administrator account for your new site. Enter an appropriate username and a strong password, along with any other required fields. Once you have finished, click on the Update Profile button at the bottom of the page.

The install will then ask you to pick a full site name and a short name for the site. Select suitable names, and then click the Save Changes button.

Congratulations! Your Moodle installation is now complete, and you can begin adding courses and other materials. For additional documentation, the Moodle site contains many useful resources:



The Ubuntu Beginner’s Guide

The Ubuntu Desktop Beginner’s Guide

The Linux Command Line Beginner’s Guide

Set A Static DNS Server Address From The Terminal In Ubuntu 13.10 Saucy Salamander


It is not immediately obvious how to set a static DNS server address from the command line in Ubuntu 13.10 Saucy Salamander. In the Desktop version of Ubuntu, you can of course use the graphical Network Manager to assign a static DNS server. In the Server version, things are a little more complicated. This post will explain how to use the resolvconf utility to set a static address for the DNS server. (In this example, we will assume your DNS server has an address of

First, log into Ubuntu, and then navigate to this directory:


Once you are in the appropriate directory, use this command to launch the vi text editor:

 sudo vi /etc/resolvconf/resolv.conf.d/head

This will open up resolvconf’s head text file in vi. Once vi has launched, press the INSERT key to switch vi to edit mode, and then enter the following line:


Then hit the ESC key to switch vi back to command mode, and type this command to save the edited text file and then quit vi:


Once vi exits, type this command:

 sudo resolvconf -u

The resolvconf utility will then read the head file and set the static DNS server address you entered.


Use Ubuntu One For Cloud Backup In Ubuntu 13.10 Saucy Salamander


In this post, we will discuss Canonical’s Ubuntu One cloud storage service and client.

Of course, before discussing “cloud storage”, it helps to know just what the “cloud” is. For most of its history, the personal computer has been thought of as a stand-alone system, without network access to the outside world. All this began to change with the rise of the Internet and the development of more reliable and faster network technology, which in turn made “cloud computing” possible. “Cloud computing” is simply a term that refers to a kind of computing where most of the processing or storage is done at a remote data center, and access via a client on your computer. A web email application is the most obvious example of a cloud computer application – all your messages and contacts are stored in a remote data center, and you access them via a web browser on your computer. Another example is a program like Dropbox or Google Drive that creates a folder on your computer whose contents are synced to Dropbox’s or Google’s servers.

The disadvantages of cloud storage are obvious – if your Internet connection is broken, you lose access to your data. Additionally, if you forget your password to your cloud storage, you lose access to your data. Cloud storage is also a target for hackers, which makes it a potential privacy risk.

However, cloud storage also has several advantages. It allows you to access your data from anywhere, whether a desktop or laptop computer or a smartphone or a tablet. If you work from several different devices, this can prove most useful. Additionally, cloud storage provides a built-in form of backup, since all your data is stored in a remote data center. Hard drives have a depressing tendency to die just as you need to do important work – the day before your taxes are due or you have to complete an important homework assignment – and having your data safe in cloud storage can turn a computer crash from a potential catastrophe into an inconvenience. If used carefully (and with proper security), cloud storage can be a powerful tool.

Since version 9.04, Ubuntu has included access to Canonical’s own cloud storage program, Ubuntu One. Ubuntu One offers five gigabytes of cloud storage for free, with additional storage and features available for a fee.

Next, we’ll show you how to launch and set up the Ubuntu One client on your Ubuntu computer, and how to sign up for a free Ubuntu One account if you do not already have one.


In a default installation of Ubuntu, the Ubuntu One icon is pinned to your Launcher. Click on it to Launch the Ubuntu One client software, and the Ubuntu One client will then launch.

If you do not currently have a Ubuntu One account, click on the button that says “I don’t have an account yet”, and fill out the form to create your new account. If you do have a Ubuntu One account, click on the “Sign me in” button, and then enter your username and password. After a moment the client will sign you in to Ubuntu One.

Next, the Ubuntu One client will ask you which folders it should keep in sync with your cloud storage. By “in sync”, it means that the client will create a local copy of your cloud storage on your computer. Any time you add something to that folder, Ubuntu One will automatically upload the file to your cloud storage. By default, Ubuntu One creates a “Ubuntu One” folder in your home folder, which is then automatically kept in sync.

Click the “Check Settings” button, and you can adjust the settings for your Ubuntu One client.

If your Internet connection has limited bandwidth, you can limit the upload and download speeds. You can also specify whether or not any folders created on other computers using your Ubuntu One account (or in the web interface) are synced to your computer. You can also select whether or not Ubuntu One will automatically connect when your computer starts.

Once you have configured settings, click Next, and you can choose any additional folders you want to sync automatically with your Ubuntu One account. By default, you can choose the various folders in your home folder (Documents, Desktop, Pictures, and so forth), but you can also use the “Add a folder from this computer” to choose a custom folder.

Once you have made your selections, click Finish, and your Ubuntu One client will be connected.


When your Ubuntu One client software is running, you can use it to adjust the settings of both the client and your Ubuntu One account itself.

In the upper right-hand corner of the window, you can see how much of your available storage you are using, and whether or not your file sync is currently up to date. The four tabs control additional settings. The Folder tab controls which folders Ubuntu One will sync to your cloud storage, and you can add additional folders here. Devices lists the devices (computers, smartphones, and tablets) that are connected to your Ubuntu One account. You can remove the current device from your Ubuntu One account here, though to remove additional devices, you will have to do so through the Ubuntu One website. The Settings tab controls the same settings we discussed earlier during setup. Finally, Account Information shows a few specific details about your account.

Generally, the client settings let you make changes to the Ubuntu One settings on the specific computer. To make wider changes to your Ubuntu One account, you will need to use the web interface.



The Ubuntu Beginner’s Guide

The Ubuntu Desktop Beginner’s Guide

The Linux Command Line Beginner’s Guide

How To Download YouTube Videos In Ubuntu 13.10 Saucy Salamander


WARNING: Only download videos from YouTube if you do not violate copyright law by doing so!

By default, the popular video-sharing website YouTube does not include an option for downloading video clips. Fortunately, a Firefox plugin makes downloading the videos easy, and it is a simple matter to install the plugin on Ubuntu 13.10 Saucy Salamander.

To install the plugin, first launch Firefox. Then go to the Tools menu, and to the Add-ons item.

When the Add-ons Manager launches, enter “Download YouTube Videos as MP4″ into the search box. The top hit will be ialc’s popular “Download YouTube Videos as MP4 and FLV” plugin. Next to the plugin’s name you’ll see a button labeled Install. Click on it to begin the installation.

The download and installation should take only a moment or two. When it is complete, you’ll see a message informing you that Firefox has to restart to activate the plugin. Click on the Restart Now button, and Firefox will restart. When it reloads, the plugin will be activated.

Now whenever you navigate to a YouTube video in Firefox, you will see a small button marked Download below the video itself, directly to the right of the Like and Dislike buttons. Click on that button, and you’ll have the option of downloading the video in either MP4 or FLV format.



The Ubuntu Beginner’s Guide

The Ubuntu Desktop Beginner’s Guide

Ubuntu 13.10 Case Study: Using Ubuntu To Recover Data From A Damaged Macintosh Hard Drive


Recently, I had a client who came to me with a damaged hard drive. The client had numerous critical documents upon her disk, and (veteran IT professionals will not be surprised at this point), the client had failed to ever make a backup of these critical files. Examining the drive, I realized that the motor was stuck, so I froze it in a freezer for several hours. (If the drive’s motor is stuck, this will often allow it to become unstuck.) After removing the drive from my freezer, I used a USB/SATA converter to connect the drive to my Ubuntu 13.10 Saucy Salamander desktop PC as an external drive.

Success! The drive spun up, and it successfully mounted. I located the client’s files in her Volumes folder, but quickly noticed a problem – Ubuntu 13.10 can read the Mac HFS+ filesystem, but it cannot write to it. Since I wanted to recover data from the drive, this would not be a problem, but Ubuntu also respects the HFS+ file permissions and ownership.

And that meant I could not read the files in the client’s user profile, since I did not have ownership of them, and since the drive was read only, I could not take ownership of them.

Fortunately, some research found the following Terminal command:

gksu nautilus

This launches a session of the Nautilus file browser with root permissions. In the root-owned session of Nautilius, I could copy the client’s files from the Mac HFS+ drive to my Ubuntu computer’s hard drive, where I could then take ownership of them myself, and copy the files to a FAT32 USB external hard drive for transfer back to the client.

So a Ubuntu system can indeed do data recovery on a Mac drive. Provided the drive is readable, you can mount an HFS+ filesystem, and use the gksu nautilus command to copy files from the user profiles on the drive.



The Ubuntu Beginner’s Guide

The Ubuntu Desktop Beginner’s Guide

The 5 Best Media Players Ubuntu 13.10 Saucy Salamander


These days, one of the primary uses for a computer system, any computer system, is to play digital music files. Ubuntu 13.10 Saucy Salamander is no different, and since it is a Linux distribution, there is a plethora of free software to let you play music on it. Here are the five best programs for playing digital music files on Ubuntu.

1.) Rhythmbox. The default media player, Rhythmbox is simple and easy to use, and remains the default music player in the current version of Ubuntu. (I personally prefer it.)

2.) Amarok. A free music player designed for the KDE platform, Amarok offers extremely powerful capabilities for organizing and sorting a large quantity of music files. So if you have a large music library, and difficulty in keeping it organized, Amarok might work for you. Here’s how to install it.

3.) Banshee. Another free music player, Banshee is highly customizable, offering a wide array of plugins and extensions. If you want to tweak your music player to something unique, Banshee might be for you. Here are directions on installing it.

4.) Audacious. Audacious is basically a Linux version of Winamp. Follow these directions to install it.

5.) VLC. The VLC player can play practically any video or audio format, and is quite easy to customize. Here’s how to install it on Ubuntu.

Lastly, to get the most out of your media player software, you’ll need to install the Ubuntu Restricted Extras package to handle most audio and video formats. Click here for directions on installing the Ubuntu Restricted Extras.


Release And Renew DHCP IP Addresses With dhclient In Ubuntu 13.10 Saucy Salamander


On a Ubuntu 13.10 Saucy Salamander system with a DHCP address, releasing the IP address and obtaining a new one is quite simple. (This is often useful with troubleshooting network problems).  To release a DHCP IP address, go to a Terminal window and type this command:

sudo dhclient -r

(Note that you must use dhclient either as root or with the sudo command for it to work.)

This will release your current IP address. To obtain a new one, use the dhclient without any arguments:

sudo dhclient

Assuming that dhclient can reach a DHCP server, your system will receive a new IP address in short order.



The Ubuntu Beginner’s Guide

The Ubuntu Desktop Beginner’s Guide

Ubuntu 13.10: Use The top Command To Monitor Processes


When using a Ubuntu 13.10 Saucy Salamander system, you will frequently want to see what processes are using what resources.  The quickest and easiest way to do this is with the venerable top command, which you can launch from any shell prompt:


Once launched, top stays running, displaying statistics in real time. Processes are listed by their process ID number, along the name of the command that started the process. The statistics are sorted via these categories.

PID: A process’s process ID number.

USER: The process’s owner.

PR: The process’s priority. The lower the number, the higher the priority.

NI: The nice value of the process, which affects its priority.

VIRT: How much virtual memory the process is using.

RES: How much physical RAM the process is using, measured in kilobytes.

SHR: How much shared memory the process is using.

S: The current status of the process (zombied, sleeping, running, uninterruptedly sleeping, or traced).

%CPU: The percentage of the processor time used by the process.

%MEM: The percentage of physical RAM used by the process.

TIME+: How much processor time the process has used.

COMMAND: The name of the command that started the process.

Of course, you may want to sort the top display by a certain category from least to greatest. This is especially useful when you want to figure out what process is hogging the most CPU time or memory. Hitting the ‘t’ key will sort the processes by CPU time. Hitting ‘l‘ will sort by load average, and ‘m‘ by memory info.

Careful use of the top command will let you quickly and easily monitor resource usage on your Ubuntu Linux system.



The Ubuntu Beginner’s Guide

The Ubuntu Desktop Beginner’s Guide

Use LibreOffice To Mass Convert DOC To PDF Files Ubuntu 13.10 Saucy Salamander


LibreOffice, the free office suite included with most distributions of Linux (including Ubuntu 13.10 Saucy Salamander), has a fairly useful feature that’s not very well known. LibreOffice’s command line utilities let you do batch conversions of one file format to another. If you have, say, 200 *.doc files you need to convert to PDFs, using the batch conversion commands can save you an enormous amount of time. In this post, I’ll show you how to convert *.doc files to PDF files, and *.doc files to HTML files.

In our first example, let’s say you have 1000 *.doc files you need to convert to PDFs. The document files are located in a directory called “source” in your home directory, and you want to have the PDFs in a directory called “output” in your home directory. The command to convert the doc files to PDF files will look like this:

libreoffice –headless –convert-to pdf:writer_pdf_Export -outdir ~/output ~/source/*.doc

This will take every single *.doc file in the ~/source directory and convert it to a corresponding PDF file in the ~/source directory. Note that the original *.doc files are not altered in any way.

You can use this command to perform mass conversions of other file formats. For instance, let’s say you wanted to turn those 1000 *.doc files into HTML files instead. The command would look like this:

libreoffice –headless –convert-to html -outdir ~/output ~/source/*.doc

This will convert the *.doc files in ~/output to HTML files in ~/source.  Again, the original document files will not be altered.

By changing the parameter after the –convert-to option, you can convert to and from any of the file types supported by LibreOffice. If you wanted to change your *.doc files in ~/source to *.odt files (OpeDocument Format files), the command would look like this:

libreoffice –headless –convert-to odt -outdir ~/output ~/source/*.doc

Using LibreOffice’s command-line utility allows you to quickly and easily perform batch conversions of documents.