Tag Archive 'source code'

Jan 29 2014

HTTP Proxy Per Git Repository

Published by under Programming

I’ve finally made the switch to using Git instead of Subversion as the source control system at work.  I’ve been using it for a while with a couple of personal projects that I’ve got hosted on BitBucket using the wonderful SourceTree, created by my friend Steve Streeting, and I’ve come to prefer it to Subversion. At work, I set up a Stash server and have been syncing our Subversion repository into it for a while but never quite made the jump to Git until now.

The first hurdle I’ve hit is with proxy settings.  On my development machine I’ve got cloned BitBucket repositories and to be able to use those I need to connect through a proxy.  Thankfully SourceTree makes it easy to configure Proxy settings for Git.  However, these are system wide settings.  Now that I want to work with our internal Stash server I need Git to use the proxy for some repositories but not for the internal one.

Given that I’ve got lots of external repositories but only one internal repository I’ve left the Git default settings to use the Proxy server.  Unfortunately SourceTree doesn’t help with specifying a proxy for a single repository but it’s not hard.

  • Open the local repository in Explorer and head into the .git directory (you may need to show hidden files & folders)
  • Open up the config file in your favourite text editor
  • At the bottom of the [core] section of settings add the following:
    [http]
        proxy =
  • Save the config file.

That’s all there is to it.  You don’t even need to restart SourceTree for it to pick up the change.  This change is basically telling Git not to use a Proxy for this repository.  Alternatively, on the “proxy =” line you could specify a proxy to use, e.g. if you have lots of internal repositories and only one external then it would be easier to default the global settings to no proxy and only specify a proxy for just one repository.

Hope this helps!

No responses yet

Feb 08 2008

Character Counter

Published by under .NET,Software

Whilst reading an article I was curious about the number of commas and full-stops that the author used – when you become an editor of a newsletter you start to think about things like this.  After hunting around the various utilities on my system I discovered that I didn’t have anything that could easily do this.  So, I did what any self-respecting programmer would do and threw together a quick app to do it for me.

I have made both the source code and pre-compiled binary available for download under a BSD license (share, remix, no endorsement).  It is written in C# and requires the .Net 2.0 framework, if you want to compile the source you will probably require MS Visual Studio (Express should be ok), although it may work with SharpDevelop or Mono.

It is a console application (sorry, no pretty GUI this time) that reads the contents of input.txt (in the same directory as the app), it then counts the occurrences of each character and outputs the results to the console. Simple!

If you make any improvements to the code please leave a comment and/or email the changes to me: gringod [at] gmail [dot] com.

No responses yet