Always search before coding

This is a annoying, even if it take 5mn to code thing like that : (defun my-dired-rm-rf() "Rm -rf directories" (interactive) (let ((sel (selected-window))) (dolist (curFile (dired-get-marked-files)) (if (yes-or-no-p (concat "Do you want to remove \"" (file-name-nondirectory curFile) "\" ? ")) (progn (shell-command (concat "rm -rvf " curFile) "*Removing Directories*") (kill-buffer "*Removing Directories*") (select-window sel) (revert-buffer) ) )) )) you discover after a litlle while that if you have did a lilt bit of searching before, you will have discovered a variable call `dired-recursive-deletes` that would do the thing in a much better way. ...

February 11, 2007

Import Export to different tablespace names with Oracle 9i

Renaming Oracle Database is a pain, coming from OpenSource DB like MySQL or PostGres where we do that all the time i did not think that Oracle have to be such a pain. My only way i can find. If i have the tablespace named tablesp1 and owned by the user user1, and i want to import it to another tablespace called tablesp2 in an another Oracle 9i tablespace with the user name user2. ...

February 7, 2007

SVN Diff against changes in the remote repository.

A useful svn wrapper scripts. Get a diff of your local repostitory against the upstream repository changes. I wonder why it is not builtins though like a svn status -u but for dif. #!/bin/bash IFS=" " for line in `svn status -u`;do [[ $line != " "* ]] && continue rev=`echo $line|awk '{print $2}'` ff=`echo $line|awk '{print $3}'` svn diff -r${rev}:HEAD $ff done

February 7, 2007

Emacs nighly cvs snapshot with xft on Ubuntu Edgy

I wanted to try the latest cvs snapshot with XFT support, since i did not want to screw up more my workstation i have used packages instead of make install blindy. Basically i have a script called ./build.sh #!/bin/bash set -e d=$(date '+%Y%m%d') debpatch=20061218-1 mkdir -p cvs pushd cvs >/dev/null && { cvs -Q -z3 -d:pserver:[email protected]:/sources/emacs co -r emacs-unicode-2 emacs } && popd >/dev/null mkdir -p build [[ -d build/emacs-${d} ]] && rm -rf build/emacs-${d} cp -al cvs/emacs build/emacs-${d} zcat patches/emacs-snapshot_${debpatch}.diff.gz|patch -p1 -d build/emacs-${d} cat patches/with-font.patch|patch --silent -p1 -d build/emacs-${d} pushd build/emacs-${d} >/dev/null && { chmod +x debian/rules dch -v "1:${d}-1" "New snapshot." dch "Build with xft." fakeroot dpkg-buildpackage -b } && popd >/dev/null in patches/with-font.patch i have : ...

January 21, 2007

History expansion and substitions in ZSH

I better to keep that somewhere since i always forget that thing, to do a search and replace from the command line in zsh. you just have to do the :s^FOO^BAR after your expansion For example you just have typed the long command line : blah bar FOO=1 FOO=3 FOO=6 cnt=1 you can just type : !blah:s^FOO^VALUE^:G and it will be expanded to : blah bar VALUE=1 VALUE=3 VALUE=6 cnt=1

January 11, 2007

Rename bunch of file via regexp

To rename bunch of files via regexp i was using before a homegrown python script call rename-regexp.py{#p38} to change bunch of files with a regexp. But since then i discovered wdired which is pretty fantastic to use that from emacs. With the extended ``query-replace-regexp`` from Emacs22 stuff are much easier to rename.

January 7, 2007

Benchmarking with PGBench: TPS results.

pgbench is not the best tools to benchmark postgres but it’s the one shipped by default with postgres. It does not do a good job for benchmarking your “web apps” SQL wise, it will give you some good indication about how fast is your server for postgres. Here are some results we have collected using theses options : pgbench -Uuser -s 10 -c 10 -t 3000 benchmark We configure servers with RAID 1+0 with write-cache and a battery backup, we have tested with postgres 8.1.5 and here are the best results for different type of servers : ...

January 6, 2007

Compile tora with oracle

After installing Oracle instant client, if you have them in /usr/local/lib/instantclient_10_2, this is the command line i use : ./configure –with-instant-client=/usr/local/lib/instantclient_10_2 –with-oracle-includes=/usr/local/lib/instantclient_10_2/sdk/include –with-oracle-libraries=/usr/local/lib/instantclient_10_2 –with-oci-version=10G Let me know ny email if you want the deb for ubuntu linux.

January 4, 2007

sqlplus timeout when connnecting

If you are using a pam_ldap or pam_nis environement and it happend that sqlplus does not want to connect as user but it does as root, waiting for : socket(PF_FILE, SOCK_STREAM, 0) = 3 connect(3, {sa_family=AF_FILE, path="/var/run/.nscd_socket"}, 110) = -1 ENOENT (No such file or directory) close(3) = 0 open("/etc/hosts", O_RDONLY) = 3 fcntl64(3, F_GETFD) = 0 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 fstat64(3, {st_mode=S_IFREG|0644, st_size=286, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE |MAP_ANONYMOUS, -1, 0) = 0x45b78000 read(3, "127.0.0.1tlocalhost.localdomaint"..., 4096) = 286 read(3, "", 4096) = 0 close(3) = 0 munmap(0x45b78000, 4096) = 0 getpid() = 26002 getuid32() = 1121 futex(0x41239198, FUTEX_WAIT, 2, NULL <unfinished> </unfinished> You just to have make sure to have nscd up and running. dunno what sqlplus does :( ...

January 3, 2007

My first webpage

Classic my first webpage is still on the web that was back in 98 and that was about Emacs :) http://membres.lycos.fr/crblinux/html/xemacs.html It is in french thought.

December 30, 2006