Xiao Jia

The best way to contact me is via email

You can also find me on GitHub, LinkedIn, StackOverflow, and Twitter.






Remove delay in SSH login
UseDNS no                     # Add to /etc/ssh/sshd_config
options single-request-reopen # Add to /etc/resolv.conf
Remove watermarks (e.g. DRAFT) in PDF files
pdftk draft.pdf output uncompressed.pdf uncompress
less uncompressed.pdf          # check general structure
grep -a DRAFT uncompressed.pdf # check specific lines
cat uncompressed.pdf | sed 's/DRAFT//g' > without-draft.pdf
pdfjam examples
pdfjam ch1.pdf --landscape --nup 2x1 --a4paper --outfile ch1-2x1.pdf
pdf2ps ch1-2x1.pdf ch1-2x1.ps
pdfjam all.pdf --trim '2cm 3cm 2.5cm 1.5cm' --clip true --outfile /dev/stdout |\
  pdfjam --frame true --nup '2x2' --a4paper --outfile all-2x2-trim.pdf
Enable PDF support in Chromium
wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg-deb -x google-chrome*.deb /tmp/chrome/
sudo cp /tmp/chrome/opt/google/chrome/libpdf.so /usr/lib/chromium-browser/
Sublime Text 2 configuration
  "color_scheme": "Packages/Tomorrow-Night.tmTheme",
  "drag_text": false,
  "highlight_line": true,
  "shift_tab_unindent": true,
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "ignored_packages": []
Fcitx installation
sudo apt-get install fcitx \
                     fcitx-sunpinyin \
UXTerm font configuration
$ sudo apt-get install ttf-bitstream-vera
$ cat > ~/.Xresources
UXTerm.vt100.renderFont: true
UXTerm*faceName: Bitstream Vera Sans Mono
UXTerm*faceNameDoublesize: Heiti SC
UXTerm*faceSize: 10
$ xrdb -merge ~/.Xresources
Install and tweak classic Gnome in Ubuntu 12.04
sudo apt-get install gnome-session-fallback
sudo apt-get purge liboverlay-scrollbar-0.2-0 \
                   liboverlay-scrollbar3-0.2-0 \
gconftool-2 --set "/apps/metacity/general/button_layout" \
            --type string ":minimize,maximize,close"
LaTeX and Chinese support in Ubuntu 12.04
sudo apt-get install texlive-full latex-cjk-all