Tuesday, February 14, 2012

Using Msysgit and Connect on Windows to work with fluxflex.com via a proxy

Before you do this, ask yourself the following question. Why?
No seriously.

  Why?

Now that you've convinced yourself that you are too lazy to install a copy of Linux, let's move on.

The instructions below explain how to do this at the University of the West Indies Mona campus using one of their internal proxies (scalpel,proxy-cluster,proxy3, razor or sword). All of these proxies run on port 8080, if you are using a different proxy and a different port you will need to adjust the instructions accordingly.

Preparation:
1. Install MsysGIT http://code.google.com/p/msysgit/
2. Download connect.exe and place it in your Windows folder (probably c:\Windows) http://dl.dropbox.com/u/1004432/connect.exe
3. Configure ssh to work via the proxy. The steps are detailed below

Configuring SSH/Git to work behind a proxy
Launch git bash:


You will see something like this:
Make sure that the 'connect' command is installed by entering the command 'connect'. You should see something like this:
If the connect command does not work go back to step 2 and make sure you get installed.

Next we need to create our shared keys, you can use the following command:

      ssh-keygen

You should get the following output (press enter at all questions, there is no need for a passphrase):

Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/David.David-TempPC/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

To check that your key has been properly generated use command:

   notepad  ~/.ssh/id_rsa.pub

You will see something like this:
You'll need this later (yes it is supposed to be a single line!, unless you turn on text wrapping).

When you close notepad you will be returned to gitbash.

To create a new ssh config file we will run the following commands:

     touch ~/.ssh/config
     notepad ~/.ssh/config

Enter the following text in notepad then save and exit it:

Host *
   ProxyCommand connect.exe -H scalpel:8080 %h %p


That's it.
Warning (this configuration means that msysgit will not work when you are not behind this proxy)
Just remove the ProxyCommand or comment it out when you are not behind a proxy.

Day to day usage:
Just launch gitbash and use it, git and ssh should work (at UWI this requires communicating with servers that run on port 443, we'll look at fluxflex (a service that runs ssh/git as a service on port 443)

Signing up with Fluxflex.com:  
Register an account with http://fluxflex.com
../_images/flux-new-project.png

Registering a Public Key with Fluxflex.com

You will have already created your public key. 
Launch gitbash and run the following command:
     notepad  ~/.ssh/id_rsa.pub

Copy the text that shows up in notepad:

 Then paste the resulting output to your fluxflex key list by going to “Plan & Settings” > “Public Keys” > “SSH Public Keys List” and click “Save”.
../_images/fluxflex-add-key.png

 Starting a new project with Fluxflex
The following instructions assume that you have configured the proxy and the shared keys, they are based on the standard fluxflex instructions.
  1. Log in to your fluxflex account and “create a new project”. 
  1. You can check out your new project by name using git. 
    Launch gitbash and clone your project. For example if your project is called yourprojectname:
    git clone ssh://git@git.fluxflex.com:443/yourprojectname

    If you want to confirm the proper procedure, go to “Setup” > “Git” and copy the code for downloading your project.
../_images/flux-gitsetup.png







No comments:

Sign up for my upcoming Plone 5 Book & Video tutorials

plone 5 for newbies book and videos