Category: General
Posted by: Rik
Let's say you have a few LCD monitors connected to a network monitoring system which is always on. But you're almost never at the office outside working hours. And you don't want to turn those monitors on and off every time you enter or leave.

Enter in crontab:


00 8 * * 1-5 user xset dpms force on -display :0
00 18 * * 1-5 user xset dpms force off -display :0


"user" should be the user under whom the X server is running.

From now on, the screens are only on from Monday to Friday, 8am to 6pm.
Category: General
Posted by: Rik
This might be useful when you run VPSs on Xen and you want to force IP addresses. After all, a duplicate IP can seriously harm your network. You need arptables for this.

This works on Xen 3.3.1.
For Fully virtualised VMs you should use the "tap[ID].n" interface, for paravirtualised VMs the "vif[ID].n".

Check the VM ID with "xm list" and run (e.g. for a Windows VM with ID 21):
arptables -A FORWARD -i tap21.0 -s ! 192.168.2.3 -j DROP

This forces the VM to use IP 192.168.2.3. ARP packets containing any other IP from that interface are being ignored.
I wrote a small python script to do this automatically for all VM's, I might upload it sometime.

You could also use vlans (obviously better if your switch supports trunking them).
Category: General
Posted by: Rik
I have a Nokia N95 8GB, and it's nice to have Internet access everywhere. It's even better to use it as a modem for your notebook.
Of course you can use an USB cable to dial into your phone, but an USB connection drains your N95's battery (and propably more than using Bluetooth).

I used the following site as a guide: Using a N95 as a modem with Kubuntu.

There are some problems with this setup: The channel number of the phone's dial up service tends to change, and the Linux bluetooth stack needs some restarting. Also, I'm not using wvdial but KDE's graphical dialer KPPP.

I wrote a little shellscript that looks up the phone's channel number for the Dial-Up Networking, writes it to rfcomm.conf and fires up KPPP. Run the script as a user with sufficient privileges (I use: sudo sh n95.sh). You need to create a modem and a profile in KPPP, which is very easy. Of course, you can use wvdail instead of KPPP - just see the above url.

#!/bin/bash

# Loads bluetooth module for Toshiba notebook
echo "Loading bluetooth module"
modprobe omnibook

echo "Restarting bluetooth stack"
/etc/init.d/bluetooth restart

while [ "$CHANNEL" = "" ] ; do
echo "Trying to get channel nr..."
sleep 2
CHANNEL=`sdptool browse YOUR-PHONE-MAC-ADDRESS | grep -A 7 "Dial-Up" | tail -n1 | cut -f6 -d' '`
done
echo "Channel nr. is: " $CHANNEL

sed -i '/ channel/ c\ channel '$CHANNEL';\' /etc/bluetooth/rfcomm.conf
echo "Written to rfcomm.conf."

echo "Restarting bluetooth stack"
/etc/init.d/bluetooth restart

echo "Starting kppp"
kppp -c GPRS -m "N95 Bluetooth"

echo "Removing bluetooth module"
rmmod omnibook


It's not a very fast connection, but fast enough for SSH and simple webbrowsing.
Category: General
Posted by: Rik
Areca has pretty good Linux support and drivers, but unfortunately the current Debian kernels contain outdated drivers which don't support recent cards like the ARC-1200. This means the kernel on the netinstall CD doesn't recognize some cards, so you can't install Linux. I used a workaround.

28/07/08: you can save some work and download the kernel module for the Debian 4.0 netinst R3 here. I also provide the x86-64 version.

The drivers are called "arcmsr". What I did was this:

- Install Debian Etch on some other machine, like a virtual machine somewhere.
- Install the same kernel headers as the installer on the Debian Etch install CD (linux-headers-2.6.18-6-486 for the i386 cd).
- Get the latest Areca drivers from their FTP. I used these.
- As you can read in the release notes, add the following to /lib/modules/2.6.18-6-486/build/include/linux/pci_ids.h:

#define PCI_DEVICE_ID_ARECA_1200 0x1200
#define PCI_DEVICE_ID_ARECA_1201 0x1201
#define PCI_DEVICE_ID_ARECA_1202 0x1202


- Run
make -C /lib/modules/2.6.18-6-486/build/ CONFIG_SCSI_ARCMSR=m SUBDIRS=$PWD modules

- Make sure you are in the Debian installer in expert mode, and execute a shell.
- Copy arcmsr.ko to the running installer machine, eg by uploading it somewhere and downloading it using wget. Move it to /lib/modules/2.6.18-6-486/kernel/drivers/scsi/arcmsr/ .
- Load the module using "modprobe arcmsr".
- Get out of the shell. You should be able to detect the disks and install Debian on them.

The next step is to prepare a kernel with the areca driver built-in. You can do this by installing the base system, entering the shell again, mounting the root filesystem and chrooting into it. Pick any "Compiling kernels the debian way" guide to see how to do this. The readme file in the Areca driver package contains instructions on how to compile the drivers in.
Category: General
Posted by: Rik
I recently bought a new neat small notebook with a 13.3" screen, the Toshiba Satellite Pro U400 (U400-10D). Since it was just released when I bought it, I didn't know which hardware would be supported in this notebook. It turns out, almost everything works out of the box on (K)ubuntu 8.04.

It can run 2 hours on the battery while using WiFi (CPU scaled on Dynamic). I bought a high-capacity (9 cell) battery, which I can run ~5 hours on (low brightness, wifi on, CPU scaled down). The CPU contains Intel-VT and I use VirtualBox to run Windows inside of Kubuntu. I use a normal 32 bit kernel, I didn't try a 64bit version.

See the full specs of this notebook Here.

If you have any questions, please post a comment.

Also check this document by Tim Richardson: Ubuntu Hardy 8.04 on Toshiba Satellite U400

First things first, console outpt:

lspci
00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03)
00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03)
00:1c.5 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 6 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)
00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03)
00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03)
07:00.0 Ethernet controller: Marvell Technology Group Ltd. Unknown device 436c (rev 16)
08:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)
0a:01.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02)
0a:01.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02)
0a:01.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01)


lsusb (for built-in webcam)
Bus 007 Device 002: ID 04f2:b064 Chicony Electronics Co., Ltd
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000


So here's what works and doesn't:
- Screen: works out-of-the-box on ideal resolution. It's quite fast; I can enable all kinds of neat useless graphical effects in KDE, without enabling crashy Composite in X.org. Use the "intel" X.org driver.
- Suspend to RAM: works great out-of-the-box
- Suspend to Disk (Hibernate): works out-of-the-box, but is kinda slow. Sometimes fails.
- Built-in WiFi: works out-of-the-box, including WPA authentication stuff.
- Built-in modem: not tested, we have broadband here :)
- Built-in webcam: works out-of-the-box
- Dual CPU, scaling stuff: works great out-of-the-box
- Sound: Intel HDA works out-of-the-box
- Volume/brightness buttons: works out-of-the-box, volume button stopped working somehow.
- Card reader: not tested yet
- USB2: works of course
- CDROM: works of course, didn't burn anything yet.
- Firewire: not tested yet, I don't have Firewire hardware
- Expresscard: not tested yet, I don't have expresscards
- LAN: works out-of-the-box
- ACPI stuff like seeing juice left in de battery, seeing if the power adapter is connected: all works out-of-the-box, pretty well
- Bluetooth: Works, although not out-of-the box.
Please read the comments for more info.
- Touchpad: works.



TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones


Linux On Laptops

24/05: About

Category: General
Posted by: Rik
Welcome to my weblog (or "blog"). I'm not really into blogging. It set up this site to be able to host some writings about technology (and maybe other stuff) now-and-then.

So, I'm Rik, 20 years old as of now (2008), and living in The Netherlands. I study IT in Utrecht and work as a (mainly GNU/Linux) server administrator in Rotterdam. I write some Python and PHP code now and then.
 
buy viagra cheap cialis Dooley