Error loading native library: libnjni9.so

If you like me when running oracle on x86_64 get that damn : Error loading native library: libnjni9.so when launching dbca and you have googled the thousands five hundred useless answer. Just add the path of the libs $ORACLE_HOME/lib and $ORACLE_HOME/lib32 to your /etc/ld.so.conf (or /etc/ld.so.conf.d/oracle.conf on RH derivative) and rerun ldconfig. If this is during install just jump to a console after you add this line before it launching dbca and run a ldconfig -v as root....

December 22, 2006

How to get bright LS colors on Redhat with dark background

Something that i haven’t find via goole. By default on RedHat (and derivatives) if you get a dark background the colored ls will be seen really humm bold from a xterm (since i guess there default gnome-terminal has been configured to have a white background ). The solution is to cp /etc/DIR_COLORS /etc/DIR_COLORS.xterm or to redefine your dircolors to get the /etc/DIR_COLORS files instead of /etc/DIR_COLORS.xterm in your shell init configuration....

December 21, 2006

Cheetah Mode for Emacs

Here is a simple html derived mode for Cheetah templates files. The font-locking regexp can be improved thought but that’s a start. (define-derived-mode cheetah-mode html-mode "Cheetah" (make-face 'cheetah-variable-face) (font-lock-add-keywords nil '( ("\\(#\\(from\\|else\\|include\\|set\\|import\\|for\\|if\\|end\\)+\\)\\>" 1 font-lock-type-face) ("\\(#\\(from\\|for\\|end\\)\\).*\\<\\(for\\|import\\|if\\|in\\)\\>" 3 font-lock-type-face) ("\\(\\$\\(?:\\sw\\|}\\|{\\|\\s_\\)+\\)" 1 font-lock-variable-name-face)) ) (font-lock-mode 1) ) (setq auto-mode-alist (cons '( "\\.tmpl\\'" . cheetah-mode ) auto-mode-alist ))

July 31, 2006

Access Gajim within Emacs

Here is some function to launch a gajim window from Emacs : (defvar gajim-remote "/usr/bin/gajim-remote") (defvar gajim-user-list ()) (defun my-gajim-get-list() (save-excursion (with-temp-buffer (call-process gajim-remote nil t nil "list_contacts") (goto-char (point-min)) (while (re-search-forward "^jid[ ]*:[ ]*\\(.*\\)$" (point-max) t ) (setq gajim-user-list (append gajim-user-list (list (match-string-no-properties 1))))))) gajim-user-list) (defun my-gajim-talk() (interactive) (let* ((ff (if (not gajim-user-list)(my-gajim-get-list) gajim-user-list)) (answer (completing-read "Jabber: " (mapcar (lambda (tt)(list tt)) ff)))) (message answer) (start-process "*GAJIM*" nil gajim-remote "open_chat" answer) ) ) (global-set-key '[(control x)(j)] 'my-gajim-talk) If Emacs had a dbus support that would have been cool....

July 31, 2006

Assignement in Python with list.extend()

This is weird for me : d = ['foo', 'bar', 'ba', 'c'] print d f = d f.extend(d) print d give me the result python “/tmp/a.py” [‘foo’, ‘bar’, ‘ba’, ‘c’] [‘foo’, ‘bar’, ‘ba’, ‘c’, ‘foo’, ‘bar’, ‘ba’, ‘c’] Compilation finished at Mon Jul 31 16:49:4 It seems that extend assign as well the non extended part (d) which is confusing because to merge list i need to use temporary variable.

July 31, 2006

crypt(3) on unix maximal length

When i have a password comparaison function using crypt(3) i really should remember that the comparaison stop at the 7 bytes, because that stuff is weird for me : In 1: import crypt In [2]: seed=‘foo!bar’ In [3]: crypt.crypt(‘abcdefghaa123456681’, seed) Out[3]: ‘foEoVhbk7ad7A’ In [4]: crypt.crypt(‘abcdefghpax;lalx;al’, seed) Out[4]: ‘foEoVhbk7ad7A’ In [5]: any stuff after the 6 char will always get ignored by the hash algorithm.

July 30, 2006

chmouel.com is moved.

I have finally changed chmouel.com over a new provider. The new provider is called WebHost and i got a VPS with 50GB of bandwith and 2GB of storage for 10US$ a month. My first task was to compile python2.4 on that box which look like it’s based on RH7.3 with heavy customization. Hopefully python really can compile everywhere. I would like to thanks Vincent Danen for all his free hosting...

July 30, 2006

Get size of Postgres DB from filesystem

Get the size accurately from postgres local filesystem, i guess there is some sql stuff that can do that but that does the job as well for me : #!/bin/bash /usr/lib/postgresql/8.1/bin/oid2name -U postgres|while read -a e;do name=${e[1]} oid=${e[0]} [[ $oid == "All" || $oid == "Oid" || -z $oid || -z $name ]] && continue typeset -a size size=(`du -s /var/lib/postgresql/8.1/main/base/$oid`) size=${size[0]} printf "%-20s %-20s\n" ${name} ${size} done | sort -n -r -k 2 |awk '{printf "%-20s%20d Mb\n", $1, $2 / 1024}'

June 5, 2006

Jabber/Asterisk and Gajim notification

At work we are using Asterisk and Jabber and i am using Gajim as my client. I did a quick patch to have a notification on my desktop when someone call me and i get my big headphones (not that i like the phone very much but well), here is the patch for people who may wants it : http://trac.gajim.org/ticket/1998

May 25, 2006

svn diff without spaces

I am sic of spaces and having svn diff that does not get the spaces removed. So here is a simple script that does the stuff that you can use as your diff-cmd : #!/bin/bash for i in $@;do echo $i |grep -q ")" && continue echo $i |grep -q "(" && continue t="$t $i" done diff -bBw $t

May 25, 2006