Wednesday, March 10, 2010

Setting default browser for Lotus Notes under Linux

If you are using Lotus Notes 8.5 on Linux you've probably noticed how stupid the settings for external browser are! You can choose between internal notes browser or "system default" browser.
You've probably done what I did, set Gnome default browser to Firefox, set KDE default browser to Firefox and still, when you click on a link and Epiphany or Google Chrome comes up showing your page...

To check what "system default" is type:

$ xdg-mime query default text/html
google-chrome.desktop

then to change it, create firefox37.desktop in /usr/local/share/applications:

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=/usr/firefox37/firefox %U
GenericName[en_US]=
GenericName=
Icon=/usr/firefox37/icons/mozicon128.png
MimeType=text/html
Name[en_US]=Firefox 3.7
Name=Firefox 3.7
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Mimetype should be set to what you intend to use it for...

and set it:

$ xdg-mime default firefox37.desktop text/html
$ xdg-mime query default text/html
firefox37.desktop


happy browsing...

Tuesday, December 29, 2009

debian update breaks java networking

My testing Debian was recently upgraded to latest version and suddenly java applets stopped working with ConnectionExceptions and ClassNotFoundExceptions. After 1,5 days of searching I found that there is a new config file in /etc/sysctl.d/bindv6only.conf which breaks java networking!!!!

To "fix" it change net.ipv6.bindv6only = 1 to 0 and run:
invoke-rc.d procps restart

java now works again!!! I don't understand why (and I don't care) but this kind of things should be more public and more easy to find... Debian mainteners PLEASE don't break things so silently...

Tuesday, December 8, 2009

firefox 3.6 and java...

I lost 2 days trying to get new firefox 3.6b4 to use java 1.6 only to find out they changed the way plugins are handeled and that I need a new plugin!

new setting is:

user@server~/firefox36/plugins$ ls -la
lrwxrwxrwx 1 user users 58 2009-12-07 19:47 libnpjp2.so -> /home/user/ibm-java-i386-60.sr6/jre/lib/i386/libnpjp2.so


yours should probably point to something like:

/usr/java/latest/lib/i386/libnpjp2.so
for SUN java or
/opt/ibm-java-i386-60/jre/lib/i386/libnpjp2.so
for IBM java

Lets hope google will index this soon so others don't have to dig too deep...

Saturday, September 5, 2009

DB2, ITDS on Linux issues...

If you ever tried installing any IBM products on a linux distribution you already know that you need some black magick to do it...

Configuring it on the supported platform is a little bit easier but still not as it should be!


Most of the problems come from the use of InstallShield installer on all platforms (instead only on windblows where it actually works)...

Installshield prerequisites are almost nondocumented (except for compat-libstdc++-33.i386 or libstdc++5 on debian-based distros). Other than that you'll also need:libXp6, libxtst, xclock (for some basic X libs)... For centos I also needed compat-libstdc++-296 and pdksh (uninstall ksh and download pdksh from Internet since it's not part of the distribution)


Now you can at least install the product! But if it's WebSphere you should also add libgtk2.0-0 or your profile management tool dies...


If you are installing DB2 v9 on Ubuntu make sure you:

1. change /bin/sh as a link from /bin/dash to /bin/bash (or scripts will fail silently)

2. change /etc/pam.d/common-password from

password [success=1 default=ignore] pam_unix.so obscure sha512
to
password [success=1 default=ignore] pam_unix.so obscure md5

or DB2 will not be able to authenitace remote users (since their encrypted password will be to big!)



IBM please document your linux stuff and stop using InstallShield - it's simply broken!

Friday, April 3, 2009

split a file in 2 with sed...

If you need to split a file around a line containing special text (lets say "hello world") you shoud do it with sed!

If your file is original.txt, you can do it like this:

sed '1,/^hello world$/!d' < original.txt > first_half.txt
sed '1,/^hello world$/d' < original.txt > second_hald.txt

just simple sed...

hope you like it

Sunday, March 15, 2009

vi is all you need!


vi is a great editor and I just want to say it out loud!

Learn to use it, learn to love it and then learn to enjoy it...

I constantly find myself typing ESC h,j,k,l don't you?

PS learn to use hjkl and not the arrows, it will help you when you get your shell to vi mode (set -o vi)

Learn the tricks, learn search/replace and other tools and you'll greatly enhance your job performance...

I currently have to edit a lot of SQL files and search/replace just saved me 4-5 days of typing (and who knows how many mistakes)...

a simple ESC
:% s/what am I changing/what the new text will be/g
is all it takes... (g is for global, so if you have more occurencies of the same text all will be changed)

good options to know are
:4,8 s/what/new/gc
which will only run from 4th to 8th line and ask you to approve every change

other regexp formats are also supported:
:% s/this line has \(first\) argument/here was the \1 argument/g

just to make sure you know which lines to include try:
:set nu
and
:set nonu

Monday, January 26, 2009

How to change websphere app. server name from server1 to something usefull

If you are running WSAS as a standalone server (no deployment manager or cluster) you probably created a profile with a default server called server1. This is ok unless you have 2 profiles with 2 servers both called server1! Due to a bug in WSAS this will prevent EJB communication between them in some cases so you need to rename one of them!

This is not a simple task without deployment manager. You have to do it via scripts. IBM provides this scripts for free but they are not easy to find :-)

URL is:
http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html


and you are looking for ConfigScripts.zip

To rename it:
/usr/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/ws_ant.sh -profileName AppSrv01 -buildfile exportImport.xml -logfile rename.log -DoldServerName=server1 -DnewServerName=server2 -DnodeName=yourNode01 changeServerName


I would expect this to be a much easier process but IBM obviously doesn't share my ideas...