Fast User Switching from the command line on a Mac

It seems that some IT departments like to lock out the fast user switching option on company laptops in a lot of companies at the moment. This became a problem for me as I have a local admin account on my work machine, and I have to switch to it whenever I want to install from a dmg file. This got me thinking, is there a command line argument or tool that I could run to do this? Sure enough there is. The only thing you need to look up is the UserId for the user that you want to switch to.

Continue reading Fast User Switching from the command line on a Mac

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

Happy 20th Birthday Vim

Today marks the 20th anniversary of Vim, one of the most powerful and versatile command line text editors around. I’ve been a happy Vim user since I was at Uni. It’s installed on almost all every server I’ve used, and can be customised with lots of little scripts making it as useful as any GUI editor.

Two decades of productivity: Vim’s 20th anniversary (ars technica)

Transparent SSH keys – ways in which they can be useful

I’m sure you’ve read time and time again that ssh keys without a passphrase are bad, and that they should never be created, because they create an easy attack onto your system should someone get hold of your ssh public and private key pair somehow. However I find them very useful when accessing the development boxes at work, and I’m sure that anyone else who has to connect to multiple development servers or any internal servers come to mention it will agree; one less password / passphrase saves so much time. Be it connecting to the server to find a file, or scp’ing a file somewhere, or to run some remote command.

Continue reading Transparent SSH keys – ways in which they can be useful

Using grep, awk and sed to list files containing a string

This week I was trying to locate which files in the codebase use a specific class method while debugging some code. This method however has been used a lot, when I say a lot I mean 10 to 20 times per file, and in lots of templates. This is mainly because it is a template helper to generate complex links within the page. Anyway, a simple use of grep wasn’t all that much help, so I refreshed my memory on how to use sed to make the output a little more readable.

Continue reading Using grep, awk and sed to list files containing a string

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

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

Vi Help Sheet (Liquidicity)

Today I found one of the nicest Vi Help Sheets I’ve seen in a long while. I came by this via Smashing Magazine and just had to include it on here. Most people who know me know I’m one of those odd developers would still does the bulk of their development work using VIm as I find the speed it offers unparalleled. Continue reading Vi Help Sheet (Liquidicity)