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

4/14/09

Create a patch with diff

To create a patch for a single file, use the form:

diff -u original.c new.c > original.patch

To create a patch for an entire source tree, make a copy of the tree:

cp -R original new

Make any changes required in the directory new/. Then create a patch with the following command:

diff -rupN original/ new/ > original.patch