Tag Archives: cli

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

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

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

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

Ignore whitespace in a Subversion diff

SubVersion It’s a common problem developers face – how can I see just the changes that have been made and ignore all the line ending changes? This tends to happen when you have members of your team committing changes when they have checked out the code onto different operating systems, be it Windows, Mac of Linux.

svn diff doesn’t really have a built in option for ignoring whitespace, but gnu diff does, and it is possible to use it within an svn diff command by using –diff-cmd

Continue reading