Freitag, 4. Mai 2012

debug shared library in IDL with DDD

How to debug a c program that was compiled as shared library and that is called by IDL via call_external in GNU DDD debugger? a) compile the shared library without optimization and with debugging information: Example: gcc -fPIC -O0 -ggdb3 -c fw_bw_loop_quick_xp.c && gcc -shared -o fw_bw_loop_quick_xp.so fw_bw_loop_quick_xp.o -lm b) call IDL inside DDD in the path where your data is like: LD_LIBRARY_PATH=/usr/local/rsi/idl/lib:/usr/local/rsi/idl/bin/bin.linux.x86_64 ddd /usr/local/rsi/idl/bin/bin.linux.x86_64/idl c) inside DDD type "run" This will start IDL inside DDD. Now you can restore your software and execute whatever you want. If it enteres the c-program, type CTRL-C or set somehow a breakpoint d) continue normal debugging. Open the source of your c-program by "open->source". Thanks a lot to my friend Fernando Silveira for this tip!!!!!!

Donnerstag, 2. Dezember 2010

edit initrd

If you ever need to edit the initrd file of /boot/ then issue the following commands:

mkdir ~/initrd
zcat boot/initrd-2.6.22.12-0.1-default >~/initrd-2.6.22.12-0.1-default.cpio
cd ~/initrd
cpio -idv <../initrd-2.6.22.12-0.1-default.cpio

The reverse process is doing by this commands:

find . | cpio --quiet -c -o | gzip -9 -n > /boot/imagefile.img

Donnerstag, 23. September 2010

repair cacti database

issue following command as root:
mysqlcheck --auto-repair --databases cacti

Donnerstag, 26. August 2010

solve envi 4.1 segmentation fault

If ENVI 4.1 crashes with segmentation fault then find a old libX11.so.6 file from a working
version and copy it to the directory of your choice and specify this path to LD_LIBRARY_PATH:
export LD_LIBRARY_PATH="/usr/local/lib/private_lib"
export LD_PRELOAD_PATH="/usr/local/lib/private_lib"

then start ENVI and...works

Dienstag, 29. Juni 2010

untethered jailbreak and unlock for iphone 3GS with new bootrom and firmware 3.1.3

The iphone 3GS with new bootrom and firmware 3.1.3 can be jailbreaked and unlocked with following tools:

1) jailbreak it with Spirit from this page:
http://www.redmondpie.com/spirit-jailbreak-fix-for-itunes-9.2/
The link to the software you will find here:
http://rapidshare.com/files/403136973/Spirit.Fix.iTunes.9.2.rar.html

2) unlock the phone with ultrasn0w.
Go to Cydia and add the source http://repo666.ultrasn0w.com
Then install ultrasn0w and everything is done.

Donnerstag, 24. Juni 2010

mount partition of dd image of hard disk

If you did a backup of a hard disk with the dd command then you stored
everything including the partition table.
If you want to mount one partition of this backup only to a folder then you need to do the following:

1) losetup /dev/loop0 /home/proc/file
2) fdisk -lu /dev/loop0 then you will see the partitions and the number of the blocks where they start. If you want to mount the partition number 3 then read the number there. Let's say it is N
3) losetup -d /dev/loop0 (release the loop device)
4) losetup /dev/loop0 /home/proc/file -o $((N*512))
5) mount /dev/loop0 disk

Montag, 31. Mai 2010

1 Tb hard disk appears as 33Mbyte disk on a Gigabyte mainboard

If a 1Tb hard disk that is installed on a Gigabyte motherboard appears to have
a size of 33 Mbyte after some time then do the following:

>hdparm -N /dev/sdc (assuming that the disc appears as /dev/sdc)
/dev/sdc:
max sectors = 1953525168/1953525168, HPA is disabled

write the number that appears behind the slash in the following line:

>hdparm -Np1953525168 /dev/sdc


Then reboot the machine.
The disc has its original size and all data is still there.
Thanks to:

http://www.mail-archive.com/linux-ide@vger.kernel.org/msg16327.html