SOCKS Proxy over SSH on Windows using Putty

Here’s how you can setup a local SOCKS Proxy over SSH on Windows. Here we are using Putty.

1. Create a new Putty SSH session.

New Putty SSH Session

New Putty SSH Session

2. Setup the SSH tunnel. Add a source port with a dynamic destination. Here we are using the default SOCKS port 1080.

SSH Tunnel

SSH Tunnel

3. To change your local network settings, go to Internet Properties and enable the proxy server setting.

Enable Proxy Server Setting

Enable Proxy Server Setting

4. If you are a Firefox user, you can change just the Firefox connection settings.

 

Firefox Connection Settings

Firefox Connection Settings

5. If you have Java code that needs to go through the SOCKS proxy, you can set the following System properties.

System.getProperties().put("socksProxyHost", "localhost");
System.getProperties().put("socksProxyPort", "1080");

Setting Up Jenkins on Red Hat 6.5

We recently set up a new Jenkins installation on Red Hat development box. Here are the steps.

1. SSH into the Red Hat server.

2. Setup need root access, so use either sudo, or login or su as root. Here we are running the su command.

> su root

3. Add Jenkins to your Yum repository, then install Jenkins.

> wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
> rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
> yum install jenkins

4. Jenkins runs on port 8080 by default. Port 8080 is a common port used by other applications so we are going to change it to 8081 instead. We’ll also disable AJP since we don’t need it.

> vi /etc/sysconfig/jenkins
...
JENKINS_PORT="8081"
...
JENKINS_AJP_PORT="-1"

5. We were getting an “java.lang.UnsatisfiedLinkError” error when we tried to start Jenkins. The fix is to change the tmp directory.

> vi /etc/sysconfig/jenkins
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Djava.io.tmpdir=$JENKINS_HOME/tmp"
> mkdir /var/lib/jenkins/tmp
> chown jenkins.jenkins /var/lib/jenkins/tmp

6. Start Jenkins. Tail the log just to make sure things are okay.

> service jenkins start
> tail -f /var/log/jenkins/jenkins.log

7. Open a browser and go to the freshly installed Jenkins instance.

http://server:8081

7. To stop or restart Jenkin, run these

> service jenkins stop
> service jenkins restart

Mapping SharePoint to a Windows Drive

Use the “net use” command to map SharePoint to a local drive. You need local network access to SharePoint, so you either need to be in the office or connected via VPN.

net use DRIVE: \\SHARE_POINT_HOST@ssl PASSWORD /user:USERNAME