Arif’s Scratch Pad

Different Methods of Tunneling Through a Gateway

Problem

We have a host that we want to get to, through a gateway machine; i.e. we have a hop to get to the machine that we need to work on

1
ssh gw01

Then from that machine, we log onto another machine

1
ssh mgmt01

We would like to just run one command from the command line, to get directly onto mgmt01

The Mysteries of Anaconda and Kickstart

Problem

At work, I was trying to get a node installed remotely through kickstart such that I can create the partition table in a specific order. Unfortunately anaconda does not allow us to do that, and you could get disks partitioned not necessarily in the same order. i.e. I wanted the below

  1. partition 1 == 10M
  2. partition 2 ~ 50M with raid 2 across all 8 disks, with 6 Hot Spares
  3. Partition 3 ~ 50G with raid 5 across all 8 disks, with 1 Hot Spare
  4. Partition 4 everything else

The Wonders of Gitlab

This is probably my first proper blog post, so here goes.

Over the last few years, I have accumulated many git and svn repositories for work and personal projects, and have always looked for a web GUI, and source code management, that all fitted nicely. In this time I have used SVN with webdav, and websvn which worked really well, but unfortunetely died to death, as multi-user integration wasn’t there, and therefore colleagues in my team could not effectively contribute to the projects.

Many months later, I discovered git, due to my exploits of android development, and started using gitorious, and again this was great at the time, not knowing any different. When I started working with CyanogenMod, I got introduced to github, where the whole project was being hosted. This is where most of my projects were hosted with respected to android. On the other end, my company projects were hosted privately using gitweb, git-daemon and ssh on a local server in our offices.

Ubuntu/debian Locale Issues

If you ever have an issue similar to below on debian or ubuntu

1
2
3
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LANG is en_GB.UTF-8
svn: warning: please check that your locale name is correct

then run the following command to fix the problem, obviously choosing your locale, in my case for debian wheezy, I chose 122, which was en_GB.UTF-8

1
dpkg-reconfigure locales

Self Sign Certificate

First create a Private Key to sign the certificate

1
openssl genrsa -des3 -out server.key 1024

Create CSR

1
2
3
openssl req -new -out arif-ali.csr -key server.key \
-subj "/C=GB/ST=South Yorkshire/L=Sheffield/O=Example Inc/OU=Web Dept/CN=example.com" \
-out server.csr

Decrypt the private key

1
2
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key

Sign the Certificate with the private key

1
2
openssl x509 -req -days 365 -in server.csr -signkey server.key \
-out server.crt