Monday, March 9, 2009

Installing Quake 4 in Linux

Quake 4 is the fourth title in the series of Quake first-person shooter computer games. Although the game is well known in Windows enviroments, it is possible to play this game in Linux without using Wine.

To start installing it, we have to download the installer from id Software's ftp server or from BitTorrent tracker.

To install it, we'll execute the binary file
$ sh quake4-linux-1.4.2.x86.run


Is not necessary to execute it as root. Like a normal user, the game will be installed in ~/quake4/ folder, and will create a game shortcut link in ~/bin/ called quake4. To add the ~/bin/ folder to the PATH enviroment variable, we'll add the next line to the ~/.bashrc file:

Editing enviroment variableexport PATH="~/bin:$PATH"


Now, we can execute 'quake4' command anywhere in the console, but we get this error:

Error********************
ERROR: Couldn't load scripts/main.script

********************
Sys_Error: Error during initialization
pure virtual method called
terminate called after throwing an instance of 'idException'


This happens because we need the full game to copy some '.pk4' files to ~/quake4/q4base/ directory. So, if we don't have the full game, we can download it from The Pirate Bay or from a search in Torrentz. After downloading the game, if it is a iso file, we will mount it:
Mounting Quake4.iso and copying necessary filesmount -o loop Quake4.iso /mnt/cdrom
cp -r /mnt/cdrom/Setup/Data/q4base ~/quake4/q4base/


Now, that all files have been installed we can start playing, executing 'quake4' in the console. But, the game ask us to type the CD key. Although we insert a valid CD key, it is validated against internet servers. So, to avoid this we will edit the /etc/hosts file:

Editing /etc/hosts to add two dns names127.0.0.1       q4master.idsoftware.com
127.0.0.1 idnet.ua-corp.com


Now, if we execute the game and insert a valid CD key, the game will try to validate the key against our computer unsuccesfully. So now we can play the game. Another way to avoid this problem is switching off the net card. In any way, we cann't play in multiplayer mode, but play in history mode.

Monday, March 2, 2009

Create an image of Audio CD

The 'dd if=/dev/cdrom of=cdrom.iso' doesn't work to create an image of Audio CD, because Audio CD's doesn't have file system. So, the command we have to use is:

$ cdrdao -read-cd --datafile audiocd.bin audiocd.toc

In the audicd.bin will be the real Audio CD. The audiocd.toc (TOC = Table Of Content), describes what data is written to the CD-R. To write the Audio CD image we'll use the command:

$ cdrdao write audiocd.toc

If you want to copy cd the CD, using one command:

$ cdrdao copy --device /dev/cdrom

The image file with name "cddata.bin" will be created in the current working directory, but the image will be removed after it has been written.