Monday, 22 September 2008

Tip of the Day: Start an ioQuake 3 Server

ioQuake3 is a project which took the Quake 3 source code (which was licensed under the GPL in 2005) and started to fix bugs and add new features and improvements. You can download it and install it from here.

To start a server, execute the following command:

/usr/local/games/ioquake3/ioq3ded.i386 +set fs_game baseq3 +set net_IP <IP> +set dedicated 2 +set com_hunkmegs 128 +exec server.cfg &

Make sure the path to ioq3ded.i386 is the correct one, depending on where you installed it and replace <IP> with your IP address.

13 Terminal Emulators for Linux

Konsole: This is a powerful and full-featured terminal included by default in KDE. It features desktop transparency, background images, profiles, tabs, notifications and plenty schemes to choose from.


GNOME-Terminal: The GNOME terminal, it has support for tabs and desktop transparency, with a clean and simple interface.

Yakuake: A wonderful terminal application for KDE which has the big advantage to stay hidden unless called with F12. It has a style similar with the Quake 3 console or other FPS games. It can use Konsole's settings, including transparency effects and notifications.


Tilda: Tilda is yet another terminal which has a style similar to Quake consoles. I could say it's the GNOME counterpart to Yakuake. When you first start it, you'll be presented with a window to configure it and choose the global shortcut for showing/hiding it.

ROXTerm: ROXTerm is a GTK terminal application with an interface similar to the one of GNOME-Terminal, supporting backgrounds, desktop transparency effects, profiles, colour schemes and many more.


xterm: xterm is the tradition terminal emulator for the X Window System, with a minimal interface. It can be configured using its configuration file.

Eterm: Eterm is a terminal with a futuristic design similar with Enlightenment styles. You will have to run it as Eterm, with capitalised E.


xvt: This is a basic terminal which uses a very small amount of memory, similar to xterm in many ways.

rxvt: It stands for our extended virtual terminal, and it's intended to be a smaller replacement to xterm.

mrxvt: Mrxvt supports tabs and background images while not being memory hungry and not depending on KDE or GNOME libraries.

rxvt-unicode: It features transparency effects, it has scrollbars and support for Unicode characters.

aterm: The AfterStep xvt terminal, aterm is based on xvt and needs less memory than xterm.

wterm: Another lightweight and simplistic terminal emulator which includes scrollbars, background images and transparency.

Sunday, 21 September 2008

Tip of the Day: Create Aliases

Aliases are user-defined commands which allow a person to execute several commands by only typing one. For example, to update and upgrade your Ubuntu system you would usually issue this:

sudo apt-get update
sudo apt-get upgrade

Or:

sudo apt-get update && sudo apt-get upgrade

The second command, sudo apt-get upgrade, is executed only if the first one was successful. In order to make this even shorter, you can create an alias and use it instead of the entire command you want executed. One of the ways to do it is add your aliases in the ~/.bashrc file, where ~ is your home directory. Just edit it with a text editor and add something like this at the end:

alias upgrade='sudo apt-get update && sudo apt-get upgrade'

Save the file, then open a terminal and try it by typing upgrade. Notice that if you did this in a terminal you'll have to logout first (use exit or CTRL+D) and open it again, so the .bashrc file is read again. Alternatively, you can only type:

source ~/.bashrc

Several other examples of aliases:

alias lsh='ls -lh'
alias killfx='kill -9 $(pidof firefox)'
alias gotocd='cd /media/cdrom0'

The first one will list the files in a directory using the long method and displaying sizes in human readable units. The second one will kill Firefox (useful when it stops responding and you have many windows opened). And the third one will change the current working directory to /media/cdrom0.

Updated: Sep 21, 2008

How-To: Install Wine 1.1.5 in Ubuntu 8.04 from the WineHQ APT Repository

A few days ago I wrote a tutorial showing how to compile Wine 1.1.4 from source in Ubuntu 8.04 and how to install it. In the meantime, version 1.1.5 was released on September 19, and since the compile from source and install procedure has not changed, I will explain here how to install the last Wine release using the official WineHQ APT repository. What follows are a few easy to do steps for getting the last Wine release up and running on your Ubuntu Hardy system.

Notice that this tutorial should work too with later Wine releases and Ubuntu 8.10.

1. Add the WineHQ key to your trusted APT keys
Open a terminal like GNOME-Terminal or Konsole and execute the following command:

wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -

The first command will get the key and its output will be passed to the second one, sudo apt-key add -, which will add it to your trusted APT keys.

2. Add the WineHQ APT repository to your sources.list file
Edit your /etc/apt/sources.list file with root privileges using a text editor like nano or Gedit (e.g. sudo nano /etc/apt/sources.list or gksudo gedit /etc/apt/sources.list) and add the following two lines:

deb http://wine.budgetdedicated.com/apt hardy main
deb-src http://wine.budgetdedicated.com/apt hardy main

Make sure to save the file (CTRL+O, Enter, followed by CTRL+X in Nano) and proceed to the next step.

An alternative way to do this is to execute this command:

sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/hardy.list -O /etc/apt/sources.list.d/winehq.list

Eventually, you can also edit the file /etc/apt/sources.list.d/winehq.list and uncomment the last line if you want sources repositories to be enabled too.

3. Update the packages list and install Wine
To update the packages list use:

sudo apt-get update

Then install Wine using:

sudo apt-get install wine

This should be all. To configure Wine, run as normal user:

winecfg

Related articles
How-To: Compile and Install Wine 1.1.4 in Ubuntu 8.04

Updated: Mar 31, 2008

Saturday, 20 September 2008

Tip of the Day: Use apt-file in Ubuntu 8.04

apt-file is a command line tool which allows you to see all the files which a package will install, and their location. For example, the output of apt-file show vorbis-tools on a Ubuntu 8.04 box will be:

ubuntu@ubuntu:~$ apt-file show vorbis-tools
vorbis-tools: /usr/bin/ogg123
vorbis-tools: /usr/bin/oggdec
vorbis-tools: /usr/bin/oggenc
vorbis-tools: /usr/bin/ogginfo
vorbis-tools: /usr/bin/vcut
vorbis-tools: /usr/bin/vorbiscomment
vorbis-tools: /usr/bin/vorbistagedit
vorbis-tools: /usr/lib/mime/packages/vorbis-tools
vorbis-tools: /usr/share/doc/vorbis-tools/README.Debian
vorbis-tools: /usr/share/doc/vorbis-tools/changelog.Debian.gz
vorbis-tools: /usr/share/doc/vorbis-tools/copyright
vorbis-tools: /usr/share/doc/vorbis-tools/examples/ogg123rc-example
vorbis-tools: /usr/share/man/man1/ogg123.1.gz
vorbis-tools: /usr/share/man/man1/oggdec.1.gz
vorbis-tools: /usr/share/man/man1/oggenc.1.gz
vorbis-tools: /usr/share/man/man1/ogginfo.1.gz
vorbis-tools: /usr/share/man/man1/vcut.1.gz
vorbis-tools: /usr/share/man/man1/vorbiscomment.1.gz
vorbis-tools: /usr/share/man/man1/vorbistagedit.1.gz

As you can see, it shows all the files (including binaries) which are installed by the package vorbis-tools.

To install apt-file, just use:

sudo apt-get install apt-file

The next step is to update its cache:

sudo apt-file update

Search for a specific file in the packages
Sometimes you remember the name of a tool but forget what package contains it. For example, to see in which package the shnsplit tool is included, you can execute:

ubuntu@ubuntu:~$ apt-file search shnsplit
shntool: /usr/bin/shnsplit
shntool: /usr/share/man/man1/shnsplit.1.gz

As you can see, shntool is the package we are looking for.

Updated: Sep 20, 2008

Compiling C/C++ Code in Ubuntu and Available IDEs

One of the many questions users who switch from Windows to Linux have is how to compile C/C++ sources and what IDEs (Integrated Development Environment) Linux has to offer. Most of them study C or C++ at school or home and are usually used from Windows with an IDE like Dev-C++ or Code::Blocks.

In this article I'll give a few explanations on how to compile software for studying purposes on Linux (and particularly Ubuntu), what are the most common ways, what I consider to be the most effective method and which are the most popular applications to use for programming in those languages.

I'll divert a little to say that Dev-C++, although a wonderful IDE on Windows, is no longer maintained, and even though a port used to be around for Linux, it was abandoned too (as far as I know). Instead, for those who would like a replacement which works and behaves the same way, I can warmly recommend Code::Blocks, which has an actively maintained port and it's easy to compile and install. According to the details I could find on #ubuntu @ Freenode, Code::Blocks will also be included in the Intrepid Ibex (the next Ubuntu release) repositories, in universe.

Back to our topic. I think the simplest way to start with C/C++ in Ubuntu is to use first an editor like Nano and create a source file, then compile it using gcc (GNU Compiler Collection) in command line. But first, to install the GNU compiler and several other utilities for compiling sources, use:

sudo apt-get install build-essential

build-essential is a meta package - a package which only depends on other packages, so installing it will automatically install several tools like gcc, g++ and make.

Next, create your source file using a text editor of choice (I used Nano for this example):

nano main.c

Enter the content, e.g.:

#include <stdio.h>

int main ()
{
printf ("Hello, world!\n");
return 0;
}


Notice that I also included a newline after the close bracket, otherwise the compiler will issue a warning. Save it with CTRL+O, then exit Nano using CTRL+X. To compile your source, simply use:

gcc main.c -o myapp

The output, myapp, will automatically be executable, so to run it use:

ubuntu@ubuntu:~$ ./myapp
Hello, world!

This is the simplest way of creating and compiling C or C++ code.

Regarding more complex, powerful IDEs, you can try Vim, Emacs (which can be run both in CLI mode using emacs --no-window and in GUI mode) or even the user-friendly Nano. Nano can be configured by editing (or creating if it does not exist yet) the ~/.nanorc file, where ~ is your home directory. The global configuration file is located in /etc/nanorc. Also, you can read this tutorial on how to enable syntax highlighting in Nano.

Among the good editors which use a graphical interface are Kate, Gedit, Geany, KDevelop, Anjuta, Code::Blocks or Eclipse. These are not all though, but I recommend trying those first and see which one fits. I'll briefly review some of them below, so you can have a general idea about each of them.

Kate
Its name means KDE Advanced Text Editor, but Kate is definitely not only a text editor. It supports highlighting in many languages, indentation, spell-checker, block selection mode, and it's highly configurable. Kate comes by default in Kubuntu or can be installed using sudo apt-get install kate.
Homepage

sudo apt-get install kate

Gedit
This is the default text editor in GNOME. It can be used as a simple IDE too. It comes installed by default in Ubuntu.
Homepage

sudo apt-get install gedit

Geany
Yet another editor written in GTK. It's pretty light and includes the most common features an IDE should have, so it's a good alternative to Gedit.
Homepage

sudo apt-get install geany

KDevelop
This is the KDE advanced IDE, offering the tools and advanced features of a full IDE. I recommend starting with a text editor rather than using this one for studying purposes. However, if you especially want to develop KDE applications, KDevelop is the way to go.
Homepage

sudo apt-get install kdevelop

Code::Blocks
This is the powerful port of Code::Blocks for Windows, using the wxWidgets interface. In my opinion it's very fit for studying C/C++ on Linux. Although not included in Hardy Heron, Code::Blocks will be included in the Intrepid Ibex repositories.
Homepage

Update: Ubuntu 9.04 comes with Code::Blocks included in the repositories, so you can install it using the usual sudo apt-get install codeblocks command. Ubuntu 8.10 and 8.04 users can follow the instructions below:

Notice: It is also a good idea to install xterm (a terminal application just like GNOME Terminal or Konsole), since Code::Blocks uses it to show the output of your programs.

sudo apt-get install xterm

1. Install the dependencies and compiler tools

sudo apt-get install build-essential
sudo apt-get install libwxgtk2.8-dev wx-common libgtk2.0-dev zip

2. Download the source code
Get the source from the official website, here, next uncompress it using:

tar -xjf codeblocks-8.02-src.tar.bz2

3. Compile it
Change the working directory to codeblocks-8.02-src and issue as usual:

./configure
make
sudo make install

Finally, run ldconfig as root:

sudo ldconfig

This should do it. You can run Code::Blocks by typing codeblocks in a terminal or pressing ALT+F2 and writing codeblocks in the run dialogue that appears.


Anjuta
Written in GTK, Anjuta is a powerful development environment for C and C++, which also allows you to create GNOME applications.
Homepage

sudo apt-get install anjuta

Addition: NetBeans
NetBeans is an advanced IDE written in Java from Sun Microsystems, and can be used for developing C/C++ code too.
Homepage

sudo apt-get install netbeans-ide


Addition: Eclipse CDT
The package eclipse-cdt provides the Eclipse IDE with C/C++ development plugins. I found it slower than the others IDEs mentioned here, especially the interface.
Homepage

sudo apt-get install eclipse-cdt

Addition: CodeLite
CodeLite is an open-source IDE similar with Code::Blocks. To install it, download the latest Ubuntu build (DEB package) from the official website, make sure the current working directory is the one where you saved it, and type the following command (replacing the filename with the latest name):
Homepage

sudo dpkg -i codelite_1.0.2785-ubuntu0_i386.deb

Emacs and Vim
Both Emacs and Vim became legends on Linux and they both have fans who continuously argue on which one's better. I personally prefer Emacs over Vim, but I recommend you to try both and see which one fits you better. Emacs is not only an IDE, it's also an e-mail client, eventually IRC client, file browser and more. Regarding speed, Emacs is way slower than Vim, and as IDEs, both include great features. Both Emacs and Vim use their own concepts and keyboard shortcuts, so as a beginner you'll (probably) find them a little hard to learn, but this doesn't mean you don't have to use them. Put some effort into learning at least one of them and you'll see in time how helpful this learning process is. Another note: most systems (including web servers which you'll usually ssh to in order to manage your web page - if you have one) include Vim by default, but not Nano or Emacs.
Emacs homepage
Vim homepage

sudo apt-get install emacs
sudo apt-get install vim

Update: As I already mentioned earlier in this article, Dev-C++ is not available on Linux, however if you really, really want to work in it instead of a native IDE, you can successfully run it through Wine. To install Wine either type sudo apt-get install wine (which will install 1.0) or to install the latest release use one of the following tutorials (they all work for Ubuntu 8.10, 9.04 Jaunty Jackalope and the latest Wine release): tutorial 1, tutorial 2, tutorial 3. After setting up Wine download Dev-C++ from here, and run wine devcpp-4.9.9.2_setup.exe to install it. Refer to this page to see what additional libraries you will need for running binaries compiled with Dev-C++. The executables will be located by default inside the ~/.wine/drive_c/Dev-Cpp/Packages directory, where ~ is your home directory.


Have some other questions regarding compiling or using IDEs on Linux? Or maybe a correction or suggestion regarding this tutorial? Please feel free to discuss in the comments below.

Updated: Aug 13, 2011

Thursday, 18 September 2008

Tip of the Day: Change the Font Size of Firefox UI (User Interface)

Sometimes the default font for the Firefox interface is either too small or too large, so in order to adjust it you will only need to edit the file userChrome-example.css located in the ~/.mozilla/firefox/RANDOM_CHARACTERS.default/chrome/ directory, where ~ is your home directory.

For example, the full path where this file is located can look like:

/home/username/.mozilla/firefox/bla7abcd.default/userChrome-example.css

Open it with a text edit and add the following after the last comment:

* {font-size: 7pt !important;}

You can experiment and see what size is the one that suits your needs, for example 9pt or 12pt instead of 7pt. Next, save the file with the name userChrome.css in the same directory. You will have to restart Firefox in order for changes to take effect.

Updated: Oct 18, 2008

Wednesday, 17 September 2008

Tip of the Day: Convert Various Video Formats to Theora Video

In this tips and tricks article I'll briefly introduce you to ffmpeg2theora, a powerful command line tool which allows you to convert many video formats to the free video codec Theora. ffmpeg2theora can encode to Theora any format that can be read by ffmpeg, like MPEG, MPEG4 or DivX.

To install ffmpeg2theora in Ubuntu, type:

sudo apt-get install ffmpeg2theora

With your user's password. Here's a basic example for using it:

ffmpeg2theora -q 6 -A 192 video_file.avi

Which will recode video_file.avi into video_file.ogg, using the video quality of 6 (-q 6) and the average audio bitrate of 192 kbps (-A 192). You can also use ffmpeg2theora to encode DVD .VOB files, like this:

ffmpeg2theora VTS_01_1.VOB -o video_01.ogg

Or, for example:

ffmpeg2theora -A 192 --artist "Pink Floyd" --title "Live at Pompeii [1972]" VTS_01_1.VOB -o Pink.Floyd.Live.at.Pompeii.1972.Part.1.ogg

Which will convert VTS_01_1.VOB into Ogg Theora, using 192 kbps for audio and will also add the artist and title tags as video metadata.

Updated: Sep 17, 2008

IRC Clients for Linux Part 2: List of 5 CLI Clients

A while ago I reviewed 6 GUI clients for IRC, so today I'll continue with the second part with this review of 5 CLI (Command Line Interface) clients.

BitchX
This was once the most popular IRC client for Linux, but now it is not maintained anymore and distributions like Debian and Ubuntu don't include it in their repositories. The official IRC channel of BitchX is located on EFNet, on #bitchx.
Homepage

Irssi
Also known as 'the client of the future', Irssi is one of the most popular, well-documented, powerful and configurable IRC client for command line at the current time. It supports Perl scripting and the official website provides hundreds of scripts for any possible task, from now listening and weather scripts to system information scripts. Irssi is one of my favourite applications for CLI, and it really deserves it. Although it can be a little tough to learn it, the FAQ and abundant documentation on the homepage cover every aspect regarding Irssi, from how to use it up to how to create Perl scripts for it. Irssi includes an effective way to switch between networks and channels using the keyboard, and some of the shorcuts are Emacs-like. They can also be changed.
Homepage
Irssi 0.8.2 running in Konsole

Epic4
This is yet another well-known client, although its interface is not as user-friendly as the one Irssi has. But Epic4 allows you to customise it the way you like via scripts instead of coming with a friendly way of handling how messages are displayed, or how a /WHOIS or /NAMES output is printed. According to the official website, Epic was forked from ircII-2.8.2 in the fall 1994. It uses its own scripting language, called ircII, which borrows many concepts from Perl, Tcl, Ruby and PHP. You can find more help on scripting on the official homepage, here. The last stable version of Epic4 is 2.8, and you can get it from here.
Homepage

Epic4 2.6 running in Kubuntu 8.04

WeeChat
WeeChat is a user-friendly IRC client which is describes on the homepage as a 'fast, light and extensible IRC client'. It supports Perl, Python and Lua scripts, and provides many other features, like connections to multi-servers, DCC, proxy and SSL support. Together with Irssi, I think WeeChat should be the client of choice for beginners to IRC who want to use a CLI client instead of a GUI one like XChat or Konversation. It's user-friendly and provides a scripting interface, so you can customise it the way you like and turn it into a powerful client which matches your taste. According to the official website, Qt and GTK interfaces are planned for WeeChat.
Homepage


TinyIRC
This is a minimal IRC client, providing a very basic interface and only basic features. I can't recommend it for using IRC on a daily basis, but it is worth a try if you only want to connect to a network fast and just start chatting without the need of features, colours, or scripting languages. It has no TAB completion feature and doesn't seem to support more than one network connection at a time.
Homepage

Conclusion
As a conclusion, I strongly recommend Irssi, followed by WeeChat and Epic4. The first two are powerful enough, flexible, documented and have scripting support, while the latter is a little harder to use (at least in the beginning) and it has its own scripting language. Despite this, Epic4 has the advantage of giving you total control over how you want its interface to look like, and it also provides many scripts on the official website for customising it. BitchX is too old now and it's no longer updated, while TinyIRC offers only the minimum features needed to connect and interract with an IRC server.

Related articles
IRC Clients Part 1: List of 6 GUI Clients

Updated: Sep 17, 2008

Tuesday, 16 September 2008

Tip of the Day: Clear the KTorrent Search History

Ubuntu 8.04 comes with KTorrent 2.2.5, which includes by default several plugins among which is the Search plugin, for finding torrents on various sites. In order to clear the search history, you will only have to delete the file ~/.kde/share/apps/ktorrent/search_history, where ~ is your home directory. For example, either type in a terminal application:

rm ~/.kde/share/apps/ktorrent/search_history

Or use a file manager like Konqueror, make sure to have viewing hidden files enabled and delete it this way. You'll have to restart KTorrent for changes to be visible.


Updated: Sep 16, 2008

Firefox 3 - The Beast Among Web Browsers

Firefox became in a relatively short period of time the most popular web browser on Linux. It is also the most powerful competitor to Internet Explorer on Windows, proving itself faster, more stable, more flexible and secure. Some would say Firefox is one of the most important proofs that open-source software can and is actually better than closed, proprietary software. Firefox is heavily advertised by the Mozilla corporation, many Linux fans put a link to the official Firefox website on their blog or personal homepages, initiatives like SpreadFirefox.com or the Firefox Download Day, they all contribute to making Firefox so popular.

Firefox 3.0.1 running on Kubuntu 8.04 Live CD

Firefox uses the Gecko layout engine (also called a rendering engine) for displaying web pages and its user interface too, by rendering XUL, an XML user interface language providing widget definitions. Gecko 1.9 is used in the last stable Firefox release. An unofficial port of Firefox using Qt instead of XUL is in the works too, and I'm very curious how development will evolve.

Compared to browsers which use different engines, like Konqueror 3.5.9 or Opera 9.52, Firefox performs better than the first when submitting or filling up certain forms, but it seems slower loading web pages than Opera. Konqueror 3.5.9 (which uses KHTML) fails miserably for example allowing you to send mails using certain forms or even writing a Blogspot post, while Firefox has no problems regarding this matter. On the other hand, despite the fact that it was praised and announced to have a lot of speed improvements, Firefox still eats more CPU and memory resources than either Konqueror or Opera, making it the slowest of them three. Although it has slow loading times and a slow interface, once loaded and in action, Firefox will prove the best tool for finishing any web-related task, also having the big advantage over Opera for being open-source.

The interface hasn't changed much compared to previous versions, like the 2.x series. It's clean, simple and intuitive, providing only the necessary toolbar buttons and most useful options via the Preferences window. A good improvement version 3 has is the address bar, which now offers clever ways of accessing the desired location, depending on how many times you accessed it and how relevant the content is compared to what you type.

It has a bookmark toolbar for fast access to your most used addresses, and provides the classic Back, Forward, Reload, Stop and Home buttons. To the right of the address bar is located the Search Engines feature, which can be accessed using CTRL+K and allows you to search by default on Google, or select another search engine, like Amazon.com or Wikipedia. Many other engines can also be installed, but I think user-defined keyword shortcuts are more useful and handy. It's a matter of preferences after all.

The Preferences window allows configuration of the most usual settings, like the default address to start with, download location, tabs configuration, appearance or security (including privacy settings, cookies, and passwords). The interface fonts can be changed using the userChrome.css file inside the Firefox directory (e.g. ~/.mozilla/firefox/RANDOM.default/chrome/userChrome.css).

Preferences - you can change the most usual settings here
The about:config dialogue allows you to truly configure Firefox in any way possible, and you can find here all the necessary entries for tweaking Firefox the way you like it. For example, if you want to disable the finished downloads notification, all you have to do is search for the browser.download.manager.showAlertOnComplete variable and set its value to false by double clicking on it. A very comprehensive guide for each entry can be found here.

The about:config entries - tweak anything related to Firefox from here

One of the great features Firefox comes with is the ability to install various add-ons and themes, and the official website contains hundreds of them, like the StumbleUpon add-on, the DownloadHelper add-on for downloading all media content from within a web page (useful especially for YouTube videos), or the Adblock Plus extension which blocks ads on pages including them. Some of the nicest themes already ported to Firefox 3 are Noia eXtreme and Phoenity Modern.

Managing bookmarks

Regarding interface speed, response and loading times, I think Firefox still remains one of the slowest browsers compared to Konqueror, Opera or Epiphany. I didn't yet have the occasion to compare it to Chrome, but since currently it's only natively available for Windows, running it through Wine shouldn't be fair.

About Firefox 3

In the end, Firefox 3 looks to be the most powerful and useful browser available for the Linux platform. Opera is a very good competitor regarding features and usability, but unfortunately it's still closed-source. All the themes, all the powerful entries in about:config, the add-ons, the bookmarks easy to manage, all these features make out of Firefox the best and the most popular web application for the Linux OS.

Related articles
5 Useful Tips to Customise Firefox 3

Updated: Sep 16, 2008

Monday, 15 September 2008

Tip of the Day: Rip FLAC and WAV to Ogg Vorbis

Ogg Vorbis is a free lossy audio encoder developed by Xiph.org, and it has the advantage over MP3 to have a better quality and smaller size (at least for files encoded at a low bitrate), and it's not governed by any patent. I always loved this format and my entire music collection is consisted of Vorbis files. They can be read by any player by default (like Amarok, Rhythmbox, Banshee and so on) without the need to install codecs for proprietary formats.

To install the package which contains the encoder, along with several other Vorbis tools and an Ogg Vorbis player, use:

sudo apt-get install vorbis-tools

This package contains the following tools:
- oggenc: the encoder
- oggdec: the decoder
- ogg123: Ogg Vorbis player
- ogginfo: tool to display Ogg information
- vcut: tool to split Ogg files
- vorbiscomment: tool to edit tags for Ogg Vorbis files

To rip FLAC (Free Lossless Audio Codec) files, use for example:

oggenc -b 192 file.flac

Or:

oggenc -q 6 *.flac

The first one will encode file.flac into Ogg Vorbis at an average bitrate of 192 kbps, while the second command will rip all the files ending in .flac in the current working directory using the quality factor of 6. For more details, use oggenc --help or man oggenc.

The same goes for WAV files:

oggenc -b 128 *.wav

Related articles
Tip of the Day: Split FLAC or WAV Files Using a CUE File

Updated: Sep 16, 2008

Sunday, 14 September 2008

Tip of the Day: Convert NRG Images to ISO

There are two easy to use tools for converting NRG (a file format used for CD images by the Nero Burning ROM application) to ISO: nrg2iso and iat.

To install them on Ubuntu, type:

sudo apt-get install nrg2iso iat

Use nrg2iso like this:

nrg2iso cd_image.nrg cd_image.iso

And for iat:

iat cd_image.nrg cd_image.iso

iat supports many CD file formats, including ISO, NRG, BIN and MDF.

Updated: Sep 14, 2008

5 Useful Tips to Customise Firefox 3

Firefox is the most popular application for viewing web pages on Linux, being the browser of choice for over 70% of the Linux users. In this article I will explain 5 of the most useful and used tips in Firefox, together with screenshots where I considered necessary. Most of them are related with the about:config variables, but I also provided a graphical way of doing things where it was possible.

1. Disable the finished downloads popup notification

Firefox 3.x comes by default with the notification for finished downloads enabled by default, displayed in the lower-right corner when all downloads are complete. In order to disable this notification, type about:config in the address bar, click on the I'll be careful, I promise! button in the window appearing and find the variable below using the Filter text box:

browser.download.manager.showAlertOnComplete

Double-click on it to switch its value to false. This should do it.

Changing value for the browser.download.manager.showAlertOnComplete variable

2. View images at normal size instead of zoomed out to fit the window
Images which are displayed in a whole tab will be resized to fit the window if they are larger than it. In order to have them being displayed by default at normal size, go to about:config in the address bar and search for this variable:

browser.enable_automatic_image_resizing

And change its value from true to false.

3. Change background colour
This will change the default background colour for web pages which don't explicitly set their colours. The default in hex code is #FFFFF (white).

There are two ways of doing this. The first one is via the Preferences dialogue, so go to Edit -> Preferences -> Content -> Colors... and change the background colour with the one you want.

Change text, link and background colours from here

The second way is via the about:config window, where you should find this variable:

browser.display.background_color

Notice that the value is in hex, so you will first need to find the hex value for your colour. Examples:

#000000 - black
#FFFFF - white (which is the default)
#000080 - navy
#800080 - purple

I used the colour picker in KDE for seeing the values, so usually you'll be able to use any image editor for getting the value of a certain colour.

4. Enable scrolling using the third mouse button
Firefox offers the possibility to scroll web pages by clicking the third mouse button (the wheel button or right + left click the same time, depending on whether xorg.conf is configured to emulate third mouse button). Web pages can be scrolled both horizontally and vertically.

To enable this feature, go to Edit -> Preferences -> Advanced and tick the option Use autoscrolling.

Tick the option Use autoscrolling to enable scrolling using the third mouse button

Alternately, you can find the variable general.autoScroll in about:config and switch its value to true.

5. Create search shortcuts
This is a powerful feature which allows you to search directly from the address bar on a search engine of choice. Alternately you can use the Search Engines feature by pressing CTRL+K, but it will only search on the currently selected engine (default is Google).

For example, to create a search shortcut for Wikipedia, open a new tab (CTRL+T) and go to http://en.wikipedia.org/wiki/Main_Page. Right click on the search field and select Add a Keyword for this Search..., then enter the desired name and shortcut in the window that appears. For example I use here Wikipedia for the name and wp as the shorcut. After you're finished click the Add button.

Right click on the search box and select Add a Keyword for this Search...

Enter the name of the shortcut and the keyword you want to use
To use it, type in the address bar wp followed by space and the term you want to search for, in example Pink Floyd:

wp pink floyd

And Firefox will automatically search for Pink Floyd on Wikipedia. The shortcut is kept as a bookmark.

Updated: Sep 15, 2008

Saturday, 13 September 2008

Tip of the Day: Split FLAC or WAV Files Using a CUE File

In order to split a FLAC or WAV file when you have a CUE file available, you will first need to install the packages cuetools and shntool:

sudo apt-get install cuetools shntool

These two packages contain the tools cuebreakpoints and shnsplit, which can be used as follows:

To split a FLAC file:

cuebreakpoints audio_disc.cue | shnsplit audio_disc.flac

And, for a WAV file:

cuebreakpoints audio_disc.cue | shnsplit audio_disc.wav

You can also edit the CUE file with a text editor in order to modify length times, or for concatenating two or more tracks.

Related articles
Tip of the Day: Rip FLAC and WAV to Ogg Vorbis

Updated: Sep 16, 2008

My First Linux Encounter or How to Switch to Linux

I was a Windows user for several years when I decided to switch to Linux, late 2005 or early 2006, I can't recall exactly. I remember that on Windows I was always looking for freeware alternatives to all the paid applications. At the time, I was not aware of the terms 'open-source' or 'free software', and I definitely had no idea about the concepts behind them. On Windows I considered myself a 'power user', I knew my way around and could complete almost any task in Windows XP easily. I kept searching until I bumped into Linux and decided to give it a try.

First it was Red Hat 9 for a couple of days, but I had problems with it at network recognition, and so I discovered Ubuntu. After about one month of dual booting with Windows XP I finally made up my mind and wiped it out, leaving the entire hard disk for a freshly, brand new Ubuntu 5.10. Breezy was practically my first Linux distribution.

I knew when I started that the transition will be tough for me; things are done differently on Linux compared to the way they are done in Windows. And it's pretty hard to get unused with a way of doing things which I used for over six years. But what made me stick to Linux and never return, what kept me getting used to all the new stuff and a new, different way of doing things, was the pure fact that I knew Linux will be different and I must put effort into learning it. I understood that I'll have to learn most of the things again and I was prepared to do it. From the beginning, Linux offered me flexibility and free choice, with no fear of using the software or sharing it using BitTorrent or Direct Connect, for example. And the result is now awesome: I'm a happily and passionate Linux user for three years now, and I'd never go back. I can't imagine going back and leave all this behind.

I think one of the main reasons most of the people try Linux and go back to Windows is that they aren't determined to make the switch, and they can't conceive that there are other ways of doing things than the Windows methods. If something is done differently on Linux, they quickly jump to a conclusion that goes like 'This is not right, on Windows it's done the other way around. Then it's no good.' Or the eternal and already 'legendary' syntax, which Linux users are tired and bored of hearing, 'On Windows everything is easier.' Well, I usually smile now whenever I hear it or read it. Once a person gets used to something, it's harder to do it the other way around afterwards, especially if he is not truly determined to do it or at least give it a good try. Unfortunately a big percentage of Windows users who try Linux reach the conclusion that 'it doesn't work', so they go back.

The 'easier' concept is so relative, and why do I think that? Well, to give a simple example: I got used to rip FLAC files using the flac and oggenc command line tools and I also have several small Bash scripts to ease my work. For me, this method is the easiest and fastest, although there are plenty graphical applications out there for doing this task. Or any other.

I agree, when I first started there were many things which I didn't understand and which I felt that were not right. Believe it or not, it didn't seem logical to me that Linux allows two files with the names, for example, Music and music in the same directory. Was that because it really wasn't logical? Or because I was used from Windows with not having two files with the same name, where the names actually aren't case-sensitive? So no, it was because I was used that way from Windows. Or, to give another example: the lack of Apply buttons in GNOME applications. I just felt like the options were not applied if I didn't have that Apply button there. But I knew it's different, and I embraced it. I kept reading forums and articles, and many tutorials; I started to love what I was learning, the whole development method and the community.

Most Windows users expect the change to be fast and smooth: they expect to find in Linux a similar OS with Windows in every aspect; it's a well-known issue. When they find out it's not like that, all is over.

Windows and mainly closed-source applications drive to a strange mentality. I remember a thread on the Battle for Wesnoth forums, a TBS game for Linux, Windows and Mac, licensed under the GPL, about some guy selling the game on CDs on eBay. Believe it or not, the guy was highly criticised by several users posting in that thread, saying that he should ask for permission or that it's illegal. But still, the game is under the GPL, which means he was allowed to sell it without any legal issues.

I remember I had this friend, pretty techy guy, who decided to switch to Linux. He was pretty determined, so I installed Kubuntu for him and tried to help him and explain the best way I could how to solve his problems on Linux. He was open-minded - I remember he tried to make Alpha Centauri work a whole night, with no intention on giving up. Whenever I could, I tried to help him; and he took my advices and sticked to Linux for a while. Well, eventually, he gave up in the end. Maybe I didn't try enough, or maybe he depended too much on Windows, I'm not sure. The thing is, if I would have tried harder, he would have probably ended up using Linux today.

As a conclusion, I think there's no big chance for a person to switch, unless he truly wants it. Windows users need either good determination for switching, or eventually help from someone who has already been there and knows how to make a convert for the wonderful world of Linux.

Note: This is a later, revised version of the article which I originally posted here.

Updated: Sep 15, 2008

How-To: Install Skype 2.0 in Ubuntu 8.04

Skype is a popular closed-source application for voice chat and telephony which is probably now the most used application for internet conversations. The last Skype release for Linux is 2.0.

One way of installing Skype in Ubuntu 8.04 'Hardy Heron' is to get all the dependencies and then install the DEB package provided on the official website. In order to do it, follow the steps below:

Installation in Ubuntu 8.04

1. Install the needed dependencies
Type in a terminal application and provide your user's password:

sudo apt-get install libasound2 libc6 libgcc1 libqt4-core libqt4-gui libsigc++-2.0-0c2a libstdc++6 libx11-6

2. Download the DEB package and install it
Download the package from the official website here (the one under Ubuntu 7.04+). At the time of writing the package is called skype-debian_2.0.0.72-1_i386.deb. To install it, just type:

sudo dpkg -i skype-debian_2.0.0.72-1_i386.deb

The Skype binary should now be installed in /usr/bin/skype. You can run it by typing ALT+F2 and entering skype in the run dialogue that appears.

3. Removing Skype
To remove it, issue the command:

sudo dpkg -r skype

With your user's password.

Installation in Debian Lenny

Installation in Lenny is similar with the one on Ubuntu, except that you'll have to login as root using su to issue the commands preceded by sudo. For example:

su
apt-get install libasound2 libc6 libgcc1 libqt4-core libqt4-gui libsigc++-2.0-0c2a libstdc++6 libx11-6

Download the same package as downloaded for Ubuntu, or select the one for Debian Etch (they are one and the same), then issue:

su
dpkg -i skype-debian_2.0.0.72-1_i386.deb

Related articles
How-To: Compile and Install Wine 1.1.4 in Ubuntu 8.04

Updated: Sep 16, 2008

Friday, 12 September 2008

Tip of the Day: Mount an ISO Image

To mount an ISO image in Ubuntu, you will only need to execute a command like:

sudo mount -o loop /path/to/cd_image.iso /path/to/mount/point/

For example:

sudo mount -o loop ~/dvd_image.iso /media/cdrom0/

The image will be mounted under /media/cdrom0/. You can also create mount points in /mnt (or a directory of your choice), just make sure the mount point is an empty directory:

sudo mkdir -p /mnt/iso0/
sudo mount -o loop ~/dvd_image.iso /mnt/iso0/

Updated: Sep 12, 2008

How-To: Compile and Install Wine 1.1.4 in Ubuntu 8.04

Ubuntu 8.04 comes with Wine 0.9.59, which is already pretty old. In the meantime, the latest development version of Wine is 1.1.4, which was released on September 5, 2008.

In order to compile Wine from source and install it on Ubuntu, you will only need to follow several easy steps I list below:

1. Enable the sources repositories
Make sure you have a line in the /etc/apt/sources.list file which says something like:

deb-src http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse

Next, update the packages list:

sudo apt-get update

2. Install the Wine dependencies
This will also install the build-essential meta package if it's not already installed:

sudo apt-get build-dep wine

3. Download the Wine 1.1.4 source tarball, compile and install
Download the source from the official website (direct link here), uncompress it, change the current working directory to wine-1.1.4 and type the command:

./tools/wineinstall

If the configuration goes smooth, you'll be presented with a message similar to the one below:

configure: Finished. Do 'make depend && make' to compile Wine.


We need to install wine as root user, do you want us to build wine,
'su root' and install Wine? Enter 'no' to continue without installing
(yes/no)

Type no, wait for Wine to be compiled, then use:

sudo make install

To install Wine.

4. Run Wine
Run winecfg as normal user in order to configure it, then use it like wine WIN_APP.EXE in order to start Windows applications. You can see where the binary was installed by typing:

whereis wine

And to see the version:

wine --version

This should be all.

Resources
Wine homepage
Wine applications database
Wine Wiki

Updated: Sep 12, 2008

IRC Clients for Linux Part 1: List of 6 GUI Clients

IRC plays a major role in the Linux development and the community itself, and most distributions and software projects usually have one or more IRC channels (usually on Freenode or, in Debian's case, on OFTC) for discussing issues related to the project or just helping users.

I decided to put up this list which contains no less than 6 graphical IRC clients for Linux, powerful or user-friendly. I also provided several screenshots where I considered necessary and a brief description for each of them.

The GUI (Graphical User Interface) clients

XChat
XChat is built in GTK and it is one of the most powerful graphical clients for Linux, including scripting (Perl, Python, Tcl) and plugin interface, high configurability via the /set variables (like the conference mode, for example), support for connections to multiple networks (a must-have for any IRC client in my opinion) and much more. The forum and the #xchat @ Freenode channel are very helpful, and the documentation on the official site is abundant too. For GNOME users, a project called xchat-gnome is also available.
Homepage

XChat 2.8.4

Konversation
Being well-known for the fact that it's one of the most user-friendly clients for Linux, Konversation is also very popular among KDE users. It doesn't have event-based scripting yet, but it provides options for each and every need a user would need. Comes bundled with several default scripts like a media player announcer or a weather script to mention two of them. It integrates in the system tray, includes alerts and is very fast.
Homepage

Konversation 1.0.1

KVirc
Another user-friendly client for KDE, KVirc provides a scripting interface similar to the one of mIRC for Windows, many configuration options, themes, support for multiple network connections, and much, much more. The only minus it has is that it's a little bloated and slow. Each new release is accompanied by a concept picture and codename, and documentation is abundant and included in the Help menu.
Homepage

KVirc 3.2.4 'Anomalies'

KSirc
In my opinion KSirc is the weakest client compared to Konversation or KVirc, but it comes by default with the KDE 3.5.x distribution, being included in the kdenetwork package. It supports scripting in Perl.
Homepage

KSirc running in Kubuntu 8.04

Pidgin
Pidgin is formerly known as Gaim, the GNOME instant messaging client, also including a basic IRC client.
Homepage

Pidgin 2.4.1

Kopete
The official KDE IM client, Kopete includes a basic IRC client. Although they don't have powerful and fully-featured IRC clients, both Pidgin and Kopete can be used when you also use one or more IM protocols, like Yahoo! or MSN. This way, you can stay on IRC and IM using a single application.
Homepage

Creating an IRC account in Kopete

Kopete 0.12.7 - #debian @ OFTC

Update: Quassel
Quassel is a basic KDE 4 IRC client which comes as default in Kubuntu. It does not support event-based scripting, but it offers several useful (and popular) configuration options.
Homepage


Installation in Ubuntu
For every client, just use sudo apt-get install CLIENT_NAME with your user password. For example:

sudo apt-get install xchat

Or:

sudo apt-get install konversation

There are two versions for KVirc, 3.2.4 and 2.1.3. To install KVirc 3.2.4 use:

sudo apt-get install kvirc

And for 2.1.3:

sudo apt-get install kvirc2

Updated: March 29, 2009

How-To: Compile and Install SMPlayer 0.6.2 in Ubuntu 8.04 'Hardy Heron'

Using the MPlayer engine, SMPlayer is a powerful video player built in Qt4, with support for playing DVDs, DVD ISO images, a configurable interface, icon themes, the very useful feature of remembering settings and time left from a video after closing it (so when you restart SMPlayer the movie will be loaded from where you left it), support for subtitles and much more. SMPlayer lately gained a lot of popularity and I'm sure it will become one of the most used video players on Linux, if it's not already.

The last version of SMPlayer is 0.6.2, however the Ubuntu Hardy repositories include only 0.6.0, so in order to compile from source and install the last version of SMPlayer, you'll have to follow several easy steps explained below.


1. Make sure you have the sources repositories enabled
Edit your /etc/apt/sources.list file as root and make sure you have a line which says something like:

deb-src http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse

Then, don't forget to update the packages list:

sudo apt-get update

2. Install the tools needed to compile it and the development libraries

sudo apt-get build-dep smplayer

This command will install the development libraries, together with the necessary tools to compile, like the build-essential meta package for example (if not already installed).

3. Download the source and uncompress it
Next, download the SMPlayer source tarball from here and uncompress it using:

tar -xjf smplayer-0.6.2.tar.bz2

4. Compile and install SMPlayer 0.6.2
Change the working directory to smplayer-0.6.2 and issue the following commands:

make QMAKE=/usr/share/qt4/bin/qmake

To install it:

sudo make install

SMPlayer should be now installed in /usr/local/bin/smplayer (use whereis smplayer to find it).

Updated: Sep 12, 2008

Thursday, 11 September 2008

Ubuntu 9.04 to Be Codenamed 'Jaunty Jackalope'

According to a message posted on the Ubuntu mailing list by Mark Shuttleworth, the leader of the Ubuntu project, the codename for the 9.04 release of Ubuntu will be 'Jaunty Jackalope'.

I guess Ubuntu fans are already used with the funny codenames each new release has, and usually there is a forum thread for name suggestions permanently back at UbuntuForums. Jaunty Jackalope will most likely be released in April 2009, the first number meaning the year (2009), while the numbers after the dot represent the month. More details on the release cyle here.

Wikipedia has an article about 'jackalope' as being an imaginary creature described by a cross between a jackrabbit and an antelope, goat or deer, often portrayed as a rabbit with antlers. Although Mark Shuttleworth talks about it as a 'Warrior Rabbit' (a comparison for Ubuntu's fight over marketshare I guess), jaunty can have the meaning of 'happy' or 'careless', hence, a Jaunty Jackalope, or a happy rabbit with antlers, or similar.

According to Mark Shuttleworth, 'Jaunty, the code name for what will most likely become Ubuntu 9.04, will be the focus of our efforts from November through to April next year.'

Let's hope for a good and (if possible) almost bug-free release.

Opera 9.60 Beta 1 Released

The first beta release of Opera 9.6 was released today and it provides, as usual, packages for all the major distributions out there, including all Ubuntu versions and Debian Potato, Sarge and current stable, Etch. The last stable release is still 9.52.

Opera is a powerful and full-featured web browser which provides good support for Linux, but unfortunately it is closed-source. It includes by default an IRC and BitTorrent client, a cool interface, widgets, a nice approach by using tabs for most of its features, like the download manager, a speed dial page for previewing several web addresses in a single tab. And these are to mention just a few.

Opera 9.6 Beta 1 running on Kubuntu 8.04

You can download Opera 9.6 Beta 1 from the official website, here. According to the changelog on the official website, the main changes since 9.52 are:

- preview RSS/Atom feeds before subscribing
- a low bandwidth mode for mail accounts, POP and IMAP protocols
- several interface changes
- several bugs fixed regarding the interface and scripting

In order to install it on Debian or Ubuntu, download the .deb package which matches the version of the distribution and type, for example:

For Ubuntu 8.04 Hardy Heron:

sudo dpkg -i opera_9.52.2091.gcc4.qt3_i386.deb

For Debian Lenny:

su
dpkg -i opera_9.52.2091.gcc4.qt3_i386.deb

License agreement after starting Opera for the first time

To uninstall Opera, just issue one of the commands below:

For Ubuntu 8.04 Hardy Heron:

sudo dpkg -r opera

For Debian Lenny:

su
dpkg -r opera

Updated: Sep 11, 2008