Jenkins publish over ssh - parameterized

To have a jenkins job which acts on a remote server via ssh - and has a parameter to choose which server(s) to use.

Read more

git files with local changes I don't want committed

I'm working on a project where I find I want to semi-regularly adjust a config file for local testing, but want to be sure I don't commit that file by mistake.

Seems the best approach is

git update-index --skip-worktree $filename

This tells git to skip this file when I push, if the remote file changes it will warn me

To switch back

Read more

headless VPN on linux with minimal VPN traffic and selective DNS

I needed to setup a VPN client connection on a headless system where the VPN is slow and so I want to route the minimal amount of traffic through it. I need DNS to use the VPN but only for one domain.

This is my setup using pptp and dnsmasq (tested on centOS)

Basic VPN config is here /etc/ppp/peers/office

Read more

Puppet - apache virtualhost Docroot provided by rpm

This has been annoying to work out.

The puppet apache module will by default create the document root for a virtualhost if it is not already defined. But since I wanted the documentroot to be managed by a custom RPM I don't have a reference to the actual directory in puppet.

Read more

Eclipse hangs

This worked for me today - saving it here so I can find it again

http://off-topic.biz/en/eclipse-hangs-at-startup-showing-only-the-splash-screen/

Read more

Reinstall grub after windows breaks it

One of those things that happens from time to time on a dual boot system...

Windows breaks grub, usually if I've reinstalled windows, this can lead to a unbootable system.

Boot from a Ubuntu (or other distro) live disk or USB stick.

Figure out which your disks and partitions are.

sudo mount /dev/sdXY /mnt
# if there is a boot partition
sudo mount /dev/sdUV /mnt/boot
sudo grub-install --recheck --root-directory=/mnt /dev/sdZ

When you reboot grub should be back to normal.

Read more

mini scripts to obtain git id/branch/tag


$new_branch=$1 # passed as param

current_branch="$(git symbolic-ref HEAD 2>/dev/null)"
current_branch=${current_branch##refs/heads/}

current_id=$(git rev-parse --short origin/$current_branch)

new_id=$(git rev-parse --short origin/$new_branch)

last_tag=$(git describe --abbrev=0 --tags)

Read more

Git submodules and subtrees

Git has the concept of both submodules and subtrees, there seem to be some problems with each solution, nether being well loved as far as I can see.

Both add significant complexity to a project, and require extra care - but the alternative is monolithic projects or a lot of copy-pasting.

Read more

Vagrant / Puppet project to setup a RPM build server and custom yum repository

I've published a project on github https://github.com/practicalweb/vagrant-rpmbuild

The project contains a Vagrant config file, and Puppet manifests that together with an appropriate basebox will create a VM setup to build RPMS and host them on a Custom Yum repository

To run this

  1. Install vagrant http://vagrantup.com/ (on Ubuntu just apt-get install vagrant)

Read more