Software

How to load context of text files into DB2

The task is fairly simply --- I need to load the content of some text files into DB2. There are many ways to do so, but since I only need to this only once (hopefully), I want to find an easy way without writing any external code.

So here is the solution:

(1) create a table containing a CLOB (VARCHAR should work as well, if we know the maxium size of the files in advance) column. For example:

create table test (docid INTEGER GENERATED BY DEFAULT AS IDENTITY,doc CLOB)

Editing Web Textarea with Desktop Editor

Nowadays we do a lot of text input on the Web, like posting on forums, filling out a support request form, commenting on someone's blog, etc. Although Web forms often offer a variety of so-called rich text editing capabilities, nothing beats the good old desktop editors. For a vim person, a plain Web textarea simply is not the place for text editing. Fortunately, for Firefox users, this pain can be eased. There are a few Firefox addons that allow people to use external editors for editing textarea.

Firefox Hangs

Although Firefox is considered very safe and stable, it sometimes hangs. In the past, when it hung, my solution was to remove the whole ~/.mozilla/firefox directory. It worked every time (reinstalling Firefox doesn't help). Of course, I would always backup my bookmarks.html and other files under the chrome sub-directory first. Then I had to reinstall the add-ons when I got a working firefox. It turned out I shouldn't have taken such a drastic action.

Set mailto handler in Firefox

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.

Regular Web sites coexist with Drupal sites

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".

Putty as a Chinese Telnet client

How to display Chinese characters correctly on a Telnet client running on a non-Chinese version of Windows machine? Web browsers today support whatever character encodings, this is not so with Telnet client. If you make a Telnet connection to a Chinese server with Windows telnet client, you will most likely see strange characters on screen.

Solution: PuTTY.

Syndicate content