Tuesday 28 February 2012

Running X applications as root

Sometimes there is a need to run some rubbish graphical installer on your Debian system (e.g. Matlab). If we try:
sudo installer

we get an error:
Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

To fix it we need tell the xserver to accept connections from other users before we start the installation:

xhost +
sudo installer

and now it works fine!

Wednesday 22 June 2011

nVidia proprietary drivers

As at June 2011 the recommended way to install nVidia drivers in Debian is to use the packages nvidia-glx + nvidia-kernel-dkms. The dkms package is triggered automagically every time linux headers are installed - and makes sure the kernel module is up to date (I don't really understand this in greater detail, because it works fine :)

So to make sure the drivers are installed with the current and future kernels you have to:
aptitude install linux-headers-2.6-686-pae nvidia-glx nvidia-kernel-dkms
where linux-headers-2.6-686-pae package will pull the latest headers, when a new kernel is installed.

Tuesday 12 April 2011

Connecting to samba printers

To connect to a samba printer you have to install the samba client first:

aptitude install smbclient

Next you just create a new printer (e.g. using the web frontend for samba - localhost:631). From the list of connection types select:

Windows Printer via SAMBA

If its not in the list then you are missing some packages. Enter the connection url in the format:

smb:///username:password@server/printer

The last thing to do on the following screen is to select appropriate driver.

Usually, especially in a big organization you want to use the short windows names to connect to resources. To make it work samba needs to be a WINS client. In the samba configuration file
(/etc/samba/smb.conf) uncomment and correct the line:

wins server = 155.198.63.69

The above example is the Imperial College wins server.

Monday 11 April 2011

Wpa_supplicant

To configure wpa_supplicant with the standard Debian ifupdown system one has to add the
wireless interface to /etc/network/interfaces file in the folowing way:

allow-hotplug wlan0
iface wlan0 inet manual
        wpa-driver wext
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

Next you can copy a decent template for the config file:

mkdir /etc/wpa_supplicant
copy /usr/share/doc/wpasupplicant/examples/wpa-roam.conf /etc/wpa_supplicant/wpa_supplicant.conf

And you need to add your network according to the examples in the file. More examples are in the
/usr/share/doc/wpasupplicant/examples folder.

After a new network is added to the wpa_supplicant.config file one needs to tell the daemon to refresh the list:

wpa_action wlan0 reload

Samba shares

It is fairly easy to set up samba shares using one of the graphical tools (i.e. Dolphin).
However, it took me a while to figure out that you actually need to create a separate
samba password for the user that will connect to the share:

smbpasswd my_username