• Articles and Books,  Mac OS X

    Self Control for Mac OS X

    I’m an author (well, an engineer who writes about what I do). And when I’m writing I need privacy, peace and quiet – so I can focus. I recently realized that I write the best on airplanes where there’s no wireless, no Internet and no calls. I can just put on my headphones and sit with man pages and virtual machines and crank away. Now there’s an app that can help me to mirror that experience. Self Control allows me to block access to mail and the web, almost mirroring (minus the phone and baby and other distractions) that which I have on an airplane. So why not just unplug…

  • Mac OS X,  Mac Security

    Command Line ALF on Mac OS X

    Mac OS X 10.5 and Mac OS X 10.6 have a multitude of ways to keep data from coming or going from a system. The traditional way is to use ipfw, although this isn’t the default way in 10.5 and above. Instead, you are meant to use the Application Layer Firewall (we’ll call it ALF for short), which is what you configure from the Security System Preference pane. You can enable the firewall simply enough by using the defaults command to augment the /Library/Preferences/com.apple.alf.plist file, setting the globalstate key to an integer of 1: defaults write /Library/Preferences/com.apple.alf globalstate -int 1 You can also configure the firewall from the command line.…

  • Mac OS X

    Spotlight Keystrokes

    Spotlight has a nifty integration of keystrokes (or the Command keystroke at least).  Simply perform a search and then use the Command key in combination with an arrow to move and up and down in search results based on section rather than line item.  Additionally, that Command key can be used in conjunction with the Enter key so that when you open an item in the Spotlight results, it actually just displays the directory so you can then open the file in the Finder (and subsequently access other files in those directories as needed).

  • Mac OS X,  Mac OS X Server,  Mac Security

    Quick and Dirty md5

    A hashing function is used to calculate a hash value.  If you insert a file into a hashing function then it should produce a value that is almost certain to be unique (there’s always the remote likelihood that no matter how good your function, you may end up with a duplicate).   The openssl command is used to access a number of functions/ciphers including sha1, base64, md5, rc4/rc5 and of course des/des3.  It is a very simple command to use, simply provide the cipher, followed by the path to the file you would like to get a hash value (aka digest) for.  So if I have a file called myfile.txt and I…

  • Mac OS X

    Mac OS X Startup Modifier Keys

    Mac OS X can boot differently than to your default startup disk with the use of modifier keys. When you power a system on, using these keystrokes will send commands to the system to perform the following: C – Boot to optical media. D (with restore disk in optical slot) – Boot to hardware test mode. Command-Option-O-F – Boot to OpenFirmware (if you have open firmware). Command-Option-P-R – Reset Parameter RAM. Command-Option-P-R (until you hear two tones) – Reset non-volatile RAM. Command-Option-N-V – Reset non-volatile RAM (similar to above according to hardware). Command-Option-Shift Delete – Bypass the default startup volume and look for another blessed volume. Command-Option-T-V – Boot that…

  • Mac OS X,  personal

    Richard Stallman is Kinda' Weird

    In the /usr/share/emacs/22.1/etc directory (you can sub your version for the one listed here) you have a collection of very interesting files, musings written by Richard Stallman. Because emacs is open source, these files are in all default implementations of the emacs source code. Now I’m one to occasionally pontificate and write completely random musings, but mine aren’t in pretty much every default installation of all operating systems with Unix underpinnings (including Mac OS X) like Stallman’s are. For example, Stallman has a very nice recipe for cookies (that I’ve actually used) in a file called COOKIES in this folder. There’s also a man page for sex.6 here, which provides…

  • Mac OS X,  Mac Security,  Mass Deployment

    Mac OS X: User Templates

    New users on a Mac have a certain set of default settings that are copied into their user profiles the first time they log in from the contents of the /System/Library/User Template/English.lproj directory.  You can drop files into this directory or edit files that are already there that will then be copied into new accounts when they’re created, allowing you to customize the look and feel, default documents, fonts and other aspects of user accounts without having to do so each time a new user is created or logged into a system.   This can be incredibly useful for scenarios where you are not using network accounts or mobile accounts…

  • Mac OS X

    Mac OS X: Changing Locations from the CLI

    The scselect command only does one thing.  Open up your System Preferences and click on the Network System Preference pane.  Create a new location called test and then put your system back to the old location (obviously don’t do crap like this on a production server or anything like that).  Now fire up Terminal and type the following command: scselect test Provided your location was called test you should see your Network System Preference pane update immediately with the new information.  Now let’s say that you wanted to defer the new location to become active until you reboot next.  Apple included the one and only option for scselect as the…

  • Home Automation,  Mac OS X

    Wake-on-Magic-Packet

    Wake-on-Magic-Packet, WOMP is pretty much Wake-on-LAN. Essentially, WOMP allows a network interface to be active even when the computer is asleep. Then, when it gets a specially formatted packet, which we call the magic packet (’cause turning something on when it’s sleeping without hitting a button is pretty cool, right?!?!) can be sent to the IP of the system to fire it up. The magic packet is a packet where the packet payload consists of 6 bytes worth of ones in a row followed by the computers MAC address repeated 16 times. You can enable WOMP for OS X using the Options tab of the Energy System Preference pane. Simply…

  • Mac OS X

    Disabling Dashboard

    The other day I saw someone remove the Dashboard icon from the Dock as a way of disabling it entirely.  Probably not the best route.  It’s pretty easy though.  The command to disable: defaults write com.apple.dashboard mcx-disabled -boolean yes And of course if you’ve disabled, you might want to turn it back on using this handy-dandy double-negative: defaults write com.apple.dashboard mcx-disabled -boolean no