clean up local repo

delete branches already deleted in remote repo

witr$ git remote prune origin

list local branches and theirs on remote : helps to see which local branch references to deleted remote branch

witr$ git branch -vv

delete branch referencing to deleted remote branch

witr$ git branch -d branch-to-delete

local clean up

witr$ git clean -dfx

target busy when umount

I have mount webdav directory /mnt/wdav (more). And, now, I want to umount it.
but i have following error:

umount: /mnt/wdav: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)

first step : find out processes using this mount

witr$ fuser -u /mnt/wdav
/mnt/wdav: 408c(witr)

second step : identify process

witr$ ps 408
408 pts/33 Ss 0:00 /opt/appli

third step : stop process

witr$ fuser -k /mnt/wdav

last step : safe umount

witr$ sudo umount /mnt/wdav

mount remote file systems over ssh (sshfs)

Mount remote file systems over ssh with three steps:

1. install sshfs

witr@witr-pc:~$ sudo apt-get install sshfs

2. create directory where you willi mount your remote file sustem

witr@witr-pc:~$ sudo mkdir /mnt/witrRemote

3. finally, mount the remote file system

witr@witr-pc:~$ sudo sshfs /mnt/witrRemote/

Assumes myRemoteFolder is on witr serve home directory. See warning bellow.
warn : ~ is expanded by the shell. Paths are relative on sshfs. that means : “sshfs …” will fail with No such file or directory error.

guess ssh key passphrase

You have probably forgotten your ssh key passphrase. But you have a hunch what it might be. The simple way to check it, is to use ssh-keygen with -y argument which read private key file and print public key :

witr@witr-pc:~$ ssh-keygen -y
Enter file in which the key is (/home/witr/.ssh/id_rsa): /tmp/my_private_ssh_key
Enter passphrase:

If you input the correct passphrase, it will show you the associated public key. Otherwise, it will display

load failed

clean system data (oracle database)

Following, a useful sql request listing system tables sizes in descending order. It helps to detect which table data could be purged to save more disk space :

select owner, segment_name, segment_type, bytes / 1024 / 1024 "size"
  from dba_segments
 where tablespace_name = 'SYSTEM'
 order by "size" desc;

Audit table SYS.AUD$ could be the cause of full disk space. Administrator must control the growth and size of the audit trail.

upgrade mongodb under ubuntu

To upgrade mongodb follow steps bellow :

$[/home/witr] sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10

$[/home/witr] echo 'deb dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

$[/home/witr] sudo apt-get update

$[/home/witr] sudo apt-get install mongodb-10gen

While upgrading you have dpkg-deb error processing at step 4
E: Sub-process /usr/bin/dpkg returned an error code (1)

You must remove mongodb-clients before apt-get install :

$[/home/witr] sudo apt-get remove mongodb-clients

$[/home/witr] sudo apt-get install mongodb-10gen

delete one of duplicated rows in table (rownum with postgresql)

You have to delete one of duplicated row within table which doesn’t have a primary key:

delete from  
 where ctid = (select min(ctid) from