Friday, December 23, 2011

Incorrect $HOME using Git Bash on Windows

I had installed Git Bash and was trying to push a set of commits back to github.  This was failing because git was looking for my ssh keys in the wrong location.  It should have been looking in /c/Users/myusername/.ssh but instead was looking in /c/Windows/SysWOW64/config/systemprofile/.ssh.  I found out it was due to the $HOME environment variable.

I looked in my environment variables and saw %HOME% was set to %USERPROFILE% in the system properties.  In git bash, $USERPROFILE was set to /c/Users/myusername but $HOME was set to /c/Windows/SysWOW64/config/systemprofile.  Strange.  I then decided to try setting a %HOME% environment variable in the user variable on Windows.  I went back into git bash and $HOME was set correctly.

Hope this helps someone.

Friday, April 29, 2011

Changing non-US keyboard layout in Virtualboxes.org images

I wanted a quick Ubuntu server installation and installed the 10.04 server installation from virtualboxes.org.  Unfortunately for me, the keyboard layout wasn't correct and I wanted to change it.  Not being very well versed in Linux and all it's ins and outs, I wasn't sure how to do this.  I found out that you can change your keyboard configuration by using the following command:

dpkg-reconfigure console-setup

I ran through a few steps and now have a nice and easy to use US keyboard again.

Thursday, March 24, 2011

XDebug issue: Unexpected termination of script, debugging ended

I spent the better part of a day trying to figure out why I could debug a PHP script in Eclipse one minute and the next not at all. Hopefully this will help someone else out too.

My setup is Eclipse Helios PDT and WAMPServer 2.1 with PHP 5.3.5 and XDebug 2.1. I had no problem debugging scripts and then one day, poof! I started getting "Unexpected termination of script, debugging ended" messages and could not step through code at all.

As it turns out there appears to be a bug in the PDT (I can recreate this with multiple XDebug versions) with using XDebug and the Watches panel if you have some watches defined. To get around the error (I don't know if there's a fix) just remove all your watches before debugging by right-clicking on the watches view in the PHP debug perspective and choose "Remove All Watches".

This fixed it for me and I hope it will for you too.

Dummy Coder

Wednesday, March 23, 2011

How to find Oracle database block size

I had a need to find the database block size in Oracle (which is different from the OS block size).  Here's the query for finding that information:

SELECT tablespace_name, block_size FROM dba_tablespaces;

Dummy Coder