Using git over proxy

I was trying to clone the thrift repository at a clients office when this problem occurred.
Upon some Googling, I got this really useful link (thanks to Emil Sit)
which explained how git can be used over an http proxy for those git servers
which don’t allow http method as an alternate/bypass to the git protocol.

Okay, so here’s what’s needed to be done;

  • Typed in the below lines (quoted) into a shell script called git-proxy and put it in $(HOME)/bin directory.
    Of course; its executable bits has to be set with: chmod a+x $(HOME)/bin/git-proxy.

    # Use socat to proxy git through an HTTP CONNECT firewall.
    # Useful if you are trying to clone git:// from inside a company.
    # Requires that the proxy allows CONNECT to port 9418.
    # Save this file as gitproxy somewhere in your path
    # (e.g., ~/bin) and then run
    # chmod +x git-proxy
    # git config --global core.gitproxy git-proxy
    # Configuration. Common proxy ports are 3128, 8123, 8000.
    exec socat STDIO PROXY:$_proxy:$1:$2,proxyport=$_proxyport

    Note: I replaced with appropriate proxy-server details
    for my organization and the value for _proxyport with an appropriate value
    used in my organization (instead of the default 3128).

  • Installed the package socat with the command; sudo apt-get install socat
  • Ran the command git config –global core.gitproxy git-proxy to configure ‘git’ to use the git-proxy.
  • With the http_proxy environment variable already set using:
  • export https_proxy=

    I could now use git and get the repositories without any problems.

Redhat developer toolset 1.1

Tru Huynh of has built the redhat developer toolset 1.1, for centos and it contains gcc 4.7.2

So you could simply use his repo and install just gcc, instantly.

cd /etc/yum.repos.d
yum --enablerepo=testing-1.1-devtools-6 install devtoolset-1.1-gcc 

This will install it most likely into: /opt/centos/devtoolset-1.1/root/usr/bin/

Then you can tell your compile process to use the gcc 4.7 instead of 4.4 with the CC variable

export CC=/opt/centos/devtoolset-1.1/root/usr/bin/gcc  
export CPP=/opt/centos/devtoolset-1.1/root/usr/bin/cpp
export CXX=/opt/centos/devtoolset-1.1/root/usr/bin/c++

Also, worth noting; that instead of setting individual variables you can do
 scl enable devtoolset-1.1 bash
(it just starts new shell with all the appropriate variables already set).

How to install Maven on CentOS

Apache Maven is a project management software, managing building, reporting and documentation of a Java  development project. In order to install and configure Apache Maven on CentOS, follow these steps.

First of all, you need to install Java 1.7 JDK. Make sure to install Java JDK, not JRE.

Then go ahead and download the latest Maven binary from its official site. For example, for version 3.0.4:

$ wget
$ sudo tar xzf apache-maven-3.0.5-bin.tar.gz -C /usr/local
$ cd /usr/local
$ sudo ln -s apache-maven-3.0.5 maven


Next, set up Maven path system-wide:

$ sudo vi /etc/profile.d/
export M2_HOME=/usr/local/maven
export PATH=${M2_HOME}/bin:${PATH}

Finally, log out and log in again to activate the above environment variables.
To verify successful installation of maven, check the version of maven:

$ mvn -version


Optionally, if you are using Maven behind a proxy, you must do the following.

$ vi ~/.m2/settings.xml