• Mac OS X,  Mac OS X Server,  Programming

    opendiff

    There is a little tool in OS X called opendiff. This command can be used to bring up a quick and dirty graphical view of changes in a file. For example, if you run opendiff followed by two file names, you’ll see what’s different in the two files and what’s the same: opendiff test test1 The result then looks as follows. Note that in the above screenshot, a and b are in white lines and the others are grey, as those are consistent in the two files and the c has been removed and replaced with the four lines on the left. In larger files, this is pretty useful as…

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment

    Hide Safari’s Bookmarks Bar

    Safari has a bookmarks bar. Some people want to hide it. A lot of people used to do stuff like this by modifying the default user template in OS X. Not something we’ll be doing much in the future. So to do so with a script: defaults write com.apple.Safari ShowFavoritesBar -bool false To turn it back on: defaults write com.apple.Safari ShowFavoritesBar -bool true

  • Mac OS X,  Mac OS X Server,  Mac Security,  Ubuntu,  Unix,  VMware

    Show Line Numbers When Viewing A File

    The nl command is used to show line numbers when viewing a file (unless you use the -b option along with an n, which seems to be one of the more pointless things to ever do at the command line, but then what do I know…). So if you’d like to see the line numbers for a file called xsbackup.sh: nl xsbackup.sh The output would look like this: 1 # 2 #!/bin/bash 3 # 4 # Script Name: Or at least, that’s how I used to do it. For decades I never noticed that cat had a -b option. So if you’d like to use cat to see line numbers…

  • Mac OS X Server,  Mac Security,  Mass Deployment

    Logs, Scripts and OS X Mountain Lion Server

    OS X Mountain Lion has a lot of scripts used for enabling services, setting states, changing hostnames and the like. Once upon a time there was a script for OS X Server called server setup. It was a beautiful but too simplistic kind of script. Today, much of that logic has been moved out into more granular scripts, kept in /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup, used by the server to perform all kinds of tasks. These scripts are, like a lot of other things in Mountain Lion Server. Some of these include the configuration of amavisd, docecot and alerts. These scripts can also be used for migrating services and data, such as /Applications/Server.app/Contents/ServerRoot/System/Library/ServerSetup/MigrationExtras/30-ipfwmigrator. Sometimes the scripts…