Friday, August 29, 2008

HowTo: Widescreen resolutions on Enemy Territory

One of the most often technical questions posed on ET servers are "How do I get ET to use a widescreen resolution?" "I have an new monitor but ET sucks on it. How do I fix it?".

ET, Quake 3, SOF2, RTCW, RTCW-demo and Tremulous use the same game engine, more precisely Quake 3's engine. So the bellow instructions also apply to those games.

Assuming you using a 19" monitor with a native resolution of 1440x900, add the following cvars to your autoexec.cfg:
set r_mode "-1"
set r_customwidth "1440"
set r_customheight "900"
If your want a different resolution change the r_customheight and r_customwidht accordingly, e.g. on a 22" monitor with a native resolution of 1680x1050 you'd get r_customwidth "1680" and r_customheight "1050".

In alternative type the above commands in ET's console. Pull the console by pressing \ on an European keyboard or press ~ if you are using an US keyboard (or run the game under Linux or BSD).

When typing on the console make sure that there is a \ before typing or else when you hit enter it will come out as global chat instead of a command. Also when using the console there is no need for set or the ". A simple vid_restart command will get you up and running with the new resolution.

In a future post I'll explain the purpose of autoexec.cfg which is one of the cornerstones of setting up a proper config and scripting.

Happy frags. :D

Monday, August 25, 2008

Tip: Getting flash (YouTube) to work on OpenSUSE 11.0 KDE 3.5.9

During my vacations I decided to install OpenSUSE's KDE (3.5.9) flavor on my desktop.

My laptop is running OpenSUSE (Gnome flavor) since 11.0 came out and I must that it impressed me. So having liked the Gnome environment I decided to install KDE 3.5.9 starting from the net install disk.

Surprisingly when I fired up Firefox and pointed to YouTube I came across a warming telling me that I didn't have the flash plugin installed.

Here's how to fix the issue:

First make sure that you have the Non-OSS repository enabled.
  • $ su
  • # zypper lr
If the list doesn't contain the Non-OSS repository add it by:
  • # zypper ar http://download.opensuse.org/distribution/11.0/repo/non-oss/ non-oss
To install the flashplayer package:
  • # zypper in flashplayer-player
Now fire up Firefox and happy YouTube browsing.

Saturday, August 16, 2008

HowTo: Codecs and DVD support for Debian Lenny

In this time and age we can't "survive" without multimedia support in our personal computers. To help those struggling to get codecs and DVD support under Debian Lenny I've compiled a series of steps to follow.

Let's start be becoming superuser:
  • $ su
Next we add the needed repositories to sources.list:
  • # echo "deb http://debian-multimedia.org/ lenny main" >> /etc/apt/sources.list
  • # echo "deb-src http://debian-multimedia.org/ lenny main" >> /etc/apt/sources.list
  • # apt-get update
Now let's get the gpg key for the repository:
  • # wget http://debian-multimedia.org/gpgkey.pub -O - | apt-key add - && apt-get install debian-multimedia-keyring
If the above step fails, do the following as alternative:
  • # exit
  • $ cd ~
  • $ wget -c http://www.debian-multimedia.org/pool/main/d/debian-multimedia-keyring/debian-multimedia-keyring_2007.02.14_all.deb
  • $ su
  • # dpkg -i debian-multimedia-keyring_2007.02.14_all.deb
After getting the key we move onto updating the database:
  • # apt-get update
Install the codecs and DVD support packages:
  • # apt-get install w32codecs libdvdcss2
If you plan on watching YouTube movies on Firefox I'd suggest:
  • # apt-get install flashplayer-mozilla
Finally we need a movie player. Here you have several options raging from Mplayer (my favorite) to VLC. Choose one and install it or try them all ;):
  • # apt-get install mplayer
  • # apt-get gnome-mplayer
  • # apt-get install smplayer
  • # apt-get install vlc
  • # apt-get install kaffeine
And we're done.

Resources:
http://debian-multimedia.org/faq.php
http://vivapinkfloyd.blogspot.com/2008/07/how-to-install-codecs-and-dvd-support.html

HowTo: Creative Audigy 4 under FreeBSD

The snd_emu10kx driver provides support for Creative SoundBlaster Live! and Audigy sound cards, namely for Audigy 4.

Assuming that you are running FreeBSD 7's generic kernel it's simply a matter of loading the driver as a module at boot time.

To do so :
  • % su
  • # echo 'snd_emu10kx_load="YES"' >> /boot/loader.conf
If you are planning on compiling your own custom kernel, place the following lines in your kernel configuration file:
device sound
device snd_emu10kx
Just to be sure if the sound driver was correctly loaded run:
  • % cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
Installed devices:
pcm0: on emu10kx0 [MPSAFE] (4p:1v/1r:1v channels duplex default)
pcm1: on emu10kx0 [MPSAFE] (1p:1v/0r:0v channels)
pcm2: on emu10kx0 [MPSAFE] (1p:1v/0r:0v channels)
pcm3: on emu10kx0 [MPSAFE] (1p:1v/0r:0v channels)
pcm4: on emu10kx0 [MPSAFE] (1p:1v/0r:0v channels)
To setup sound output levels for various audio sources and frequency ranges you can use the FreeBSD mixer. To display the current mixer values do the following:
  • % mixer
Mixer vol is currently set to 75:75
Mixer pcm is currently set to 75:75
Mixer speaker is currently set to 75:75
Mixer line is currently set to 75:75
Mixer mic is currently set to 0:0
Mixer cd is currently set to 75:75
Mixer rec is currently set to 0:0
Mixer igain is currently set to 0:0
Mixer ogain is currently set to 50:50
Mixer line1 is currently set to 75:75
Mixer line2 is currently set to 0:0
Mixer line3 is currently set to 0:0
Mixer dig1 is currently set to 0:0
Mixer dig2 is currently set to 0:0
Mixer dig3 is currently set to 0:0
Mixer phin is currently set to 0:0
Mixer phout is currently set to 0:0
Mixer video is currently set to 75:75
Recording source: mic
To change mixer values you can type mixer followed by the name of the device and the desired level. If you wanted to change the CD output volume to 95 percent on left channel and 85 on the right channel:
  • # mixer cd 95:85
And were all done.

If you want additional information on the driver take a look at snd_emu10kx and mixer's man pages.

HowTo: Logitech MX518 under FreeBSD

I have both a Logitech MX500 and a MX518. Being an Enemy Territory old timer I need to make full use of the MX518 mouse under FreeBSD, which means having the Back, Forward and the other weird button below the wheel working.

The bellow xorg.conf settings were tested under FreeBSD 7.0 and X.Org X Server 1.4.2.
  • % su
  • # vim /etc/X11/xorg.conf
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "Buttons" "10"
Option "ZAxisMapping" "4 5"
Option "ButtonMapping" "1 2 3 6 7 8 9 10 4 5"
Option "Emulate3Buttons" "false"
EndSection
With these settings you're free to bind MOUSE4, MOUSE5 and KP_EQUALS to Enemy Territory.

The sensitivity buttons work as their intended purpose: change the sensitivity on-the-fly. It was possible under Windows XP to change their behavior and bind them to keyboard keys however I'm not aware of how to do this under a *NIX system.

As a bonus, you can now use the Back and Forward buttons under Opera.

HowTo: Musicpd (Music Player Daemon) on FreeBSD

MPD stands for Music Player Daemon. It is made to control music through a very unique way. MPD has support for MP3, Ogg, FLAC, AAC, Mod, and wav files.

Let's proceed with the steps needed to install musicpd from ports:
  • % su
  • # cd /usr/ports/audio/musicpd ; make install clean
  • if you want select additional audio formats such as AAC and MOD files
Now let's move onto the configuration by copying the port's supplied example and editing from there:
  • # cp /usr/local/share/doc/mpd/mpdconf.example /usr/local/etc/mpd.conf
  • # chmod 644 /usr/local/etc/mpd.conf
  • # vi /usr/local/etc/mpd.conf
music_directory "/mnt/music"
playlist_directory "~/playlists"
db_file "~/database"
log_file "~/log"
error_file "~/error"
pid_file "~/pid"
state_file "~/state"
user "musicpd"

port "6600"
bind_to_address "127.0.0.1"

audio_output {
type "oss"
name "OSS"
}
To prevent MPD running as root we can setup a new user (musicpd):
  • # adduser
Username: musicpd
Full name: Music Player Daemon
Uid (Leave empty for default):
Login group [musicpd]:
Login group is musicpd. Invite mpd into other groups? []:
Login class [default]: daemon
Shell (sh csh tcsh bash rbash nologin) [sh]: nologin
Home directory [/home/musicpd]:
Use password-based authentication? [yes]: no
Lock out the account after creation? [no]: yes
Username : musicpd
Password :
Full Name : Music Player Daemon
Uid : 1002
Class : daemon
Groups : musicpd
Home : /home/musicpd
Shell : /usr/sbin/nologin
Locked : yes
OK? (yes/no): yes
Add another user? (yes/no): no
Goodbye!
  • # mkdir -p /home/musicpd/playlists
  • # chown muiscpd:musicpd /home/musicpd/playlists
To start MPD at boot time:
  • # echo 'musicpd_enable="YES"' >> /etc/rc.conf
Finally we start MPD and create the database:
  • # /usr/local/bin/mpd --create-db /usr/local/etc/mpd.conf
Now that we have the daemon up and running we need to put it to good use. I use the NCMPC client for the job.

To install NCMPC from ports:
  • # cd /usr/ports/audio/ncmpc ; make install clean

Wednesday, August 6, 2008

Book Review: SUSE Linux Toolbox

I like reading and I like Linux/BSD/Unix. So when I hop to the bookstore I have a tendency to check out any book related to Unix-like operating systems.

In the past Monday I came across SUSE Linux Toolbox on the Linux section. As the Linux section is always very small it caught my attention and decided to flip a couple of pages.

As I picked up the book I thought "A book for dummies, full of stupid GUI screenshot with no depth I bet". Well I couldn't be more wrong!

As flipped through I was amazed: the book was entirely focused on the CLI on a very straight to the point fashion. It was love at first sight and I ended up spending about 15 minutes in the bookstore reading a couple sections/topics.

My girlfriend was also checking out a book and as we were leaving she gazed upon my sad face as I took the book back to the shelf and suggested that I should buy it. I just thought "It's a book about SUSE and that's not exactly my favorite distro" so decided to place it back in the shelf. As I got there the bookstore guy had just finished re-arranging the shelf and there wasn't any room where the book originally was. It was destiny: I just had to buy the book!

So I did. For the past days I've gone through 4 of its 14 chapters and read several sections/topics of a couple more chapters and so far haven't come across a single incongruence.

It really is a great book and a wonderful purchase.

I've been running Linux for about one and a half years and gone through distros such as Debian, Gentoo, OpenSUSE, Ubuntu, PCLinuxOS and on the BSD side FreeBSD. I know my way around, I'm no guru but nor am I a newbie, and SUSE Linux Toolbox fits like a glove to anyone who enjoy tinkering with their system and learning.

The book contains tons of information that aren't distro specific while identifying SUSE only things such as the zypper's use on chapters 1 and 2.

Chapter 3 is all about the shell and how to use it. Chapters 4 and 5 expand on subjects like working with files and manipulating text.

From chapter 7 onwards it focuses on my main area of interest which is administration and does a damn good job at it in my humble opinion.

To sum up, great buy for anyone into Linux, CLI and widely applicable to any other distro. I for one am glad of the purchase.

On a final note there are 2 other books on the series: Ubuntu Linux Toolbox and Fedora Linux Toolbox.