Skip to main content

Setting a Static IP in Ubuntu

· 3 min read

Just recently I had to set up a few workstations for developer work. I installed them with Ubuntu 9.04 (Jaunty Jackalope). I had originally installed them with 9.10 (Karmic Koala) but for some bloody reason, Eclipse, both Ganymede and Gallileo, don’t work on Koala. Anyway, that’s another story for another time.

So the workstations are used for Web development, each has to have a static IP address. Being a small outfit, we don’t have a DNS server. Therefore we need to set each machine’s IP address as static. I thought that it could easily be done with the Network Manager tool in the menu bar, but I was wrong.

Why I sometimes hate to be in the IT line

· 3 min read

The server holding the project files for the e-learning application that I’m developing just died on me today. The cause of the server dying is the insertion of a faulty RAM chip. What flabbergasted me was that the chip was idenfitied as faulty before. Why my colleague knowingly placed the RAM into the server I don’t know. I haven’t gotten a chance to ask.

The result of that action was that the server could not boot up. In fact, the problem was so different from what I’ve encountered before that it didn’t even occur to me that RAM could be the problem. The CPU was supposed to be a headless node that our developers access over the network to the repository and the wiki. What tipped me off was that the CPU was not reachable even after turning on. Network cable seems fine, and are connected at both ends properly. The system was working fine the Friday last week. Then I connected a monitor to the server to try to resolve the issue. Strangely, what came up on the monitor is an image that is akin to static noise you see on TV (during the analog days).

Google's Strange Way to Demand Strong Password

· 2 min read

A few days ago, I had to set up a mail client to retrieve mail from a hosted Google mail account. Setting the mail client should be a very simple affair that can be done in a few minutes. I never imagined it would take me more than 10 minutes to get it working.

JSON Object With Trailing Comma

· 2 min read

As any respectable JavaScript developer will know, JSON has become the de facto method of holding objects and passing arguments, even using it as a name-spacing mechanism.

Being the conscientious (and careless) programmer that I am, in my e-learning application that I’m developing at the moment, where I’m heavily using JSON, I made a conscious choice to always leave a comma at the end of the last member-value pair like so:


· One min read

Monitors just ain't what they used to be. I remember a time when all I need to know is that if a monitor supports 1024 by 768 resolution, it's good. If it stayed only in 800 by 600, then it's bad.

Times have changed! With HD, 1080P, DVI, HDMI, and what have you, it can be confusing. The Real Deal podcast from CNET has an excellent episode on monitors. CNET's monitor expert, Eric Franklin, is on this episode to talk about monitors and what you need to know about modern monitors.

If you are thinking of buying a TV that you might want to connect up to your CPU or laptop, check it out as well.

Using Templates in Vim

· One min read

I just discovered a way to use templates in Vim where when I create a file, depending on the extension of the file, the boilerplate text that should always be there will be there.

You can find out how to do this from the Vim Recipe book, in particular this page:

Tips on Using VI Editor (continued)

· 3 min read

The most attractive feature that VI has to offer is the block visual mode. It is amazingly powerful, especially for those who do coding. With it you can add characters to or remove characters a block of text in a column fashion. For example, you can add characters to a block of text (Figure 1) instantly (Figure 2).

Tips on Using VI Editor (continued)

· One min read

Some of the commands that you use for every session can be placed in a file named ".vimrc" in your home folder.

Personally, when editing code, I like to have my tabs to be of 4 characters wide. I also want the tab characters to be changed to 4 spaces. So in my .vimrc file, I place the following lines:

set smartindent set tabstop=4 set shiftwidth=4 set expandtab

I can then code and have the next line auto-indented. (There is another option called autoindent but it is not as good as smartindent.)

With the options set, the lines can also be indented in command mode or visual mode with the characters >> (shift dot key twice) and un-indented with << (shift comma key twice).

Tips on Using VI Editor (continued)

· 2 min read

Changing multiple characters to uppercase

In visual mode, with the characters to change selected, press U (uppercase) to change them to uppercase. Press u (lowercase) to change them to lowercase.

In command mode, the same effect can be achieved on a single character by placing the cursor on the letter and press the tilde sign (~).

Jumping from line to line

You can jump from line to line by marking them first. To mark a line, press the key 'm' followed by a letter e.g. ma

This will mark the line your cursor is at in the buffer 'a'.

Then when you are at any other position in the file, press the aprostrophe key (') followed by the same letter e.g. 'a

This will bring the cursor (and the screen) to the line that you marked.

Shortcut Movement Keys

Aside from the arrow keys and the letters h, j, k, and l, there are other movement keys.

w - move to the beginning of the next word

W - move to the beginning of the next word following a space

b - move to the beginning of the previous word

B - move to the beginning of the previous word preceding a space

e - move to the end of the next word

E - move to the end of the next word following a space

( - move to the start of the previous sentene

) - move to the start of the next sentence

- - move to the start of the line that is above the current position of the cursor

* - move to the start of the line that is below the current position of the cursor

% - find the matching bracket/brace of the one the cursor is positioned at