Tuesday 17 November 2009

Configuring Console 2 and bash with cygwin on Windows XP

One of my biggest issues with Windows XP has always been with cmd.exe. To make Windows XP much more enjoyable to use (from a command-line perspective), two excellent applications can be installed:

Cygwin: http://www.cygwin.com
Console 2: http://sourceforge.net/projects/console/files/

Once cygwin is set up and you've installed any other necessary applications (e.g. vim etc), open Console 2 and select Settings > Tabs. Create a new tab (e.g. "Bash") and for the Shell: input set the following:


You should now be able to use Console 2 to create new bash sessions by going to: File > New Tab > Bash

For a great file manager replacement, I'd also recommend installing KDE 4 for Windows:
http://windows.kde.org/
And using Dolphin.

Saturday 14 November 2009

Getting Google's "go" language compiler set up on OSX (Snow Leopard)

Here are my rough notes for getting google's go compiler set up on Snow Leopard (applies to any 64 bit macbook). These steps are mostly outlined on http://golang.org/doc/install.html, although there are a couple of extra steps I needed to make, which I'm listing here:

1. If you haven't already, install XCode so you have the gcc compiler:
http://developer.apple.com/technology/xcode.html

2. Install mercurial (if you don't already have it):


3. Configure your environment variables and run the setup - open the terminal and in your home directory edit .profile and add the following:

Run source .profile if you want to use those values without restarting (otherwise just close the terminal and reopen it)

4. check out go from the mercurial repository


5. run the setup:


6. Write out the obligatory hello world code (hello.go):


7. Compile, link and run:


Adapted from: http://golang.org/doc/install.html

Monday 9 November 2009

PrintScreen in Windows using a Mac keyboard...

If you want to capture the active window as a screengrab:

Shift + Ctrl + Alt and F14

is what you need.

Wednesday 4 November 2009

Get Eclipse, EGit and github all working together on OSX

I've managed to get all the pieces working for this. It's not an especially neat solution, but I should be able to give you enough information to enable you to create a project in github, install and configure EGit and then import the project.

Creating a github account

If you don't already have a github account, start here: https://github.com/signup/free

Fill in your username, email address and password (you can ignore the public key right now if you like) and hit submit to go to your dashboard.

Create ssh key and test your connection to github

These instructions are for OS X, although Linux users will probably be able to follow these instructions closely, there are instructions for all operating systems at http://help.github.com. Probably the link marked Generating SSH Keys is the place to go first.

The notes for the section below are discussed in detail at http://help.github.com/mac-key-setup/

Open the terminal and type:



The default file location will probably be something like: (/Users/%your_username%/.ssh/id_rsa) and then it will ask you for a passphrase.

To copy your key to the clipboard:



You can now go to your github accpunt page and select "add another public key" to paste your public key into the textarea.

You should now be able to confirm everything works by testing the following:



Once you've entered your passphrase, you should see a message saying something like: "You've successfully authenticated, but GitHub does not provide shell access".

Create a config file for the EGit plugin

In the terminal



and create a file called config containing the following line:



Installing EGit

I'm guessing you already have Eclipse installed at this stage;

Go to Help > Install New Software and select Add to add a new site:

Add this as the location

http://www.jgit.org/updates/

And select the Plugin, then Next, then restart when Eclipse prompts you to.

Create a github repository

On your github home page, you can now create a new repository, give it a name, fill in the details and when done, you should see your Clone URL - should look something like this:


There will be a link next to it to copy it to your clipboard.

It will also provide step-by-step instructions for you to install and configure git, check out the project and make the first commit. Once this is done, you should be able to work with the project within EGit.

At the install stage, you may need to execute the script "setup PATH for non-terminal programs.sh" by selecting Open With, Other, select Enable All Applications, then go into Utilities and select terminal. Close all instances of the terminal and reopen, you should now be able to use git from the terminal.

Import the repository into Eclipse as a project

I used this as a starting point and would highly recommend you check it out if you want a more visual walk-through of the steps involved: http://github.com/guides/using-the-egit-eclipse-plugin-with-github

Right click on the project Explorer, select Import, expand the Git folder and select Git Repository and next.

Paste your Clone URL into the First field (URI) and it should complete most other fields for you.

Change the protocol to git+ssh and do not enter anything for the Authentication section (leave the User pre-filled as "git").

If everything is set up properly, you should get a prompt for a password - this is your passphrase from the earlier stage.

It should now locate the master branch you created when you followed the "Next Steps" section. Select it if you need to, then select Next. As there are no eclipse files in the project, uncheck "import projects after clone" and Finish.

Right click on the Project Explorer, New > General > Project, give it the same name as your repository. It should "create" your project in the Project Explorer (you should now see the README you created and committed).

Right click on your project folder in the Project Explorer, select "Team" and "Share Project". Select Git as the repository type and then next. Highlight your project and select Finish.

You should now be able to open the README in eclipse, make a change, save it and commit your changes.


Other related reading:
http://support.github.com/discussions/accounts/23-egit-github-auth-fail

Sunday 1 November 2009

VirtualBox - Changing the UUID of a .vdi file

Open the terminal, and: