This file contains various hacks that I had to apply in different situations to get things going. 1- Malformed UTF-8 character when compiling Occurred while compiling l4. FIX - do export LANG=en_US to fix. 2- Linux ssh timeouts set /proc/sys/net/ipv4/tcp_keepalive_time to 100 (e.g. on a natted box) 3- mksh: Fatal error in reader: = missing from replacement macro reference use gnu make rather than make 4 - autoreconf barfs with config/depcomp not found use autoreconf-2.53 -i 5 - ipkg doesn't want to install task-x, cross dependency on x-display-manager first install nullxdm (from unstable feed -- this was true as of familiar 0.7.2) and then install task-x 6 - Example of sed pattern usage s/V\(.*\)/& \1/ will transform VEcho => VEcho Echo 7- Making a table span both columns in a twocolumn document in latex use table* instead of table. 8- Config file for the current kernels can be found as /boot/config-`uname -r` 9- If cpp seems to run forever, you might be running cpp 2.95.2 which has "argument list too long" bug. Upgrade. 10- Creating quality pdf files of latex docs dvips -Ppdf -G0 paper.dvi ps2pdf paper.ps 11- if make invokes "missing" script, which run autotools and mess up macros, first do a touch * on all the files. 12- To identify processes using files or sockets use fuser, e.g. fuser -n tcp 38374,207.46.106.99,1863 tells which process has this connection open (this one is for yahoo messenger) 13- Linux can be booted first to shell by init=/bin/sh on the command line, then from the shell do "exec /sbin/init" to boot the whole thing. Helps while debugging. 14- If mutt complains as "inbox not a mailbox" for inbox generated by procmail , use procmail with -f- switch to fix the format. 15- To create preprocessor files to see values of different variables etc before compilation, specially kernel compilation, do following: make V=1 O=../build/linux kernel/timer.o copy paste the gcc command line in /tmp/foo remove -c switch and put -E -dD -o /tmp/XXX.i run as (cd ../build/linux; . /tmp/foo) 16- weak linking Just to define a function without worrying whether its implementation actually exists (useful for compiling for multiple archs), define in a common .h as extern void foo (void) __attribute__ ((weak)) Then call it as if (foo) foo(); This way function can be used as a variable. 17- useful commands nmap - port scanner. pstree - see running processes in a tree form. 18- gconf errors after a possible system crash remove the lock files in .gconfd and .gconf 19- Running tftp server#: ./tftpd -l -c -vvv -a :5555 -u rhim /tmp client# tftp [-p|-g] -l -r server 5555 20- Extracting a file from rpm rpm2cpio | cpio -ivd file name must match exactly as list in rpm2cpio | cpio -t 21- Profiling sub-function code with MARK and prof.h man (-s 5) prof 22- Finding what package provides a file. whereis rpm -qfi 23- Checking what files are not in CVS repository cvs -qn update | grep '^?' 24- Programming a sony remote (tested with RMT V501E) to control philips TV Keep the I/O button pressed, enter code (08) and press enter. 25- Removing all files from CVS that were moved in one go for i in `cvs -qn update 2>/dev/null | cut -d " " -f2`; do cvs remove $i; done 26- Sudo access with ssh X11 forwarding echo $DISPLAY xauth list COOKIE = line containing unix:N where DISPLAY==localhost:N sudo bash xauth add COOKIE 27- Using BT headset with btsco module btsco -v check /etc/asound.names and look for BT headset in pcm section. alsactl32 { name 'plughw:2,0' comment 'Physical Device With Conversions - BT SCO PCM (Duplex)' } mplayer -ao alsa:noblock:device=plughw=2.0 mpg123 --wave - file.mp3 | aplay -D plughw:Headset if there are continuous authentication failures, try removing /var/lib/bluetooth/<>/linkkeys file and restart bluetooth service. arecord -D hw:#,# -f S16_LE > /tmp/test aplay -D hw:#,# /tmp/test where #,# are card number and subdevice number, respectively. 28- Finding current runlevel who -r 29- When printing an image from word to pdf, the image prints on a letter paper by default, but the desired dimension of the pdf image is the same as that of original image. In adobe acrobat 5, use document, crop pages, remove white margins to automatically change the paper size to original image. 30- Formula for number of zeros in a factorial floor(n/5) + floor(n/25) + floor(n/125) + ... + floor(n/5^k) + ... 31- Installing fc6 remotely on JS2X system - 0> boot net:,ppc64.img,, console=hvc0 - console=hvc0 is important for JS21 since there is no vga console. 32- Cleaning up caches before creating snapshots (saves from snapshot creation failure error due to "in use") sync; sleep 1; sync echo 3 > /proc/sys/vm/drop_caches 33- Exporting an openoffice chart in Calc to .eps. Copy pasted the chart in OO draw. From there, select the image and choose File->Export, and EPS format. Voila!