Archive

Archive for the ‘Tips and tricks’ Category

Wolfenstein Enemy Territory on FC6 x86_64 & ATI fglrx drivers

October 30th, 2006 No comments

Last week I upgraded my Acer Ferrari 4005 laptop to Fedora Core 6. On rpm.livna.org I noticed that the ATI proprietary drivers where available too. I am not a supporter of proprietary solutions if there is a good Open alternative (good in the 2D sense only I’m afraid) but thought I try them too get a feel for the difference between the Open driver and proprietary one. Kudos to the Livna folks since they installed like a charm and worked right away. For some background info have a look at the Phoronix website.

With the fglrx drivers working it was time to see how fast it would go. Not being a gamer I don’t have any games so downloaded the free Wolfenstein: Enemy Territory (ET) demo. It took me way too long to figure out how to get ET going. The problem is that the game is x86 and not x86_64. So you need to do a couple of things to make it work:

0) I’m assuming here that you already have the x86_64 ATI proprietary drivers installed from rpm.livna.org
1) download the x86 version of the ATI proprietary drivers from the ATI website
2) make the directory: /usr/X11R6/lib32/modules/dri
3) make the directory: /usr/lib/ati-fglrx
4) from the rpm copy the files atiogl_a_dri.so and fglrx_dri.so to /usr/X11R6/lib32/modules/dri
5) from the rpm copy the files libGL.so.1.2 libfglrx_dm.so.1.0 libfglrx_gamma.so.1.0 libfglrx_pp.so.1 and libfglrx_tv.so.1.0 to /usr/lib/ati-fglrx
6) change to the /usr/lib/ati-fglrx directory
7) create a bunch of symlinks: ln -s libGL.so.1.2 libGL.so.1 && ln -s libfglrx_tvout.so.1.0 libfglrx_tvout.so.1 && ln -s libfglrx_pp.so.1.0 libfglrx_pp.so.1 && ln -s libfglrx_gamma.so.1.0 libfglrx_gamma.so.1 && ln -s libfglrx_dm.so.1.0 libfglrx_dm.so.1
8) change the ET startup script (“et”) to look like this:

#!/bin/sh
# Needed to make symlinks/shortcuts work.
# the binaries must run with correct working directory
cd “/home/patrick/et/”
export LIBGL_DRIVERS_DIR=/usr/X11R6/lib32/modules/dri
export LD_LIBRARY_PATH=/usr/lib/ati-fglrx:/usr/lib:$LD_LIBRARY_PATH:.
exec ./et.x86 “$@”

If all is well, ET should now start on your FC6 x86_64 box. Enjoy!

Update: it may be possible that the 32bit fglrx libs at rpm.livna.org are a much cleaner solution. I have not tried it. Keep in mind that you still need to change the “et” startup script as described above.

Howto: ndiswrapper, NetworkManager and WPA2 on Fedora Core 5

July 20th, 2006 No comments

An interesting article on linux.com gave me the last bit of info to get WiFi (or is it Wi-Fi?) with WPA2 working between my Acer Ferrari 4005 laptop and Speedtouch 716 ADSL modem. I run kernel 2.6.16-1.2080_FC5 and the Gnome desktop. I have not verified if this works with the latest 2.6.17-1.2157_FC5 kernel (update: seems to work reasonably ok with the latest FC5 kernel).

Here are the ingredients:

Ndiswrapper
Install ndiswrapper and configure it. The version I have is 1.18. I’m assuming you have the livna yum repo installed. If not get it from rpm.livna.org and install ndiswrapper with a simple “yum install ndiswrapper kmod-ndiswrapper”. Next get Acer’s 64bit WinXP WiFi driver here. Unpack the driver somewhere and import the driver into ndiswrapper with:

ndiswrapper -i bcmwl5.inf

Add the following lines to /etc/modprobe.conf:

alias eth1 ndiswrapper
options ndiswrapper if_name=eth1

I use “eth1″ as my WiFi interface. If you use another change accordingly. In case you run a recent FC5 kernel you also need to blacklist the bcm43xx module to prevent it from interfering with the ndiswrapper module. Add the following line to /etc/modprobe.d/blacklist:

blacklist bcm43xx

You can now manually load the ndiswrapper and check /var/log/messages if all went well. The messages I get in /var/log/messages are:

Jul 18 15:27:08 laptop kernel: eth1: ndiswrapper ethernet device 00:14:c4:92:34:6a using driver bcmwl5, 14A2:3246.2.conf
Jul 18 15:27:08 laptop kernel: eth1: encryption modes supported: WEP; TKIP with WPA, WPA2, WPA2PSK; AES/CCMP with WPA, WPA2, WPA2PSK

Wpa_supplicant
Install wpa_supplicant with:

yum install wpa_supplicant wpa_supplicant-gui

The version I have is 0.4.8 from updates-testing. It should become available as a regular update for FC5. If it’s not (yet) get it from updates-testing with:

yum –enable=updates-testing install NetworkManager

Once installed create or modify /etc/wpa_supplicant/wpa_supplicant.conf and make it look like this (so delete anything that’s different):

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1

network={
ssid=”name_of_your_access_point”
psk=”yourverysecretpassword”
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
}

Network services
Verify that NetworkManager, NetworkManager-gnome and NetworkManager-glib are installed. If they are not then install them with:

yum install NetworkManager

Make sure that the “network” service is disabled. Instead the “wpa_supplicant”, “NetworkManager” and “NetworkManagerDispatcher” services need to be run when you boot your box. You can easily turn off the “network” service and turn on the “wpa_supplicant”, “NetworkManager” and “NetworkManagerDispatcher” by executing from a terminal the command:

ntsysv –level 5

Configure the eth1 network device
Start system-config-network and add a new wireless device by clicking on “New” then click on “Wireless connection”. Click on the ndiswrapper entry followed by “Forward”. On the next page make sure “Mode” shows “Managed”. On the line with “Network name (SSID)” click on “specified” and enter the name of your Access Point. This name should be the same as you specified in the wpa_supplicant.conf file. Leave the rest as is and click “Forward”. On the next page select DHCP or enter a static IP address and click “Forward”. On the final page check the settings and if all is ok click on “Apply”. Save the setup by clicking on “File” -> “Save” or just press Ctrl+S.

Testing your setup
Make sure the ndiswrapper module is loaded, manually stop the network service with:

/sbin/service network stop

Next make sure that the LAN cable is removed from the laptop (if you have any attached). Then start wpa_supplicant, NetworkManager and NetworkManagerDispatcher with:

/sbin/service wpa_supplicant start
/sbin/service NetworkManager start
/sbin/service NetworkManagerDispatcher start

If all goes well you should now see a successful authentication using WPA2 and the assigment of an IP address to the laptop via DHCP. Enjoy!

Categories: Tips and tricks Tags:

Secure remote folders with fuse and sshfs

July 6th, 2006 No comments

Install the SSH filesystem rpm called sshfs:


[root@server ~]# yum install sshfs

Now add the users to the fuse group that are allowed to use this neat trick. In this example I’ll add myself to the fuse group:


[root@server ~]# usermod -G fuse patrick

Load the fuse module:


[root@server ~]# modprobe -v fuse

Make the directory where you want to mount the remore folder using sshfs:


[root@server ~]# mkdir /home/patrick/remotefolder

Mount the remotefolder:


[root@server ~]# sshfs me@server:/localfolder /home/patrick/remotefolder

You can now work transparantly in the /home/patrick/remotefolder. When you are done and want to unmount the folder all you need to do is:


[root@server ~]# fusermount -u /home/patrick/remotefolder

You can also add the remotefolder to /etc/fstab:


sshfs#me@server:/localfolder /home/patrick/remote_folder/ fuse defaults,noauto 0 0

The fuse module should be loaded automagically. If it doesn’t load it manually with:


[root@server ~]# modprobe -v fuse
Categories: Tips and tricks Tags:

Preventing the accidental rm -rf /

July 6th, 2006 No comments

Eons ago when I started to explore Linux and F/OSS as an enthousiastic newbie, I made the mistake, twice, of accidentally typing in:


[root@server ~]# rm -rf /

While what I actually wanted to do was:


[root@server ~]# rm -rf ./

The consequences of such a mistake are severe since you literally deleted the entire filesystem. To prevent this from happening there is a neat little trick:


[root@server ~]# touch -- /-i

When you (accidentally) try to delete the root filesystem / you will be asked by the rm command to confirm your action. This way there is a safety that prevents you from deleting the root filesystem without any questions asked.

Categories: Tips and tricks Tags: