vim color settings

I was having trouble applying a colorscheme in vim. I copied over my vimrc and .vim directory from another computer, but the colorscheme was not applying. All other settings from my vimrc were loading, but not the colors. If I set the colorscheme manually or re-sourced $MYVIMRC, then the colorscheme applied, so it was very strange. echoing g:color_scheme threw an error.

There was a color scheme file saved in ~/.vim/plugins instead of ~/.vim/colors from a long time ago. It had never loaded, so I forgot about it. vim must load plugins after running the vimrc file, overwriting my set colorscheme.

Posted in Uncategorized | Tagged , , | Leave a comment

Runtime.exec() is not fork(2)

I had a process which would hang when executed from Java using Runtime.exec(). Running strace showed the process hanging on a write system call. The problem is that Runtime.exec() in Java does not just fork and execute a process, it also redirects stdio to the parent Java process. So using BufferedReader and Process. I just piped the stdout of the child process to System.out.

This is all explained in http://download.java.net/jdk7/docs/api/java/lang/Process.html

Posted in programming | Tagged , | Leave a comment

How to install an SSD in a Toshiba NB305 netbook

When using a solid-state disk (SSD), it is recommended to use an operating system supporting the TRIM command to prevent performance degradation. I recommend reinstalling your operating system when moving to a new hard drive instead of using disk imaging, to ensure that ssd support is fully enabled.

Prerequisites

  1. The installation media for your operating system. You may need to create recovery media if no disks shipped with your netbook.
  2. A T-6 Torx-style wrench. These have become very common at hardware stores.
  3. A new HDD or SSD.

Directions

  • First, back up your files and settings to another computer or disk.
  • Shut down the netbook.
  • Unplug all attached devices and the power cable, and remove the battery
  • Using the Torx wrench, remove the two Torx screws on the bottom of the netbook.
  • Life the access panel from the screw side.
  • Slide the hard drive off of its SATA connectors and then remove it.
  • Slide the new disk into its place.

Put everything back together, install an operating system, and have fun. You may want to use the old hard drive as a portable hard drive using a dirt-cheap hard drive enclosure. These conveniently convert the disk’s SATA interface internally to a USB connection.

Posted in Uncategorized | Tagged , , , , | 2 Comments

How to use cURL behind a proxy

Create the file ~/.curlrc and place the proxy parameter in this file, e.g. --proxy examplehost:8080

Posted in Uncategorized | Tagged , , , , | Leave a comment

the password you use to log in to your computer no longer matches that of your login keyring

Thanks to KaruppuSwamy for this guide to changing the Gnome keyring password to match the Gnome login password.

see How to get rid of “Enter password to unlock your login keyring” prompt in Ubuntu

Posted in gnome | Tagged , , , | Leave a comment

Adding AIM accounts (back) to Empathy

I use Empathy on Ubuntu and I needed to contact someone over AIM chat recently, but I had uninstalled the telepathy-haze package which is required to use AIM in Empathy.

After reinstalling the telepathy-haze package, there was still no option to add an AIM account to Empathy. Even after closing and restarting Empathy, the option was not on the menu.

After quitting Empathy again, I searched the running processes for telepathy:
$ ps x | grep telepathy
9370 ? S 0:00 /usr/lib/telepathy/mission-control-5
9738 pts/0 S+ 0:00 grep telepathy

Bingo, I need to kill mission-control-5.
$ killall mission-control-5
Upon restarting Empathy I was then able to activate my AIM account.

Posted in linux | Tagged , , , | Leave a comment

Rhythmbox crossfading

Rhythmbox has had the option to use crossfading for a few releases now, but it had always just crashed. Well good job to the Rhythmbox authors, because it’s smooth and stable in Rhythmbox 0.12.0 in Ubuntu 9.04. I’ve set it to 0.3 seconds and it’s been quite elegant.

Posted in Uncategorized | Tagged , , , | Leave a comment

Static sound in Ubuntu

I just updated to the 2.6.28-13 kernel in Ubuntu 9.04 and sound was just playing static. The solution was to raise the volume on the PCM slider, for some reason it was down to 0.

Posted in Uncategorized | Tagged , , , , | 1 Comment

How to Enable Digital Microphone Array on Dell Inspiron Laptops in Ubuntu 8.04

Some of the new Dell Inspiron laptops (the 1420n, 1520, and 1525 are the ones I know of) come with a digital microphone array above the screen, but a fresh install of Ubuntu 8.04 will not have the array enabled by default.

Fortunately, it wasn’t too difficult to enable, and now I can use Audacity, Skype, etc., without any peripherals.

Although Hardy’s usage of the new Pulseaudio system is causing problems with many audio applications, the problem in this case seemed to be alsa-based

  1. Right-click the volume applet in the top-right of your screen and click Open Volume Control.
  2. Click File > Change Device and change the device to the alsa device.
  3. Now click Edit > Preferences and select both Digital and Digital Input Source.
  4. In the Recording tab, make sure the digital device’s volume is all the way up and that the device is not muted.
  5. In the Options tab, change Digital Input Source: to Digital Mic 1.
Posted in linux | Tagged , , , , , , | 15 Comments

Fun with Google Trends

Google Trends got some updates so I was playing with it. Some funny correlations:
New Years Resolutions
The changing seasons

Posted in Uncategorized | Tagged , , | Leave a comment