Categories
Linux / Gentoo Linux

KDE4: Launching screensaver from commandline or shortcut

Remember the good old days of KDE3? It was so easy to start your favorite screensaver by hand: simply invoke dcop and there we go. But since the dcop framework is no longer part of KDE4 I found myself without a hint of how to create a shortcut to trigger the screensaver.

Until now… use the following commands to lock the screen with the screensaver running or display the screensaver without locking:

qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock

qdbus org.freedesktop.ScreenSaver /ScreenSaver SetActive 1

I hope this helps others as it took me too long to find this…

Categories
Linux / Gentoo Linux

Migrating from VMware Server to KVM on Ubuntu

After being let down by VMware one too many times (this time after upgrading Ubuntu to the latest beta and finding out that kernel 2.6.30+ is not supported), I decided to move on to KVM. After all, my server has full visualization support in the CPU so why not put that to good use.

I’ve started off by making sure visualization support is enabled in the BIOS. In my case it was nowhere to be found and a quick search for the MSI KA780G (MS-7551) showed that users had varying experience finding the feature but everyone seemed to agree that a BIOS upgrade should help (most of the time). A quick ‘lshw’ showed that I indeed was using the 16.0 version of the BIOS which is more than a year old.

Next, how to flash the BIOS? I do not (like the guide from MSI suggest) have a floppy drive installed in my server nor do I have Windows installed. Luckily, updating the BIOS of the KA780G is pretty easy as it is supported by the Linux programmer ‘flashrom’:

apt-get install flashrom
flashrom
flashrom -r backup.bin
flashrom -w newbios.bin

Warning: the last command actually programs the new BIOS into your computer. Make sure you have the right BIOS for your motherboard and do not interrupt the flashing.

Categories
Linux / Gentoo Linux

VMware Server 2.x on Ubuntu 9.10 (Karmic Koala)

Many have taken the plunge and updated to the new Ubuntu due for release late October: Ubuntu 9.10 code-name Karmic Koala. And even on my my 64-bit system pretty much everything updated without a hitch. Sure, I had to reinstall the nVidia drivers again for the new kernel but besides that – all was well.

Until I noticed my virtual machines were down. A manual start gave the dreaded ‘vmware is not configured for your system’ message and after invoking vmware-config.pl I found myself looking at some compile errors about the ‘vmmon’ module.

As usual, the guys at VMware haven’t released a single update for their free flag ship in half a year now. Hence they have no support for newer kernels found on Ubuntu 9.10 but also for example in Gentoo Linux.

Luckily, someone has put together a fix that you can find here. Basically it is a patch set derived from a long thread on a forum somewhere but hey – it does the job.

It does make me seriously consider moving to an alternative visualization platform like Xen or KVM which seems to be part of the kernels and as such will always work after an upgrade…

Update: this did not work for me. Either the virtual machine does not start at all and the control panel is broken as well or the entire system goes down with a kernel crash after a few minutes… Guess I am migrating to KVM after all, good bye VMware, it was fun while it lasted…

Categories
Linux / Gentoo Linux

Fixing Midnight Commander Locale errors

If you have a pretty recent Linux system like I have, you most likely have had the pleasure or the following message when starting mcedit:

Chosen display charset or source codeset does not match one set via locale.

You can then “Fix” it or “Skip” and choose to remember it. For me, fixing or skipping the dialog does not seem to do anything but that is most likely because I don’t use the charset completely (no ‘weird’ characters in my text files). Even worse, if you find it to do something — chances are you want to use the Fix option — and tick “Do not ask again”, the next time the file is broken again! This is because the tick box does not respect your choice but rather takes it as “Skip any problem detection in the future”…

Annoying as it may be, the real cause is the fact that you are most likely not using the correct character encoding on your system by default. Chances are, when you update your system you get this annoying “Generating code page” message a million times over. If so, you just generated support to view every text encoding known to man — good for you!

I on the other hand, will only view UTF-8 files and I’m not really interested in anything else. So I decided to reduce codepage support to 2 languages: Dutch and English. Note that the Dutch support in this case tends to translate messages in programs (ugh) but it also adds support for the Euro sign: ‘€’

Open up /etc/locale.gen and add the following lines:

1
2
3
4
5
en_GB ISO-8859-1
en_GB.UTF-8 UTF-8
nl_NL UTF-8
nl_NL@euro UTF-8
nl_NL.utf8 UTF-8

I cheated a bit by replacing the default ISO-8859-1 or ISO-8859-15 character mapping for Dutch with the UTF-8 one. It seems this choice is allowed and gives me proper UTF-8 support with the nl_NL locale.

Save the file and run locale-gen:

cyberxps ~ # locale-gen
* Generating 5 locales (this might take a while) with 1 jobs
*  (1/5) Generating en_GB.ISO-8859-1...   [ ok ]
*  (2/5) Generating en_GB.UTF-8...   [ ok ]
*  (3/5) Generating nl_NL.UTF-8...   [ ok ]
*  (4/5) Generating nl_NL.UTF-8@euro...   [ ok ]
*  (5/5) Generating nl_NL.UTF-8...   [ ok ]
* Generation complete

Looks familiar? Yes that is the dreaded locale generation but this time it only created the locales we will use meaning it completes in a second instead of 10 minutes… Run locale -a to make sure you got what you wanted:

cyberxps ~ # locale -a
C
en_GB
en_GB.iso88591
en_GB.utf8
nl_NL
nl_NL@euro
nl_NL.utf8
nl_NL.utf8@euro
POSIX

Now open up /etc/env.d/02locale and put the locale selection in and reload afterwards:

cyberxps ~ # echo 'LANG="nl_NL.utf8@euro"' >> /etc/env.d/02locale
cyberxps ~ # env-update >> source /etc/profile
>>> Regenerating /etc/ld.so.cache...
cyberxps ~ # export | grep LANG
declare -x LANG="nl_NL.utf8@euro"

All done, we switched to the new locale and mcedit can stop complaining now. As an added bonus each file you edit will be created in UTF-8.

Categories
Gentoo Linux

Fixing ‘interface claimed’ printing problems

After leaving my printer unused for some time I suddenly found myself unable to print to my Canon ip4300 printer (which is connected using USB and should be run by CUPS). Dmesg showed the following after powering up the printer:

usb 1-3.1: new high speed USB device using ehci_hcd and address 5
usb 1-3.1: configuration #1 chosen from 1 choice
usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x04A9 pid 0x10B6
usb 1-3.1: usbfs: interface 0 claimed by usblp while 'usb' sets config #1
usb 1-3.1: usbfs: interface 0 claimed by usblp while 'usb' sets config #1
usb 1-3.1: usbfs: interface 0 claimed by usblp while 'usb' sets config #1
usb 1-3.1: usbfs: interface 0 claimed by usblp while 'usb' sets config #1

The problem here is the USB Printer subsystem of the kernel called ‘usblp’. Some people might have it compiled into the kernel (like me – seemed like a good idea at the time) and others might have it as a module. If you have it as a module, unload it and blacklist it so it won’t be loaded automatically. Power cycle on the printer and it should suddenly become available to CUPS.

If you have it compiled in – like I had – recompile your kernel after disabling USB Printing. The device manager will pick it up if you connect it again so the printing subsystem can use it.

On a side note: it would have been nice to have a warning in the kernel description that using printing subsystems will not work properly if you use ‘usblp’…

Categories
How-To's

Adding PBXes.org to Nokia N95

So you want to use your Nokia N95 with the popular PBXes.org service to start using VOIP calls? You have come to the right place. Note that these instructions will most likely apply to all Symbian S60 phones, like the Nokia E65. Also note that in case of the N95, this even works for phones without a SIM card, making it possible to call with those phones as well!

In this article I assume that you already have a PBXes.org account and have set up an extension for your Nokia N95, if not please look at this guide.

Let create the SIP profile to connect to PBXes.org:

  1. Create the profile:

    1. Open the menu
    2. Open Tools
    3. Open Settings
    4. Select Connection
    5. Scroll down and select SIP Settings
    6. Click Options
    7. Select New SIP profile
  2. Set up the new profile:

    1. Select Use default profile
    2. Change the profile name to something familiar: PBXes.org
    3. Leave Service Profile set to IETF
    4. Set Default access point to your current Wifi network
    5. Set Public user name to myuser-800@pbxes.org where you substitute myuser for your account name and 800 for the extension number you created for this phone
    6. Leave Use compression set to No
    7. Set Registration to Always on to force the phone to connect to the SIP service when starting up (or leave it if you are not planning on using it all the time)
    8. Leave Use security on No
    9. Leave Proxy server empty
  3. Set up the registrar:

    1. Enter Registrar server
    2. Set Registrar server address to sip.pbxes.org
    3. Set Realm to pbxes.org
    4. Set User name to myuser-800 and substitute like before
    5. Set Password to the password you set on pbxes.org for this extension number
    6. Set Transport type to UDP
    7. Leave Port on 5060
  4. Set up internet calling:

    1. Click Back to return
    2. Click Back to return to SIP Settings
    3. Click Back to return to Connection
    4. Select Internet tel
    5. Click Options
    6. Select New profile
    7. Change the name if desired.
    8. Select the SIP profiles to use, if you only added PBXes.org it will be selected by default.
    9. Click Back to “Internet telephone”
    10. Click Back until you reach the “Tools” menu.
    11. Select Internet tel.
    12. Click Options.
    13. Select Connect to service

The phone will now connect to the Wi-Fi network you specified earlier and a globe with phone icon will appear showing that the registration was successful. When you want to call using the SIP account, use Options and Internet call to activate the SIP mode.

To switch to SIP calling by default do the following:

  1. Open the menu.
  2. Open Tools.
  3. Open Settings.
  4. Select Phone.
  5. Select Call.
  6. Scroll down and set Default call type to Internet call

Next time you will call a number it will use your SIP account automatically! (Note: if the SIP account fails – no Wi-Fi etc – the phone will switch back to normal calling modes).

Common pitfall: ‘Address not in use’ when you try to call a number (meanwhile you can receive calls fine). This happened to me because I did not specify a Default route for the newly added extension, after making the standard route truly global all was well.

Categories
General blog entries

Upgrading Windows 7 RC1 Ultimate to Windows 7 Professional RTM

Of course you can upgrade RC1 to RTM for Windows 7, except when you are running different versions of Windows…. but of course…

After browsing a bit I figured out that the switching between Windows 7 versions can only go in one direction: up. So when I installed Windows 7 RC 1 to replace my broken Windows Vista installation, I didn’t know which version I would get when the RTM was released so I did what everyone did: install Ultimate.

Fast forward 6 months and I am starting to miss the fixed features from the final version which us poor testers will not receive unless we go for the full monty and get the paid version.

So here I am, downloading all my programs and drivers again, hoping I am not forgetting a key component and just finishing my system backup in case things don’t work out as planned…

On a side note: I am doing this on a Dell XPS M1530 which came with a 32-bit version of Home Premium and which does not officially support Windows 7 (32 or 64-bit). Unofficially, everything works like a charm on Windows 7 RC 1 (build 7100) including the webcam, fingerprint scanner and the Intel 4950AGN card. I will report if the reinstallation to the final version went as flawless as the original installation.

Categories
Linux / Gentoo Linux

Debugging nVidia EDID resolutions

After installing an nVidia card into my HTPC I ran into a problem I never had before: the driver will not allow me to use the full 1280×720 resolution of my TV. After running xrandr on the console, I can confirm that Xorg reports the following supported resolutions:

Screen 0: minimum 320 x 240, current 720 x 480, maximum 1920 x 1080
default connected 720x480+0+0 0mm x 0mm
720x480        50.0*    51.0
680x384        52.0     53.0
640x480        54.0     55.0
512x384        56.0
400x300        57.0     58.0
320x240        59.0
480i/60        30.0
480p/60        60.0
720p/60        60.0
1080i/60       30.0
1080p/60       60.0

Now if you read the above closely, you can see that the display should have modes up to 1920×1080 (interlaced in my case but still). This proves that in fact the EDID information (which should allow your graphics card to auto-detect monitor properties) is coming through but that it is not working properly. Read on to solve this problem.

Categories
Linux / Gentoo Linux

Solving VMware HD trashing

VMware Server 1.x and 2.x are great for some quick and easy visualization. Granted, they lack some options their big brothers have (live migration for example) but overall they are fine. It is quite annoying to find one of your virtual servers trashing the IO on your host in such a way that all systems (virtual and physical) come crawling to a halt.

Note that I am not talking about actual throughput caused by a heavy loaded system. I am talking about a few hundred kilobytes to a few megabytes of disk throughput that manage to clog up the host system while the virtual system is not doing anything (no network activity, no CPU activity, no disk IO on the virtual side and still the host gets trashed).

It seems like the trashing can come from clashes between the memory manager of VMware and your virtual OS and/or the virtual drive controller and the guest disk driver. The result seems a looping ‘optimization’ which never ends and instead of speeding up the system, it completely grinds down to a halt.

The solution? Well there isn’t a clear cut solution to all the problems out there but so far this one seems to work for me. It tells VMware to allocate all the memory it could be needing (instead of allocating it when its needed) and disables the paging of memory completely (as everything fits in one go).

File /etc/vmware/config:

prefvmx.useRecommendedLockedMemSize = "TRUE"
prefvmx.minVmMemPct = "100"

Guest “.vmx” file:

sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"
MemTrimRate = "0"
MemAllowAutoScaleDown = "FALSE"
Categories
Programming

Tethering on Google Android without root access

So you want to tether your brand spanking new Android phone (Google G1 or HTC Hero or alike) but you don’t want to bother with rooting your phone. Bad news: you can’t (wireless), sort of – read on.

Well technically you can but it requires a USB cable connection to make the phone act like a modem device which Windows (or Linux) can then use to ‘dial’ to the world wide web. The HTC Hero comes with this functionality built in (it just requires some HTC drivers which even works on Windows 7, albeit with separate installation of the drivers as the setup fails), for the G1 and others you can install PdaNet on your Android phone to do the same.

So in fact you can tether your 3G connection to your computer using an Android phone, but you can’t do it wireless. Bluetooth is incomplete and as such wont give you a DUN device so no dice there. And for the wifi tethering tool, you really really need root access. Why? Because it switches your WiFi card in your phone from normal to router mode. This allows other devices to connect to it and use the 3G device as a gateway.

So why shouldn’t you root your phone (besides risking to brick your phone)? You can’t buy paid applications from the Android Market anymore. For some no reason to hack their phone, I prefer to have the option to keep using paid applications. Perhaps in the future I’ll try to root my HTC Hero and I will post my findings.

Update: I rooted my phone after owning it for a year or so and I was able to by and install paid applications just fine. I forgot where I read this tidbit of information but it seems to be rubbish – rooting does not prevent you from buying apps.