• Reverse/Forward Search with Latex-Suite in Vim

    Posted on: Thu, 11/22/2007 - 17:19 By: Huahai

    When editing a long Latex document, it is beneficial to be able to point from current location in DVI back to Tex, and vice visa. This is what called reverse/forward search between DVI and Latex. With Latex-Suite in Vim, this functionality is already implemented, and there's no need to specify "\usepackage scrltx" in the Tex file. However, it's not fully configured by default. Forward search with "\ls" works, but inverse search by "Ctrl-Left click" in xdiv is not enabled.

  • kmail hangs due to missing loopback interface

    Posted on: Thu, 11/22/2007 - 01:50 By: Huahai

    My /etc/network/interfaces got deleted when I removed mepis-network package. Everything was fine, except that kmail would hang since IP address doesn't exist. It took me half an hour to figure it out. Had to create the file with these lines in it:

    auto lo
    iface lo inet loopback

    Now things went back to normal.

  • Post syntax highlighted code in Drupal

    Posted on: Sat, 11/17/2007 - 10:45 By: Huahai

    You may have seen that I sometimes post code here. Wouldn't it be nice if all the code are syntax highlighted, like what we see in a text editor? Well, with the help of Vim, it's easy. Vim is bundled with a "2html" script, that can turn whatever shown in Vim into a HTML file, with all it's color and format. To invoke this command, simply issue ":so \$VIMRUNTIME/syntax/2html.vim" command in Vim to run the script, or more simply ":TOhtml". No, you don't have to type this many characters, autocompletion should do most of the typing for you. Vim will then open up a window that contains the newly converted HTML file.

    (Update: for newer version of vim, need to :let g:html_use_css=0 first)

  • Set mailto handler in Firefox

    Posted on: Fri, 11/16/2007 - 22:25 By: Huahai

    In order to click "mailto:" links on Web pages to launch an email program, Firefox (or Iceweasel on Debian) needs to be told which email program to use. To do this, type "about:config" in Firefox's address bar, type in "mailto" in filter, look if "network.protocol-handler.external.mailto" preference has value "true". By default, it's true. If not, set it to be true. Then check if "network-protocol-handler.app.mailto" exists or not. By default it's not.

  • Dual head with xrandr 1.2 revisited

    Posted on: Fri, 11/16/2007 - 04:04 By: Huahai

    In this post, I discussed "clone" mode of dual head with xrandr 1.2. Now I got an extra monitor, and would like to use "xinerama" mode, wherein the built-in laptop LCD and the external monitor share a single virtual screen. To set this up, I changed my /etc/X11/xorg.conf to add a monitor section for the external monitor:

    Section "Device"
    Identifier "Intel 965GM"
    Driver "intel"
    BusID "PCI:0:2:0"
    Screen 0
    Option "XAANoOffscreenPixmaps" "true"

  • Regular Web sites coexist with Drupal sites

    Posted on: Fri, 11/16/2007 - 01:31 By: Huahai

    This site is primarily powered by Drupal, i.e. it is a PHP site. However, we have a few Web directories that serves regular HTML pages. Since I installed Drupal in document root, access to these directories becomes an issue. The main problem is that directory index file resolution is broken, because Drupal changed the default directory index file from index.html to index.php. So a Web request to these regular HTML directories results in an error. What's more, this error is very misleading, instead of saying "404 Page not found", it says "403 Access denied".

  • Complete OpenSSH Client Public Key Solution on Debian

    Posted on: Mon, 11/12/2007 - 10:14 By: Huahai

    My work requires me to connect to many different SSH servers, and I have different passwords for each server. It's a pain in the neck trying to type in many different passwords everyday. The obvious solution is to use OpenSSH's public key login solution, so passwords are no longer needed to connect to SSH servers from a single client (e.g. my office desktop).

    Key Generation and Distribution

    To use public key authentication, it is necessary to generate a pair of keys on your client machine. Do the following as normal user:

    mkdir ~/.ssh

  • Backup Linux Laptop with USB Hard-disk Enclosure: a Lightweight Solution

    Posted on: Mon, 11/12/2007 - 00:00 By: Huahai

    Most of Linux laptop users have done some customizations on the system so it works the way we wanted. Now we want to save the fruit of our hard labor in case bad things happen. We want to backup not just the /home directory, but the whole / directory, minus some runtime generated files. In the past I have used some heavy-weight applications such as unison and backuppc. These worked well, but they required setting up servers that run all the time.

  • Use Vim to read manual page

    Posted on: Fri, 11/09/2007 - 22:10 By: Huahai

    Command line manual page is an indispensable tool for working with Linux system.If you forget how to use a command, just type man followed by the name of the command. One thing I don't like about the manual system on my Debian sid is that it uses most to display the manual. The key bindings of most feel awkward for me since I am used to vim. Of course, there are many "vimers" like me, and they've found ways to fix this.

  • Running Windows Vista on Debian Linux with VirtualBox

    Posted on: Sun, 11/04/2007 - 00:26 By: Huahai

    All of my laptops are now running Debian based Linux. It works great. Linux handles all my daily works well. However, there are occasions where I need a Windows machine. For example, I recently need to deliver a lecture on a system that runs only on Windows. Also, in the past, we developed a system that works only on Windows, and I still need to demonstrate it from time to time. Of course, the solution is to run Windows on a virtual machine on top of Linux. In the last couple of years, I have been using VMware for this purpose. However, I was not very impressed by its performance. I remember last year during a presentation, the virtual machine was so slow that my demonstration was negatively impacted by it.

    Open source edition

Subscribe to Huahai's Blog