_UnPrEdictAbLe_

All that you need to find out about what am I upto.

Archive for the 'Tips and tricks' Category


JDK on Fedora Core 6

Posted by Anurag on 27 March, 2007

I was installing Java Development Toolkit 1.5.0 on Fedora Core 6. And I got an error saying.
The installer is unable to run in graphical mode. Try running the installer with the -console or -silent flag.

I thought it was a usual error because ‘root’ couldn’t connect to X. I did

ssh -X root@localhost

or ssh -Y root@localhost

I also tried,

xhost +

su - root

export DISPLAY=:0.0

setenforce 0

service iptables stop

Nothing worked! I tried and tried and tried. Finally I got an answer. Fedora Core 4 onwards a package called ‘openmotif’ has been removed from Fedora Core. Hence, the installer doesn’t start. Another replacement of the same package that now comes with Fedora Core is lesstif.

Hence I installed lesstif and libXp. After that, the installer just worked fine. So anyone facing the same problem, check if you have openmotif or lesstif installed. If not, do so, and then try out the installer.

Cheers!!

Posted in Development, Linux, Tips and tricks | 1 Comment »

Firefox :bypass proxy for 172.*.*.* solved!

Posted by Anurag on 8 October, 2005

In our network, we wish to bypass the proxy server for IP addresses like 172.16.*.* and 172.17.*.*, oops… this doesn’t work in Firefox! Anyways, its not a great discovery, but, from somewhere I came to know the notation to be used for FIREFOX!

This is how you write it.

172.16.*.* … means first two fields are fixed. First 2 …. so do … 2 x 8 = 16.

write … 172.16.0.0/16

and if you want 172.*.*.* … 1 x 8 = 8

write 172.0.0.0/8

Simple! It just works. Cheers.

Posted in Tips and tricks | 2 Comments »

Making the “Multimedia keys” work

Posted by Anurag on 7 September, 2005

Normally, we have keyboards which have more than the normal keys. But, the general view is “Linux doesn’t support the extra keys”. True to some extent, it really doesn’t support all keys. But, there are a few keys which are detected by Linux, but it doesn’t know how to deal with them. Its something like, Linux detects the “electronic signal” generated by these keys, but it doesn’t have a mapping of the “signal” and “its name”.

We can specify this mapping and use those extra “signals” as keys. Every key generates a “signal” or a “keycode”. The command “xev” tells us the “keycode” of the key pressed.

Just run “xev” on konsole and press ‘a’, the output is…

KeyPress event, serial 30, synthetic NO, window 0×2200001,
root 0×40, subw 0×0, time 655687, (270,-143), root:(274,365),
state 0×0, keycode 38 (keysym 0×61, a), same_screen YES,
XLookupString gives 1 bytes: (61) “a”
XmbLookupString gives 1 bytes: (61) “a”
XFilterEvent returns: False

KeyRelease event, serial 30, synthetic NO, window 0×2200001,
root 0×40, subw 0×0, time 655780, (270,-143), root:(274,365),
state 0×0, keycode 38 (keysym 0×61, a), same_screen YES,
XLookupString gives 1 bytes: (61) “a”

Here we see that it says, the keycode is ‘38′. Linux has a mapping of 38 means ‘a’. Now, if I press “My Documents” button, this is what I see.

KeyRelease event, serial 30, synthetic NO, window 0×2200001,
root 0×40, subw 0×0, time 720180, (221,-246), root:(225,262),
state 0×0, keycode 239 (keysym 0xfed0, First_Virtual_Screen), same_screen YES,
XLookupString gives 0 bytes:

This says that it has a signal of 239, but no “mapping”.
We can specify mapping by creating a text file with the format
keycode {keycode} = {mapping}

The mapping is some string which identifies a key. There are some defined “mappings” which we can use. They are in the file, /usr/X11R6/include/X11/keysymdef.h

The known signals are already mapped to some code in that file. Like 22 is mapped to BackSpace. But, some of them like “XK_Next_Screen” are not mapped. We can use these “free codes” to map the new signals of our extra keys.

Hence, we can find the keycode of our extra key with “xev” and create a file,
~/.Xmodmap

and write something like…
keycode 239 = First_Virtual_Screen
keycode 237 = Next_Virtual_Screen
keycode 236 = Last_Virtual_Screen

Now, if we run “xmodmap ~/.Xmodmap, these new mappings get registered till we don’t restart X. So, we need to automate the running of this command on startup.

In KDE, open konqueror, GO->Autostart. Create new link to application, and type the execution command as “xmodmap .Xmodmap”. Now, it will work even after restarting X.

Also, first select the correct Keyboard Model in Control Centre->Regional and Accesibility->Keyboard Layout. If you do this, some of the extra keys “automatically” start working.

Have fun!

Posted in Tips and tricks | No Comments »