Mercurial and 404

I just started working with Mercurial source control at my new job. So far so good. I moved from developing on my Mac to working on Ubuntu 10.04 LTS. I installed the default instance of Mercurial and got the out of the box version 1.4 ( or there abouts ). As I tried to clone a repo that cloned just fine on the Mac I kept on getting this error:

abort: HTTP Error 404: Not Found

I searched around a bit ( I still can’t bring myself to use the verb Googled as I was a loyal Yahoo for 11 years ) and wasn’t able to find anything that directly solved my problem. I compared the version I had running on Mac which was ~2.0. I started to wonder if the version skew was the culprit. I up’d my Ubuntu version using the instructions here:

  • sudo add-apt-repository ppa:mercurial-ppa/releases
  • sudo apt-get update
  • sudo apt-get install mercurial

I tried again and Viola… it worked. Hope this helps others.

Rest Client for Firefox – Sample POST Request

I was having fits getting the REST Client for Firefox to let me create a post body where PHP would recognize the parameters I was trying to post. I added them to the “request body” but my REST server wasn’t showing that I was even posting anything.

I found out that you have to set the “request header” section of the Firefox plugin to have a “name” = “Content-Type” and “value” = “application/x-www-form-urlencoded”. Then I was able to put something like “name=themayesfamily” in the “request body” and my server found a post variable with called “name” with the value I’d set.

Hope this helps some others.

Synergy Crash Fixed

Synergy is awesome! I use it to link my XP machine to my Linux machine at work and share a common keyboard and mouse. I love being able to move between my 2 OS’s transparently.

So when I broke Synergy I was understandably super bummed. It all started when I switched my Windows XP machine to use the system default language or Farsi. I was looking to see if some internationalization stuff I was working on was behaving properly. All of a sudden…. Synergy crashing :(.

I looked all over the web for a solution since when I switched my language pref back to US English it was still broken. I looked all over the web and both Yahoo and Google weren’t giving me the answers I wanted. Finally buried in a forum post somewhere was the answer.

Synergy doesn’t like the XP language bar. Steps to fix this were:

  1. Navigate to Start -> Settings -> Control Panel
  2. Select the Regional and Language Options applet.
  3. Select the second tab “Languages” then select the “Details” button.
  4. You’ll get the “Text Services and Input Languages” dialog
  5. Screen Shots of the Control Panel Dialogs

  6. Make sure all the items are unchecked.
  7. Save and Exit
  8. restart your machine and restart Synergy

Installing Perl Modules on 1and1

I was trying to figure out how to install perl modules on my hosting provider 1and1.com. I was doing an old school install where I was unpacking and making the modules myself. Yep… as usual there was a better way. Yes, I’m a bonehead but since I need a scapegoat I’m blaming it on the Yahoo dev environment. It’s made me soft and I needed to figure out the right way to do this.

That said, cpan.pm comes with most standard perl installs and totally makes installing modules easier. It handles dependencies, downloads, unpacking, etc. All I really had to do was configure the env. This seemed to be the one snag that wasn’t well documented. I was getting something like the following error when running $ perl -MCPAN -e shell:

Your configuration suggests “/root/.cpan” as your CPAN.pm working directory. I could not create this directory due to this error: mkdir /root/.cpan: Permission denied at /usr/lib/perl5/5.6.1/CPAN.pm line 499
Please make sure the directory exists and is writable.

The solution was found here:
  http://www.dcc.fc.up.pt/~pbrandao/aulas/0203/AR/modules_inst_cpan.html

The site describes the following steps which I modified to work for me:

  1. Create a directory for the perl modules in your HOME
    $ mkdir ~/perl5lib
  2. Create ~/.cpan and ~/.cpan/CPAN directories:
    mkdir ~/.cpan
    mkdir ~/.cpan/CPAN

  3. Create a Config.pm for the CPAN module with $CPAN::Config empty
    $ echo “$CPAN::Config = {}”> ~/.cpan/CPAN/MyConfig.pm
  4. Execute again:
    $ perl -MCPAN -e shell
    This time (if all goes well) it will prompt you for the empty fields in $CPAN::Config.

Here’s where I modified things:

  1. Exit the cpan interactive shell
  2. Pick a directory where you want to keep your local copy of perl modules. I chose: ~/perl as the prefix.
  3. Create the directory there and make sure you have permissions to write.
  4. Start the cpan interactive shell again using $ perl -MCPAN -e shell
  5. You need to re-configure the conf to point at your new directory.
  6. o conf makepl_arg “LIB=~/perl/lib
    INSTALLMAN1DIR=~/perl/man/man1
    INSTALLMAN3DIR=~/perl/man/man3″
  7. o conf commit ( this will make the changes permanent )
  8. exit the cpan interactive shell again and modify your env vars to point at the new locations
  9. export PERL5LIB=${PERL5LIB}:~/perl/lib (If you want this to be permanent then modify your ~/.bashrc)
  10. restart the cpan interactive shell and you’re set to start installing

I created a Yahoo Mobile Widget

The widget I created is kinda lame but I wanted to see what the framework was like and get a little feel for mobile application development. Here’s a link to the widget:

Click here for the widget

Here’s the description:

This is a simple widget to help dial numbers like 1800-Call-ATT or 1866-store-it. If you have a QWERTY or other non-legacy keyboard (Blackberry, Treo, etc.) then this widget is for you. Enter the number as you see it. The widget will give you the numeric equivalent and a call link so you can simply press to dial.