Archive for December, 2007

My changeConfiguration.sh script to change single- and dual-monitor and network configurations

Monday, December 31st, 2007

My old notebook Fujitsu-Siemens Lifebook S7010 drove an Intel graphics card whose driver wasn’t able to detect the plugging of external monitors. So I wrote a little script to switch my xorg.conf file:

#!/bin/sh
if diff /etc/X11/xorg.conf /etc/X11/xorg.conf.single >/dev/null 2>&1
then
sudo cp /etc/X11/xorg.conf.dual /etc/X11/xorg.conf
echo 'monitor: dual'
else
sudo cp /etc/X11/xorg.conf.single /etc/X11/xorg.conf
echo 'monitor: single'
fi

It is also possible to switch between different network configurations. The reason for me was that I was able to use LAN in the office and use WLAN at home. Just append this to your changeConfiguration.sh:

if diff /etc/network/interfaces /etc/network/interfaces.home >/dev/null 2>&1
then
sudo ifdown eth0
sudo ifdown eth1
sudo cp /etc/network/interfaces.office /etc/network/interfaces
sudo ifup eth0
sudo cp /etc/resolv.conf.office /etc/resolv.conf
echo 'network: office'
else
sudo ifdown eth0
sudo ifdown eth1
sudo cp /etc/network/interfaces.home /etc/network/interfaces
sudo ifup eth1
sudo cp /etc/resolv.conf.home /etc/resolv.conf
echo 'network: home'
fi

Now, how does this work? First, create configuration files for each setup in the appropriate folders. In the first example it is /etc/X11/xorg.conf.single and /etc/X11/xorg.conf.dual, in the second example it is /etc/network/interfaces.office, /etc/network/interfaces.home, /etc/resolv.conf.home and /etc/resolv.conf.office. Put your configuration into these files.
This is no catch-it-all-script, you have to switch to another terminal screen (e.g. Ctrl + Alt + F2) and call the script: sh changeConfiguration.sh. It will tell you if you are driving single- or dual-screen and which network configuration you’ll use. Restart your X-server after calling.

Give wicd a try (network-manager alternative)!

Monday, December 31st, 2007

Setting up an Ubuntu the first time, I always struggled with the network-manager, because it wasn’t able to establish a connection with a fixed gateway address. I have an old – hmm let me say disabled – router from Siemens where it is not possible to use DHCP because it doesn’t provide the gateway address. So my only chance to get wireless lan to work was to provide the correct ips manually in ubuntu’s configuration files, and do a sudo ifconfig down eth1 and sudo ifconfig up eth0 to switch between WLAN and LAN. Really annoying!

Just for the case you are interested in configurating your network manually, this are the two files where the magic happens: /etc/network/interfaces and /etc/resolv.conf

But without any regret I can recommend wicd. This tool is so handy I am wondering why it isn’t the default network-manager in Ubuntu! Just add the repository deb http://apt.wicd.net gutsy extras to your sources.list and install it via sudo aptitude install wicd. I am running the current testing release 1.3.8 from 02. Dec 2007 and it’s working fine!

Get Ctrl + left and right in firefox’ address bar to work on Linux!

Monday, December 31st, 2007

Especially for people coming from Windows it may be confusing to see the address bar not behaving the same way on linux it does on Windows. On Windows you are able to jump to stop characters like slash or dot with Ctrl + left or right. This is not the default on Linux. To enable this, just go to about:config and set layout.word_select.stop_at_punctuation to true. That’s all!

Another shot: The backspace behaviour is also different on Linux systems than it is on Windows. On Windows hitting the backspace is the same as history back, on Linux it is the same as page up. To change it to history back go to about:config and set browser.backspace_action to 0. Groovy!