Friday, February 18, 2011

Just the other day, I was left with no option other than to power-cycle my Ubuntu workstation at work. After this, Firefox, which was open when my workstation died on me, would not start anymore. It just insisted that "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system." - a useless piece of crap advice.

This happened to me before, but I never bothered to document the recovery process. I learned my lesson, thank you very much:

step #0: find the location of the default Firefox user profile, and then cd to it:

the good news is that Firefox will most likely start with your bookmarks intact, the bad news is that you've just reset your browsing history...

step #3: I thought I was out of the woods - everything looked normal enough, until I restarted Firefox - a few hours later - only to discover that Firefox stopped saving cookies, so that I had to re-login to every web site that required it (so many!). I fixed this by moving away the cookies database:

Friday, February 11, 2011

My wife's employer issued her an Asus Eee PC 1005P Netbook. She rarely needs to use it, so that it's usually turned off. But, whenever it is turned on, I encounter new system administration problems. The latest problem was with network shares.

Windows 7 Starter, which is the OS installed on this netbook, doesn't seem to allow access to multiple network shares, with different credentials. One has to disconnect from the currently connected network share before connecting to another one.

Disconnecting from a network share that's been mapped as a network drive is easy enough (the menu item to look for starts with 'Disconnect' ...) - but there's no obvious way to disconnect from a network share that has not been mapped as a network drive.

I found a solution on this forum thread - run the following command in a command window:

net use \\MACHINE\share /d

where you should replace \\MACHINE\share with the path of the network share you want to disconnect from.

Friday, February 4, 2011

This seems to be a FAQ, and a rather annoying missing feature in Emacs. Especially once you see it working in Vim. I guess it's the closest I can get to penis envy.

Well, envy no more - just add the code below to your .emacs and you're good to go.

It'll highlight, as comments, bits of C/C++ code that are disabled with #if 0 ... #else ... #endif and #if 1 ... #else ... #endif. This is done by configuring cpp-highlight-buffer to recognize "0" as an undefined C preprocessor label and "1" as defined, and then causing cpp-highlight-buffer to be called every time the buffer is highlighted.

If you feel adventurous, I suggest you remove the first few lines - those that start with (setq ... - and use, instead, the Emacs customization interface to configure cpp-highlight-buffer:

M-x customize-group RET cpp RET

It should be pretty easy to recreate the setup below, and then you may want to experiment: