Archive for the ‘Karmic’ Category

Use Thunderbird’s addressbook to dial a Phone

March 2, 2010

Working in my home office a have a phone connected to my laptop. With a self written application I can dial this phone.

With Thunderbird 3 predecessors I used a modified version of the FireFox plugin Fritz!BoxDial to dial the phone.

With Thunderbird 3 this does no longer work.

Recently I read the feature list of the Thunderbird plugin MoreFunctionsforAddressbook see
https://nic-nac-project.org/~kaosmos/morecols-en.html.
and I found

option to have phone numbers like “callto” links

It works like a charme (0.5.6.4 with TB 3.0.1).

Give it a try !

Advertisements

Customizing Cups Default Printer using NetworkManager

February 16, 2010

Recently I discovered the scripting abilities of NetworkManager. I
finally wrote a very small script which calls lpadmin depending on my
current network environment.

NetworkManager looks for scripts in
/etc/NetworkManager/dispatcher.d. Currently I have:


lulu:/etc/NetworkManager/dispatcher.d> ls
01ifupdown 97customize-lulu

01ifupdown came with Karmic, 97customize-lulu is my new script.
NetworkManager calls the scripts in /etc/NetworkManager/dispatcher.d
with two arguments. If I e.g. plug in a patch cable with WLAN
disabled, the scripts will be run like so:


01ifupdown eth0 up
97customize-lulu eth0 up

In my 97customize-lulu, I figure out the current IPADDRESS using the
ip-command and a bit of perl. In a simple case I call lpadmin
appropriately. Finally I call logger to get some information in my
/var/log/messages.

When the script is called to unconfigure a nic, I umount all NFS and
CIFS based filesystems to avoid hanging IOs.

NIC=$1
ACTION=$2

case "$2" in
up)
IPADDRESS=`ip -o addr show $NIC | perl -ne 'if(/inet ([\d\.]*)\/\d\d/) {print $1, "\n";}'`
case "$IPADDRESS" in
192.168.178.*) lpadmin -d Home-HP-OfficeJet-G85
;;
172.26.0.74)
lpadmin -d Lab-X
;;
172.18.*.*) lpadmin -d Site-Foo
;;
esac
logger 97customize-lulu: NIC: $NIC ACTION: $ACTION IP: $IPADDRESS
;;
down)
umount -a -t nfs,cifs
logger 97customize-lulu: NIC: $NIC ACTION: $ACTION IP: $IPADDRESS RC$
;;
esac

Karmic: Happy with vmplayer, no longer searching the web for a any-any patch to get vmware-server running

December 19, 2009

For a couple of years I used vmware-server on my laptop. This was a hassle with all new kernels, as the vmware-drivers never built out of the box. It was always necessary to patch the driver sources to get them going.

I’m no kernel hacker and sometimes it was difficult to find the right patches on the web. At least once after a Ubuntu security kernel update the vmware-config.pl failed until I again managed to find a better (newer) patch.

Forget about this trouble. Use VMware Player 3.0.0. After a kernel update starting vmplayer gave me:

Hitting “Install” I got another screen informing me nicely about what was going on:

And I was done ! It simply worked !

But I forgot one important new feature of vmplayer 3.0.0: You can create new machines:

Karmic: ApacheDirectorStudio no longer usable and Workaround

December 2, 2009

I used ApacheDirectorStudio with sun-java5 without problems for at least a year. After changing to Karmic I installed sun-java6 and did a short test of ApacheDirectorStudio. I did not notice any problems.

Today I again ran ApacheDirectorStudio and this time I ran into trouble. No error message, but a button simply did not appear to work.

Being in trouble to do the real work done, I rebooted into my old Intrepid and did what had to be done.

Now I got a second to analyse the problem and finally found an hint on the Download page of ApacheDirectorStudio

Set

export GDK_NATIVE_WINDOWS=1

and then start ApacheDirectorStudio. Now the application works as expected. So the rootcause was not java6 vs. java5, but Gnome !

Karmic: Keyring + Figaro’s Password Manager 2 fpm2

December 1, 2009

IMHO gnome-keyring has all components for a password manager application. But AFAIK there is no such application using libgnome-keyring0 and gnome-keyring.

But I can’t live without. So I recently checked the Karmic repositories for suitable applications and finally decided to give fpm2 Figaro’s Password Manager 2 a try.

Since then I use fpm2 on a regular basis. It’s fast, it’s straightforward and there are some features I really like.

For each entry you can define a so called Starter-Application. If e.g. you want to put your Launchpad-account into fpm2, you would add https://launchpad.net/ as URL and Web as starter-app. BTW, the default gnome-moz-remote does not really make sense in Ubuntu, because this command is unknown. Simply change the Web starter to


/usr/bin/firefox $a

Click on User and the defined username will be inserted into the cut buffer. Paste it into the webform. Same procedure for password and you’re done.

Xfce 4.6: Change default settings to use workspaces more efficient

November 29, 2009

I use 10 workspaces to virtually enhance my screen’s size. My personal best practice is to have certain important applications on dedicated workspaces, e.g. thunderbird on no 2, firefox on no 3 and emacs on no 4.

If I get an email with an URL, clicking on that URL will bring up a new TAB in my running firefox. Unfortunately standard Xfce 4.6 in Karmic will switch the firefox window from workspace no 3 to the thunderbird workspace no 2.

I do not like this. I want the apps keep running on the workspace I started them on.

Finally I found this to make things work:


xfconf-query -c xfwm4 -p /general/activate_action -s switch

I really can recommend this – give it a try !

Karmic: Keyboard customizing w/o xmodmap

November 28, 2009

Using a german keyboard most of the time I have to press <Shift><7> to get a slash. Working in Unix this is not really convenient so I created an suitable .Xmodmap ages ago.

This worked rock solid until evdev was rolled out (e.g. in Hardy Heron if I remember correctly).

From that point of time my settings in .Xmodmap were gone after a Supend / Resume of my laptop.

As usual with Google’s help it turned out, that I was not the only one with this issue. But I could not find a solution.

Finally I changed the systemwide configuration file /usr/share/X11/xkb/symbols/de.

In the section xkb_symbols “basic” I changed the keys AB08 and AB09


key <AB08> { [ comma, semicolon, slash, multiply ] };
key <AB09> { [ period, colon, slash, division ] };

(On my current laptop keyboard AB08 is the best choice, but on a standard keybord its AB09, so I changed both).

For the sake of completeness: The files in /usr/share/X11/xkb/keycodes map keycodes to symbolic keynames. In my case the file evdev contains:


xkb_keycodes "basic" {
...
<AB08> = 59;
<AB09> = 60;
...
};

You may call the binary xev to get the keycode of any key (among other information).

Now on to another configuration task. I use my laptop frequently with a standard PS/2 keyboard, connected to the laptop via a little electronic device which connects to the laptop via USB. lsusb gives me:


Bus 006 Device 002: ID 074e:0001 Digital Stream Corp. PS/2 Adapter

For reasons completely unknown to me the key “less greater bar” (German keyboard, left to y, would normally be keycode 94) is completely dead (LEDs on the PS/2 Adapter do not even flash when pressing this key). Maybe this device was designed for US keyboards in mind, were no such key exists … In my old .Xmodmap I used the left Windows key (keycode 133) to replace the dead one.

Unfortunately keycode 133 is bound to the key , which is a modifier key in karmic. Run xmodmap -pm to check. I reconfigured the key to emit “less” and “”greater”, but pressing <LWIN> + <AltGr> I never got “bar”.

Finally I changed /usr/share/X11/xkb/keycodes/evdev to read:


// Microsoft keyboard extra keys
// <LWIN> = 133;
<AE13> = 133;
...
//// <AE13> = 132; // Yen

Again in file /usr/share/X11/xkb/symbols/de I added:


default
xkb_symbols "basic" {
...
key <AE13> { [ less, greater, bar ] };
...
};

This configuration works as fine as my old .Xmodmap did also after a Suspend + Resume. Unfortunately it took me quite some time to get this working. From a user’s perspective this stuff is not really well documented. Of course my changes will be eventually overwritten by an update.

If somebody knows how to make my changes on a per user basis, please share.

sudo Trouble: Always asking for password despite NOPASSWD

May 26, 2008

Yes, I’m too lazy: I love NOPASSWD in my sudoers. Yes, this is bad security practice. Anyway, after installing Hardy I couldn’t make it work.

Finally I found that sudo takes the last appropriate entry that matches, not the first, as other tools do.

So after moving my custom sudoers rule to the end of /etc/sudoers, I now can continue my bad habits …