Tag Archives: Linux

How to Play Ogg Vorbis Files from the Linux Command Line

HeadphonesIf you’re a dedicated user of free and open source software, chances are your dedication goes beyond just software. You probably try to use as many open file formats as you can. Document formats, video formats, and audio formats. Especially audio formats.

In the world of free and open source software, a popular format is Ogg Vorbis. Ogg Vorbis offers comparable audio quality and file compression as MP3, but without all the potential hassles the come from the patents that apply to MP3.

Just about every free and open source desktop media player supports Ogg Vorbis. But what if you want a player that’s a little lighter, or are using a stripped-down Linux distribution on an older, underpowered computer? The obvious answer: turn to the command line.

Using a command line application called ogg123, you can play back your Ogg Vorbis files without a lot of overhead.

Installing ogg123

ogg123 isn’t a standalone application. It’s part of a package called vorbis-tools. vorbis-tools comes pre-installed with a number of Linux distributions. To find out if it’s installed in yours, open a terminal window and type the following command:

which ogg123

If the command returns something like the following (/usr/bin/ogg123 in this example), then you’re ready to go.
Is ogg123 installed?

Otherwise, you need to install vorbis-tools. You can do that using your favorite package manager. If vorbis-tools isn’t available, then you can download and install it manually.

Using ogg123

Open a terminal window and change to the directory containing the files that you want to play. Then type the command ogg123 *.oga. This will play all of the files in the directory, in order.

That’s not very exciting, is it? If you want to shuffle the tracks to play them randomly, then type ogg123 -z *.oga.

Playing an Ogg Vorbis file

If you’ve ripped songs off of a CD, chances are the ripping process created a playlist file (with the extension .m3u). You can use that with ogg123 by typing the command ogg123 -@ playlist.m3u, substituting the actual name of the file for playlist.

To jump to the next track, press CTRL+C on your keyboard.

Note that ogg123 has a number of options. You can view them by typing ogg123 at the command line or viewing this reference.

Dealing with Cover Art

Music files, no matter what their formats, contain a number of tags. These tags include the title of the track, the name of the album, the artist, and the like. One of the tags also points to cover art. When you play the file in a graphical music player, an image of the album’s cover appears in the player.

If an Ogg Vorbis file you’re playing with ogg123 contains the cover art tag, ogg123 will try to render the art. However, you won’t get the image. Instead, you’ll get a stream of numbers and letters, like this:

Trying to render cover art. Not pretty!

There’s no way to suppress this, sorry.

Summing Up

ogg123 is a simple yet effective media player for the Linux command line. It’s easy to use and does a very good job. It has one or two small quirks, but those are easy to ignore. In fact, once you start using ogg123 you might just wind up using it instead of your favorite GUI music player.

Photo credit: celiece

Backup Files from Your Linux Desktop with Pybackpack

BackupAs you probably know, there are a number of great web apps for backing up your files. Many of us here at Techerator are partial to Dropbox.

That said, for some people cloud-based storage is overkill. Others have serious reservations about trusting their files to others. Fair enough. So what can they do?

Well, they can manually copy their important files to a CD or a DVD, or they upload them to a personal web server. Those solutions are fine, but they also require manual intervention. Anyway, what’s the point of having a computer if you can’t let it do the heavy lifting for you?

If you use a Linux distribution with the GNOME desktop, you can use Pybackpack. It’s a simple but effective graphical tool that enables you to save your important files to a CD or DVD, a folder on your local file system, or even a remote web server.

Let’s take a look at how to use Pybackpack.

Downloading and Installing the Software

Before you download Pybackpack, make sure that the following software is installed on your computer:

  • Python
  • PyGTK
  • PyGlade
  • rdiff-backup
  • genisoimage

If you plan to back up your data to a CD or DVD, you’ll also need Nautilus CD Burner. To be honest, I find using CDs and DVDs to be a waste, but your mileage may vary. You probably have most of the software listed above installed on your computer. Anything you don’t have you can install using your package manager.

You can download Pybackpack here. The latest version is 0.5.8. Once you’ve downloaded Pybackpack, extract the contents of the archive to somewhere on your hard drive. Then, crack open a terminal window and navigate to that directory.

Run the following commands:

python setup.py build sudo python setup.py install 

Getting Started

Launch Pybackpack by pressing ALT+F2. In the Run Application dialog box, type pybackpack and then press Enter.

Pybackpack main window

If you want to copy the contents of your /home directory to a CD or DVD, make sure there’s a writable disk in your CD/DVD drive and then click Go. But, as I mentioned earlier, I find backing up to a CD or DVD to be a waste. You can generally only use them once. And you might not want to back up your entire /home directory.

Pybackpack enables you to back up specific folders and files. You do this by creating backup sets. Using backup sets makes a lot more sense. You can make copies of important files, and even group sets of similar files and folders together. Doing that makes your backups easier to manage.

Creating Backup Sets

In the Pybackpack window, click the Backup tab.

Backup tab

Select New backup set from the list and then click Edit. This starts a wizard that will walk you through the process of creating a backup set.

Creating a backup set - step 1

Click Forward. In the Backup Set Name window, enter the following information:

  • Name of the backup set. Make it descriptive or at least short and to the point.
  • An optional short description.

Then, select where you want to back up your files from the Destination type list. You can save them to a CD or DVD, somewhere on your computer, or to a remote server. Let’s assume you want to save the files to a web server. Select Remote Host (SSH) from the Destination type list. Then, fill in the following information:

  • Username – The name you use to log into the server.
  • Host – The address of the server.
  • Path – The directory on the server in which you want to save your files.

Creating a backup set - step 2

Click Forward. In the next window, select the file and/or folders that you want to include in the backup set by click them in the directory tree and then clicking the Include in set button.

Creating a backup set - step 3

Click Forward. You’re taken to a summary window. If you need to make changes, click the Back button. Otherwise click Forward to save the backup set.

Creating a backup set - step 4

Performing a Backup

When you’re ready to backup your files, select the backup set in the Pybackpack window.

Doing a backup

Then, click the Backup button. Depending on the number and size of the files you’re backing up, and where you’re backing them up to, the process could take a few seconds to a few minutes.

Restoring Your Backups

You might want to do that once in a while. Click the Restore tab in the Pybackpack window. Then click either Local (somewhere on your computer or on a CD/DVD) or Remote (SSH). In either case, enter the path to the directory containing the backup that you want to restore.

If you have multiple backups, you can select the one that you want to restore from the Restore as of list. Then, click the Restore button.

Restoring a backup

Final Thoughts

Pybackpack is a very flexible and very easy-to-use tool. It’s easy to use and offers several options. While it’s not designed to back up your entire system, Pybackpack does a solid job of backing up your important files and folders.

Photo credit: svilen001

Creating a Bootable Linux USB Drive with UNetbootin

Flash driveTest driving and installing a Linux distribution has become a lot easier over the years. In the early days, you needed to install Linux on a dedicated computer. Or, you could set your computer up to dual boot. Of course that meant navigating the potential perils of partitioning your hard drive.

Later, a Live CD (which lets you run the distribution right from a CD) was the way to do it. The problem with a Live CD, though, is that running anything from a CD is slow. And having to burn a CD for each distribution that you want to try is wasteful.

A better option is a bootable USB flash drive. You can reuse it and any distribution you install on it has the potential to run very quickly.

Whether you’re using Linux, Windows, or Mac OS you can easily create a bootable USB drive using UNetbootin. Let’s take a look at how to do that on the Linux desktop.

Note: Some of the options covered in this post aren’t available in the Windows and Mac OS versions of UNetbootin.

Installing UNetbootin

Just go to the UNetbootin site and download the installer for your operating system. There are buttons at the top of the page.

Buttons for downloading UNetbootin

You can also get packages for the following Linux distributions: Ubuntu, Debian, Fedora, SuSE, Arch, and Gentoo.

Once it’s installed, you can start UNetbootin from your applications menu. In Ubuntu, for example, select Applications > System Tools > UNetbootin.

Creating the Bootable Drive

First off, you’ll need a USB flash drive. At the very least, it should have a capacity of 1 GB. Just to be safe, use either a 2 GB or 4 GB drive.

UNetbootin has an interesting feature: it can automatically download and create a bootable flash drive for over 20 popular Linux distributions. That saves a lot of time and trouble!

The distribution that you want may also need an ISO image. An ISO image, which has the extension .iso, is a compressed version of an operating system. That includes everything — installer, file system, and all the collateral.

From there, fire up UNetbootin.

Main window

If you’re going to create a bootable drive from one of the supported distros, select it from the Select Distribution list. Then, choose the version that you want to use from the Select Version list.

If, on the other hand, you’re going to create a bootable drive from an ISO image, click the Diskimage option. Then, click the “…” button to find the ISO image that you downloaded.

From there, make sure that the Type list is set to USB Drive and the Drive option is set to /dev/sdb1. In Linux, /dev/sdb1 is the default mount point) for removable storage devices.

Note: In Windows, the option will be a drive letter like F:**. In Mac OS, it will be something like /Volumes/USBDRIVE/**.

Ready to create a bootable image

When you’re ready to go, click the OK button. It can take several minutes for the UNetbootin to write the files to the flash drive. When the process is finished, a message appears asking if you want to restart your computer. You can safely ignore the message.

Using the Bootable Flash Drive

Restart your computer with the flash drive plugged into a USB port. Chances are your computer’s boot sequence — which tells your computer which drive (hard drive, CD-ROM drive, or removable drive) to start from — will skip the flash drive the first time you try this. When your computer starts, you need to go into the BIOS to change the boot settings. Depending on your computer, this could mean pressing the F2 key or F10 key on your keyboard. You’ll have to do this quickly.

Once you’re in the BIOS, find the boot settings and make the removable drive (your flash drive) the one from which your computer boots first. You can find detailed instructions on how to do that here. Then, exit the BIOS. Your computer will restart and boot from the flash drive.

From there, a menu will appear. Just choose the option to run in live mode and then take the Linux distribution for a spin.

Photo credit: gytha_ogg

Converting Graphics on the Linux Desktop with Converseen

Convert it!If you’re a Linux user, then you probably know how spoiled you are when it comes to applications for working with graphics. Whatever you need to do — editing, resizing, viewing, converting — there’s an application for that.

One of the most powerful Linux tools for manipulating graphics is ImageMagick. As powerful as it is, ImageMagick can be a challenge to use. It’s a command line tool, which means quite a few options. That’s not a bad thing, but if you use it infrequently it can be tough to remember those options.

Enter Converseen. It is a graphical version of ImageMagick that focuses on converting and resizing images on the Linux desktop. Not only that, you can do that with more than one image at the same time.

Let’s take a look at how to use Converseen.

Getting Up and Running

The first thing you need to do is download and install Converseen. You can either download and compile the source code, or get packages for Fedora, Ubuntu, and openSUSE.

Once you’ve installed Converseen, launch it. In Ubuntu, for example, select Applications > Graphics > Converseen.

Main Converseen window

Let’s Start Converting!

Click the Add images button. In the dialog box that opens, navigate to the directory containing the images that you want to convert. You can select individual images or you can CTRL+click and select multiple images. If the images that you want to convert span multiple directories, repeat the process.

Then select Edit > Check All Items. This selects all of the images you loaded and tells Converseen that you want to convert them. If you don’t want to convert all of the images at once, click the To convert checkbox beside each image to select or deselect it.

Ready to convert

If you are converting the images to another format and not resizing them, click the Convert to list. Select a format from the list. You’ll notice that Converseen supports dozens of bitmap formats. Converseen can’t work with vector graphics, such as the popular SVG.

For those of you converting your images to JPEG or PNG, you can optionally click the Image settings button to change the amount by which Converseen compresses the resulting image. The more you compress an image, the smaller it is, but you also lose detail the more you compress it.

Changing settings

If you want to resize your images, click the Dimensions checkbox on the left side of the Converseen window. You can shrink or expand your images based on a percentage or on the number of pixels. Click the Maintain aspect ratio checkbox to keep the images in proportion.

Converting ...

When you’re ready to go, click the Convert button. Depending on the number and size of the images that you selected, this could take anywhere upward of a few seconds. Converseen dumps the converted images in your home directory — for example, /home/scott. You can change that in Output options section on the left side of the Converseen window.

Converseen is a fast, simple, and efficient way to convert and resize multiple files. It does the job very well and doesn’t require you to remember long strings of commands. It works as advertised, which is the hallmark of a good utility.

Photo credit: gimSM

Taking Screen Captures on the Linux Desktop with Shutter

I am a cameraOnce upon a time, just about the only people who took screen captures were technical communicators and technology writers. Nowadays, it seems that everyone needs to grab a window or screen on their desktop. Which is why, I guess, the number of screen capture tools available for various operating systems has blossomed over the years.

If you use Linux, then you suffer an embarrassment of riches when it comes to screen capture software. One of the most useful and flexible screen capture applications for the Linux desktop is Shutter.

Let’s take a closer look at how to use Shutter.

Installing Shutter

Chances are you don’t have Shutter installed on your computer. You can download source code and packages for various distributions.

If you use Ubuntu, then you can install Shutter from a Personal Package Archive. To do that, open a terminal window and run the following commands:

 sudo add-apt-repository ppa:shutter/ppa sudo apt-get update sudo apt-get install shutter 

Once Shutter is installed, you can launch it from a menu. For example, in Ubuntu select Applications > Accessories > Shutter.

Shutter main window

Getting Going

Using Shutter, you can grab the following:

  • Your entire desktop
  • A single window
  • An area that you select
  • A menu
  • A tool tip
  • A web page

Buttons for each of these options are on the application’s toolbar. When you minimize Shutter, its icon sits on a panel. You can choose an option by right clicking the Shutter icon.

Shutter right-click menu

The first two screen capture options — entire desktop and single window — pretty much explain themselves.

A captured window

To grab a portion of the screen, click the Selection button on the toolbar. Then, click and drag your mouse to select what you want to capture. When you’re done, press Enter on your keyboard.

Capturing a tooltip (the text that often appears when you hold your mouse over a button in an application) or a menu is probably only useful if you’re preparing documentation. You just have to remember to keep displaying the tooltip or menu for a few seconds before it’s captured.

Taking a screen capture of a web page works a little differently. When you click the Web button on the toolbar, a dialog box pops up. If you have a URL on your clipboard, Shutter assumes that’s the web page that you want to capture. You can also type a URL in the dialog box. Then, click the Capture button.

Capturing a website

This option doesn’t work with some websites. The capture process will sometimes time out, often without any rhyme or reason.

Editing Your Screen Captures

I usually like my screen capture software to do one thing and one thing only: take screen captures (obviously). If I want to manipulate screen captures, I can do that in an actual graphics program like The GIMP. But I make an exception for Shutter. Why? Its image editing tools, while limited, can be useful.

When you need to edit a screen capture, click the Edit button on the toolbar. You don’t get tools to resize, crop, rotate, or otherwise manipulate an image. You can add text, lines, callouts, and shapes to a screen capture. You can also highlight portions of a capture, or censor portions of an image to hide personal information.

Censoring private information

Final Thoughts

Shutter is a very flexible screen capture tool. I find it to be almost indispensable in my day-to-day work. It’s easy to use and has the features that I need (and a few that I find myself needing occasionally).

If you find yourself taking a large number of screen captures on the Linux desktop, then you should definitely give Shutter a look. It’s a worthy addition to your stable of applications.

Photo credit: Adorama

5 Basic Commands Every Linux User Should Know

Typing commandsSo you’ve been using Linux for a while but have never gone to the command line. Hmm … guess what? That’s not uncommon. While you don’t need to go to the command line to effectively use Linux, knowing even a few basic commands can be useful. That knowledge can open a few doors, expand your computing experience, and in some cases save your bacon.

But if you’re thinking about taking your first steps at the Linux command line, where do you start? There are literally hundreds of commands and it can be difficult to know which ones are useful to you.

Let’s take a look at five basic Linux commands that every user should know. Not only are these commands immediately useful, they’re a good foundation on which to build your knowledge of the command line.

1. cd

When you pop open a terminal window, you’re probably not in the directory in which you want to be. So, how do you get there? By using the cd command. Short for change directory, cd lets you quickly move around the command line.

To change to a directory, just type cd [directory_name] — for example, cd documents. Obviously, you can use this command to navigate to subdirectories, too.

What happens when you’re several subdirectories deep and want to move up a directory or two? To move back up one directory, type cd ... To move two directories up, type cd ../... You can see a pattern emerging here …

2. ls

You’ve moved into a directory and now you want to see what’s in there. To do that, type ls.

What the ls command returns

That’s all fine and dandy, but what if you want to find out more about one or more files? Like how big it is or when it was created or last modified? Type ls -l.

ls with the -l option

The -l option lists the permissions on the file, who owns it, who last edited it, its size in kilobytes, and the date and time when it was last modified.

While many people use ls with an entire directory, you can also use it with a single file or groups of files. How? For a single file, type ls [file_name]. For multiple files, use a wildcard — for example, ls *.html.

3. cp

Next up, the command to copy files: cp. There are a number of ways to use cp. The most common way to use this command is to copy a file to another directory.

To copy a file to another directory, type cp [file_name] [directory_name]. Say you want to copy a file named blue_background.png to the directory web_graphics/backgrounds. The directory is two levels above the directory you’re currently in. Type cp blue_background.png ../../web_graphics/backgrounds.

Remember that unless you’re at the top of your home directory (for example, /home/scott) or are copying a file to a directory that’s below the one you’re in, you need to do one of the following:

  • Enter the full path to the directory into which you’re copying a file
  • Specify how many levels up the target directory is (using ../)

Of course, you can copy multiple files with cp by using a wildcard — for example, cp *.odt myDocuments.

4. mv

Now that you know how to copy files, it’s time to learn how to move them around. That’s where the mv command comes in. You can use that command to either move files to another directory or rename them in place.

When you want to move a file to another directory, mv uses the same command syntax as cp: mv [file_name] [directory_name]. Let’s say you want to move a file named blue_background.png to the directory web_graphics/backgrounds. The directory is two levels above the directory you’re currently in. Type mv blue_background.png ../../web_graphics/backgrounds.

And, as with the cp command you can move multiple files by using a wildcard — for example, cp *.pdf Reports.

To rename a file, just type mv [file_name] [new_file_name] — for example, mv 14217_6794.jpg fast_typing.jpg.

5. rm

Finally, one of the more dangerous commands you’ll run into: rm. Use this command to delete files, but remember to use it with caution. You aren’t warned that you’re about to delete one or more files. Once you delete something, it’s gone.

To delete a file, type rm [file_name] — for example, rm presentation_template_2009.odp. To delete multiple files, use a wildcard — for example, rm *.odp.

Delving Deeper

Maybe this article has whetted your appetite for the command line and you want to learn more. Not just about other commands, but also the other options for the five commands that were just introduced. There are a number of excellent resources available to do just that.

I usually recommend two. First, Linux Phrasebook by Scott Granneman. It’s an indispensable dead-trees book. If your tastes are more aligned with the online world, then check out out Introduction to the Linux Command Line by the folks at FLOSS Manuals. It’s easily one of the best guides to the command line out there.

Photo credit: mulligand

First Look at the Asus EeePC X101 – MeeGo or NoGo?

With the hugely successful release of the Asus Transformer and a great lineup of laptops, Asus is truly stepping it up this year, and definitely living up to its motto “Inspiring Innovation. Persistent Perfection.”.  And the Asus EeePC X101 is no exception.

101x sized up with the 15

What a brilliant piece of hardware engineering! This is the first netbook I have ever used that has truly intrigued me. It’s incredible thinness (17.6mm!) and featherweight design is unbelievable. The battery life is awesome (4-7hrs). The keyboard is actually very usable (I am typing this article entirely with the X101), the processor is snappy (latest Intel Atom), and the white color and textured cover take it to the next level.

10

I can finally walk into a room and impress people with this netbook. The hardware is so sleek, so smooth, and so refined.

But there is one downfall.

As you probably noticed, I haven’t talked about the software yet. The Asus X101 I am using comes pre-installed with MeeGo, a Linux operating system first developed by Nokia. Don’t get me wrong, the idea behind MeeGo is great, build a lightweight Linux operating system for netbooks that utilizes a simplified interface for more productivity on a smaller screen. The real problem, as in most failing OS’s, is the support. Nobody makes applications for MeeGo because it’s not widely used. Asus has attempted to fix this by having an “app store,” but so far I have yet to see any productive software available aside from what comes pre-installed.

Even with the different problems in the OS, the social integration is great. It actually includes a Twitter and Facebook app that generates a feed for you that is really nice. OpenOffice is installed as well, which gives you the ability to do just about anything you’d do in Windows. And Chromium is always great, so the software isn’t unusable, it’s just not future-friendly.

101x vs. Transformer

And that brings me to another point. Asus did a great job making sure the pre-installed software did what 95% of people do with computers; browsing and word processing. On this front, Chromium, the open-source browser on which Google Chrome is built, is the only pre-installed browser and does a great job utilizing the small 10.1 inch screen. Tabs are minimal and there is no utility bar taking up extra space.

A great color choice
Clothed in White
The Asus EeePC X101 with MeeGo is rumored to be priced at $200 USD , which would put it at an incredible price point. The question is, would MeeGo be a stumbling block for most users? If you think it would be, I would ask you to consider installing Ubuntu on the X101. Ubuntu has just released it’s redesigned Unity user interface that was built for small netbooks just like the X101. So, buy the X101 for $200 with MeeGo, then install Ubuntu 11.04 and you have an incredibly light, fully capable and fast machine! At $200 bucks, you can’t buy a better netbook.
Check out Engadget’s coverage for more information.

Posting to Tumblr from the Linux Desktop with OpenTumblr Client

TumblrIf you’re looking to publish online, but want a platform that’s somewhere between Twitter and a fully-fledged blog, then you might want to check out Tumblr. With Tumblr, you post tumblelogs, short posts that can be text, video, or audio.

The great thing about a tumblelog is that it’s simple to set up and use. While posting from the Tumblr site itself is fairly easy,  you can also post from your desktop. However, if you’re running Linux, there aren’t too many Tumblr clients for the Linux desktop. One worth taking a look  at is OpenTumblr Client.

Getting Up and Running

OpenTumblr Client is written in Python, which you should have installed by default on your system. If not, install it using your distro’s package manager.

There are two versions of this application. One only requires Python, while the other requires both Python and the following libraries:

Again, you should be able to install those libraries from your distro’s package manager.

The main difference between the two version is that the Python QT version is a bit more compact and visually attractive.

Note: This post focuses on the Python + QT version of the OpenTumblr client.

Download the archive containing the installation files and extract it to your hard drive. Then, open a terminal window, navigate to the directory containing the files that you extracted, and then run the following command to install OpenTumblr Client:

sudo python setup.py install 

Let’s Get Tumblelogging!

Once OpenTumblr Client is installed, it’s added to your Applications menu. For example, in Ubuntu you can find the shortcut under Applications > Internet. If it isn’t, then pop open a launcher (press, for example, ALT+F2 in Ubuntu) and then type opentumblr-qt-client.py.

Login window

You’re asked to enter the email address of your Tumblr account, the password, and the name of your tumblelog. The name isn’t actually the name that appears at the top of a page when someone visits your tumblelog. It’s the URL — for example, mytumblelog.tumblr.com. Then click the Log in button.

Once you’re logged in, you’re presented with the application’s dashboard.

The dashboard

It looks a bit like the dashboard in Tumblr’s web interface. Just click an icon to open the editor to post text (a traditional blog post), links, conversations, quotes, photos, audio, and video. The editor is tailored to the type of post you’re making. For example, here’s the editor for a text post:

Ready to publish a text post

Just type information in the main fields and add a tag or two if you want. If you’re writing a text post, you can also add formatting to the text, as well as insert an image or a link.

If you want to schedule the post to publish at a later date, click the Publishing options list and select publish on. Then, in the Date this post field, enter a date and time to publish the post. It defaults to next Tuesday, 10 am.

When you’re ready to publish, click the Create Post button.

Like Tumblr, OpenTumblr Client is very easy to use. If you want to post to Tumblr from the Linux desktop, you’ll find OpenTumblr client a simple and effective way to do just that.

An Introduction to Ubuntu’s Personal Package Archives

UbuntuDo you use Ubuntu? Then you probably know that there really only are a few ways in which you can install software on your computer. Most people use either the Ubuntu Software Center or Synaptic Package Manager. Of course, you can compile the software’s source code or install it with a .deb package, but both those routes have their own issues.

While comprehensive, Ubuntu’s official software repository doesn’t contain every application under the sun. And it can be a while before updates to an application filter through to that repository. So what’s an Ubuntu user who wants to stay on the cutting edge to do?

Turn to a Personal Package Archive, that’s what.

A Personal Package What?

A Personal Package Archive (PPA) is a software repository that enables the developer, whose software may or may not be in the official Ubuntu repository, to bring software and updates to that software to users of Ubuntu. Developers host PPAs on Launchpad, a software collaboration site run and maintained by Canonical (the company behind Ubuntu).

Developers upload the source code to Launchpad, and the Launchpad compiles that code into the software that users can install. If you’re a developer, you can find more information about PPAs here.

Why Use a PPA?

The obvious advantage is that you can install and use software that isn’t in the official Ubuntu repositories. That, in itself, is a huge plus. And unlike installing software either by compiling source code or installing a .deb package, you get updates through Ubuntu’s Update Manager. That saves you a bit of time and effort when it comes to installing a new version of an application.

Of course, there is a danger that someone who runs a PPA might be distributing malicious code. While Canonical tries to ensure that doesn’t happen, you never can tell. You need to make sure that you can trust the source.

PPAs from the User’s Perspective

So, you’re an Ubuntu user and run across a nifty piece of software. You immediately want to download it, but find out that it’s only available through a PPA. So what do you do? Well, that depends on the version of Ubuntu you’re using.

In either case, go to the PPA page for the software — for example, the page for the daily builds of the Chromium Web browser. Find the section Adding this PPA to your system.

Adding a PPA in Ubuntu 9.10 or newer

If you’re using Ubuntu 9.10 or newer, find the name of the PPA. It looks something like this:

 ppa:[software_name]/ppa 

Where [software_name] is the application you want to install, for example chromium-daily.

Then, open a terminal window by selecting Applications > Accessories > Terminal. Type the following command in the terminal window to add the PPA:

 sudo add-apt-repository ppa:[software_name]/ppa 

When you’re prompted, enter the password that you use to log into Ubuntu. The PPA is then added to your list of software repositories. Then, type the following command in the terminal window to get the latest list of software from the PPA:

 sudo sudo apt-get update 

You can now install the software using the Ubuntu Software Center or Synaptic Package Manager.

Adding a PPA in Older Versions of Ubuntu

If you’re using a version of Ubuntu older than 9.10, the process is a bit different. In the section Adding this PPA to your system, click the link labeled Technical details about this PPA. Then click the dropdown list labeled Display sources.list entries for: and select your version of Ubuntu from the list.

Selecting your version of Ubuntu

Notice the two lines of code below the list. They look something like this:

 deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu hardy main deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu hardy main 

Copy those lines of code. Open a terminal window and type the following command to open your list of repositories in the text editor:

 sudo gedit /etc/apt/sources.list 

Paste the two lines of code at the end of the file and save it. Then, exit the text editor.

Keep the terminal window open and go back the PPA’s Web page in your browser. Look for the the entry on the page labeled Signing key (which verifies the software from the PPA). It looks something like this:

 1024R/4E5E17B5 

Copy the portion after the slash — in the example above, that’s 4E5E17B5. Then, go back to your terminal window and type the following command:

 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [key] 

Replace key with the portion of the signing key that you copied. Finally, type the following command in the terminal window to get the latest list of software from the PPA:

 sudo sudo apt-get update 

You can now install the software using Synaptic Package Manager.

Final Thoughts

Using a PPA is a great way to not only to try out new software, but also stay on the bleeding edge of an application that you currently use. It can take a bit of work to add a PPA to your list of software repositories, but once you do, it’s smooth sailing from there.

How to Detect Rootkits in Linux with rkhunter

UbuntuAs most are aware, there are very few viruses written for the Linux OS. There are, however, 242 known rootkits that can cause catastrophic damage to a Linux box. This post covers a rootkit detector called rkhunter. It is available from the repositories and is actively maintained at the time of posting.

Don’t know what a rootkit is? For the extended basics, a document titled Linux RootKits for Beginners – From Prevention to Removal is available from the Sans Institute, in pdf format here, or viewable via Google Docs here.

Getting Started

Once you’ve learned about rootkit basics (or already have a working knowledge of them), install and setup rkhunter on a system you know to be clean with these commands:

sudo apt-get install rkhunter
sudo rkhunter --update --propupd –pkgmgr dpkg

The –update switch updates rkhunter’s definitions of known rootkits. When –propupd is used, essentially you’re telling rkhunter that the system files it’s about to index are clean. If system files undergo changes after they are indexed by rkhunter, the next scan will show that in the results. The –pkgmgr dpkg option is Debian-specific.

Be aware that there are risks involved, per the warning from rkhunter’s man page:

WARNING: It is the users responsibility to ensure that the files on the system are genuine and from a reliable source. rkhunter can only report if a file has changed, but not on what has caused the change. Hence, if a file has changed, and the –propupd command option is used, then rkhunter will assume that the file is genuine.

The only way to be perfectly assured (well, as close to perfect as possible) a system is clean is if you have just installed the OS, and haven’t downloaded anything outside the repositories. If your install is clean, then rkhunter will prove mighty useful as an addition to your security protocol.

I choose to start rkhunter with these options:

sudo rkhunter -c --sk

The -c option tells rkhunter to run through three main checks: file property changes, rootkits, and application checks. The –sk option means skip keypress, so each check runs without user intervention. When rkhunter completes its audit, it displays a summary on the screen and writes a log file:

* NOTE * — There are two false positives to be aware of. In the very last check rkhunter performs, this shows up on many machines:

false positive results

These can safely be ignored.

There are many other ways to run rkhunter. The –cronjob option, I assume, sees its fair share of use. It integrates three options into one: –check, –nocolors and –skip-keypress (the same as –sk).

Keep tabs on your Linux installation! There is almost nothing worse than having your box rooted without your knowledge. Sure, the chances of being rooted are slim… unless you download just one file, from just one source you think you can trust, that contains a rootkit.

What other security tools do you find useful in your Linux distribution?