11/30/10

SVN username with svn+ssh, the correct way

If you use svn+ssh and want to connect to an external server with a different username than the one you are currently logged in with on your local computer you can try to use svn+ssh://username@host. This will work until you have externals in your repository, svn will in some way forget your username. So a better way is to specify your username in the ssh configfile.

So add a file if it not exists:
.ssh/config

Host svn.host
User yourusername

9/15/10

Oneliner for removing svn and git metainfo

If you receive a code tree that someone has to forgot to remove version control system metainfo from it here is a one liner for removing it.

.svn files:
find . -type d -name ".svn" | xargs rm -rf

.git files:
find . -type d -name ".git" | xargs rm -rf

9/16/09

Enable core dumps

To enable core dumps to persistent storage mounted on /mnt on your embedded device with the filename appended to the core name, also make applications started as root to dump core.

ulimit -c unlimited
echo "/mnt/core.%e" > /proc/sys/kernel/core_pattern
echo "1" > /proc/sys/fs/suid_dumpable

7/13/09

How to use etags for emacs

1. Create tag files
a. In linux kernel tree just execute:
cd linux 2.6.27
make ARCH=arm TAGS

b. Else make your own tag files for your project
etags *.c *.h --output=TAGS

c. Quick command line to make tags in a code tree is:
find . -regex ".*\.[cChH]\(pp\)?" -print | etags -

2. To use tags in emacs
Load TAGS file with M-x visit tag table

Place cursor on a variable and press M-.

Emacs questions you which tag that you want to find, default the one that you have your cursor on. Press enter if correct.

Emacs questions which tag file you want to use, default TAGS, if correct press enter once more

3. Emacs jumps to the definition

If you want to jump to next occurence, press C-u M-.

4. Name completion

To get completion on a long function/variable name type the first letters and press M-tab

6/2/09

How to avoid "The host key has changed!" when reinstalling systems with the same ip

If you have troubles when reinstallning systems with the same ip you get different SSH host keys Then you can disable strict checking of host keys on a certain IP-range by adding the following setting to your ~/.ssh/config file.

Host 10.0.0.*
UserKnownHostsFile /dev/null
StrictHostKeyChecking no

5/8/09

How to store an executable script in SVN

If you want that subversion to mark a file as executable when you check it out, you can tell it by setting a property in SVN: (Link)

$ svn propset svn:executable ON somescript
property 'svn:executable' set on 'somescript'

4/22/09

sshfs

sshfs can be used to mount directory located on a remote server using ssh

sudo apt-get install sshfs

Command line usage:
sshfs remoteuser@remotehost:/path/to/remote_dir local_mountpoint

umount local_mountpoint



Example (on my connection):
sshfs johan@192.168.169.100:/ localmnt
umount localmnt