Tip

Vim: Going to the nth character in a file

I ran into an error message today that only specified the character number in a configuration file without making any reference to the line number. Rather odd. In any case, since Vim (and my usual preference, GVim) is an excellent editor, I expected this to be a cinch. Unfortunately, a few minutes of head-scratching later, I was still quite clueless as to how to accomplish this seemingly routine task.

I do know that typing:
:1000
will move the cursor to the 1000th line in the file.

Vim: Scrolling a file with no line-breaks

When a file has no line-breaks and is just one single line, navigating line by line is obviously not an option. Some editors wrap the text and treat each pseudo-line as a separate element and allow us to scroll through them. Others don't. Vim, by default doesn't.

Or to be more precise, Vim (and GVim) do not allow us to scroll through such files using the arrow keys. Instead, the following short-cuts do the business:

Scroll up: g, k / g, up
Scroll down: g, j / g, down
Beginning of the line: g, ^ [i.e. g, SHIFT + 6 on a keyboard with a US layout]

Windows 7: ping outputs a general failure message

Here I was, earlier today, simply trying to swap the default gateway of the Ethernet card of my Windows 7 box, and ran into the following peculiarity. First off, as soon as I swapped the gateway, my Ethernet connection went down. To investigate this, I popped into the command-line and tried pinging the new gateway only to run into the error message below:
General failure.

Configuring Samba share on Lucid

I performed a fresh install of Kubuntu's new distro - Lucid whatever - today. As per usual, there is no front-end to configure Samba and I had to do it the old-fashioned way. The following are steps that should walk you through a basic configuration on creating a share that can be accessed from Windows:

  1. Install Samba using sudo aptitude install samba smbfs
  2. Navigate to /etc/samba/

OOO Calc: Autofilter hiding rows after removal

Off late, I have had to use OpenOffice.org's Calc quite regularly. While it generally works quite well, it has a lot of wonky little bugs that can be quite frustrating. One of these has to do with the autofilter.

When using the autofilter, you will, on occasion find that once you are done using it and try to remove it, a number of rows, usually empty, will be missing post-removal. The following are steps/tools that might help you recover these rows:

apache2: bad user name ${APACHE_RUN_USER}

While trying to check the vhost configuration on my Kubuntu dev box, I had to run httpd -S. Of course, since ubuntu renamed httpd to apache (a bit like calling a Veyron a Bugatti), I had to run apache2 -S. This however led to the following error message:
apache2: bad user name ${APACHE_RUN_USER}

Finding out CPU temperatures

Last week, I noticed that my computer was becoming really sluggish and the fans, extremely noisy. Seeing as to how I had an inkling that this was due to my CPU heating up or rather, not being cooled enough, and the fact that Windows wasn't telling me what the temperature was, I was in the hunt for a utility to report CPU temperatures in real time. I could, of course, check it via my BIOS. But I wanted a utility to be able to run under load.

Windows 7: High CPU usage due to system interrupts (Deferred procedure calls and interrupt service routines)

Windows 7, much as I enjoy using it (although the shine has worn off a li'l bit), has a few niggles. One of these, which really annoyed me was the sudden seemingly random spike in CPU usage that, once it occurred, never went away until I rebooted the system. The task manager did not list any application as consuming any significant attention from the CPU. However, the resource monitor (which can be reached from the performance tab in the task manager) provided the answer as I found the innocuous sounding "system interrupts" process consuming a steady 40-45% CPU.

console-kit-daemon running amok in htop

If you, like I was, are alarmed at the number of console-kit-daemon-s being listed by htop, calm yourself. It is a misrepresentation of threads as separate processes. To get a better view of what's going on, select "Setup" in htop and under "Display options", check the "Tree view" and "Display threads in a different colour" boxes and save the changes.

Gankutsuou: Classical pieces

Seeing as to how I listen to a lot of classical music, I was asked earlier to identify the classical piano pieces used in episode 12 of the anime, Gankutsuou: The Count of Monte Cristo (a recommended watch, btw)... I'm posting this to help others who are trying to find out the same thing...

The first piano piece played by Eugenie is Rachmaninoff's Piano concerto no. 2.

Syndicate content