Printable Version of this PageHome PageRecent ChangesSearchSign In

Tech Note

Linux tips

GDB debug
  • How to Debug Using GDB
  • Debugging with GDB
  • Quick notes:
  • gcc -g ... - Enable debug support
  • gdb program; or gdb program coredump
  • b file.c:111 - Set breakpoint
  • r parameter
  • p variable - Print variable
  • p $ - Print structure content
  • bt - backtrace to see which function caused the problem

Vi tips for programers

SSH tricks
  • set SSH port forwarding: -L port:localhost:port
  • set SSH socks proxy: -D 888

Conver dos format to unix format (^M problem)
  • Use dos2unix (unix2dos)
  • In Vi, use the following command :%s/^M/\r/g ,or firstly :%s/^M$//g (Here ^M should be input as Ctrl+v Ctrl+m)
  • strings oldfile newfile
  • sed 's/^M/\r/g' oldfile newfile or sed 's/\r/\n/g' oldfile newfile
  • tr -s "\r" "\n" dos.txt unix.txt

Latex tips
TARGET=filename
default:
    latex filename.tex & bibtex filename & latex filename.tex & latex filename.tex & dvips -o filename.ps filename.dvi -t letter & gs -sDEVICE=pdfwrite -sOutputFile=filename.pdf -dNOPAUSE -dBATCH filename.ps & xpdf filename.pdf & echo
clean:
    rm filename.aux filename.ps filename.pdf filename.dvi filename.bbl filename.log filename.blg ~


Last modified 14 June 2007 at 2:12 am by guofei