Git Alias / Shorthand commands

So today I made the switch to use GIT over SVN for all of my personal projects because we’ve been using it at IPC Media for months. One of the most useful things I’ve found is the ability to set up aliases for command commands, because let’s face it all developers want is to do the same job with less key presses.

Continue reading Git Alias / Shorthand commands

When svn merge doesn’t quite cut it

Anyone that works with subversion will know that merging 2 branches is not always easy. Most of the time there is no issue, and you can merge one or multiple changes from one branch to another, but sometimes you end up with conflicts left right and center. This is done with the standard merge commands:

Continue reading When svn merge doesn’t quite cut it

svn diff via vim

When I’m reviewing the changes I’ve made to an svn checkout I prefer to see the changes in colour. This would be very easy if I was someone that used a graphical editor, but I’m one of those people that prefer to use vim, or vi if I really have to. As a result I had to think of a way of changing svn diff into something that was easy to read. I found out that vim has a syntax highlight template for diff files, so it got me thinking. What about pushing the diff into a file and then viewing the file in vim.
Continue reading svn diff via vim

Magic 8-ball written in bash

Have you ever wanted a magic 8ball to use at work? A real one, even though nice to have on your desk, is not always practical. When I had a real one on my desk people were forever playing with it when they came to talk to me.

Making one is very simple. All you need is an array of values to use as responses, and a way to pick one of them at random. I could have written this in any number of languages, but this one is written in bash for simplicity.

Continue reading Magic 8-ball written in bash

Time saving tricks with svn and grep

SubVersionWe’ve all been there, you’re working on a project with lots of externals and we see a lot of noise when you run svn status or svn st (depending on your preference). Most of the time we just filter that out, but I decided to string a few grep statements together to make the output that little bit nicer to read.

Continue reading Time saving tricks with svn and grep

Marking files so that the root user cannot change them

I was having a discussion with one of the SysAdmins at work yesterday and we were talking about a system we use called puppet. I wanted to know if there was a way of making changes to one of the files currently under the control of puppet for testing purposes without stopping the puppet daemon. He pointed me in the direction of of the chattr and lsattr binaries.

These binaries allow you to mark any file on the machine as immutable or list the immutable status. If a file becomes immutable it means that not even root can delete or modify the file unless it removes the immutable flag first.

Continue reading Marking files so that the root user cannot change them

Tricks with SVN and Brace Expansion

SubVersionThere are loads of little tips and tricks out there on how to make your svn operations a little easier. One which I found out recently was how to leverage bash’s brace expansion to reduce key strokes.

Brace expansion definition

This powerful feature makes svn diff commands a lot easier.

Continue reading Tricks with SVN and Brace Expansion

iTerm2 – the new alternative to Terminal for Mac OS

Almost all command line users on Mac should be familiar with iTerm – which is a free replacement to the standard terminal application. However this tool now has a big brother in the pipeline called iTerm2.

iTerm2 is a fork of the original iTerm project and for most part, they are the same, but iTerm2 has a considerable number of improvements over it’s predecessor.

Continue reading iTerm2 – the new alternative to Terminal for Mac OS