mysqldump for sqlite3

Be careful that import data into Sqlite3 could be very slow in this way.

mysqldump -u root -p111111 -c --compact -t --skip-opt dbname tbl1 tbl2|sed -e "s/\\\'/''/g"|gzip -9 > data.dump.gz
zcat data.dump.gz | sqlite3 db.sqlite3

My Emacs configuration


  • support c++/python/perl/ruby-on-rails/javascript
  • eim (Chinese Pinying IME for emacs)
  • org2blog (post wordpress blog by org-mode)


git clone ~/.emacs.d;

Some plugins need be compiled for better performance (OPTIONAL)

  • cedet,ecb,emacs-w3m,org-mode,nxml-mode,mmm-mode,auto-complete
cd ~/.emacs.d/site-lisp;make -C cedet;make -C ecb;make -C org-mode;make -C nxml-mode;make -C auto-complete
cd ~/.emacs.d/site-lisp/emacs-w3m;autoconf;./configure;make;sudo make install-info-en;
cd ~/.emacs.d/site-lisp/mmm-mode;./;./configure;make;sudo make install-info;


  • rinari (install info only)
cd ~/.emacs.d/site-lisp/rinari;rake doc:make_info;sudo cp doc/ /usr/share/info;sudo install-info /usr/share/info/ /usr/share/info/dir
  • eim
cd ~/.emacs.d/site-lisp/eim;emacs -batch -f batch-byte-compile *.el;

Perforce Tip: how to apply my default change to the release branch

Create the patch,

p4 diff -du -db main-branch/... > ~/mywork.patch

Go to the work directory of release branch.

cd dir-release-branch/

`p4 edit’ the files I want to patch under release branch. Please note,

  • `lsdiff’ is from the package `patchutils’.
  • `nosl’ will strip the slashes. It’s written by me.
cat ~/mywork.patch|lsdiff|nosl 5|p4 -x - edit

Patch the files and DONE!

patch -p5 < ~/mywork.patch

Here is the source code of nosl. I put it in my .bashrc

function nosl(){
  if [ -z "$1" ]; then
    echo "Usage: echo /hello/world|nosl num"
    echo "strip num leading slashes"
    perl -pe "$n=$1;while($n>0){ $_=~ s/[^/]*/+//;$n--; }"

BTW, you could save all the trouble of Perforce by switching to Git.