mount webdav directory

– install davfs2

witr$ sudo apt-get install davfs2

– create folder

witr$ sudo mkdir /mnt/wdav

– mount wbeddav

witr$ sudo mount.davfs /mnt/wdav
Username: witr

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 :

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 :

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 :

Remove all references to the key before the key is to be dropped

if oracle db refuse to drop a constraint with message “Remove all references to the key before the key is to be dropped”. It’s clear that we must drop references before. But how to list these references.

Sql command bellow help to list all constraints which uses the constraint to be dropped “CONSTRAINT_TO_BE_DROPPED_NAME”

when ssh connection refused with “Too many authentication failures for x”

If you are here you have probably got following message when trying to connect with ssh:
“Received disconnect from 2: Too many authentication failures for x”

In fact, when trying to connect, ssh send all locally registred keys to the server trying them one by one. The server will reject any key after too many keys have been rejected.

If you are using key to connect try :

ssh -i your_key -o ‘IdentitiesOnly yes’ user@server:/path/

If you are connecting without keys (login and password only) try

ssh -o ‘IdentitiesOnly yes’ user@server:/path/

extract git repository sub-folder as new git repository

Problem :

we have a git repository located in user@server:/home/witr/git-repos/witr.git
witr.git contains 3 projects: proj1, proj2 and proj3
projects are growing up. And cloning witr.git become too slow cause of the size.

Solution :
extract each project as a new git repository.
Follow steps bellow to extract proj1 (do the same for other projects).

1. on server : initialize new git repository proj1

2. on local machine : extract proj1 as new git

3. on local machine : ensure that all is right

local machine commands could be automated with following bash script