<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MichaelPrewitt.com &#187; hacks</title>
	<atom:link href="http://michaelprewitt.com/tag/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelprewitt.com</link>
	<description>Bits of this and that</description>
	<lastBuildDate>Mon, 18 Apr 2011 21:20:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>OS X: Create a Command to View UNIX &#8220;man&#8221; Pages as PDFs</title>
		<link>http://michaelprewitt.com/2010/02/os-x-create-a-command-to-view-unix-man-pages-as-pdfs-1833/</link>
		<comments>http://michaelprewitt.com/2010/02/os-x-create-a-command-to-view-unix-man-pages-as-pdfs-1833/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 16:56:08 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://michaelprewitt.com/?p=1833</guid>
		<description><![CDATA[A website tipped me off to a Terminal command that lets OS X users (the geekier ones) view UNIX &#8220;man&#8221; pages* as PDFs. However, since the command is long, it would be hard to remember and difficult to type. I &#8230; <a href="http://michaelprewitt.com/2010/02/os-x-create-a-command-to-view-unix-man-pages-as-pdfs-1833/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://gnarlodious.com/Computer/MacOsx">website</a> tipped me off to a Terminal command that lets OS X users (the geekier ones) view UNIX &#8220;man&#8221; pages* as PDFs.</p>
<p>However, since the command is long, it would be hard to remember and difficult to type. I wanted to make an alias (a custom UNIX command) that would be shorter, but Bash (the default terminal in OS X) does not allow aliases to accept arguments (variables), which is critical to making this work.</p>
<p><span id="more-1833"></span></p>
<p>I found a way to create a custom command that does this. Here are the steps:</p>
<ol>
<li>Edit your ~/.bash_profile with your favorite text editor</li>
<li>Add this line:
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">manpdf () { man -t $1 | open -f -a Preview.app ; }</div></div>
<p>(You could call it something other than &#8220;manpdf&#8221; if you want; you may also want to add a comment to remind yourself what it does.)</li>
<li>Save it</li>
<li>Try it: Open Terminal and type:
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">manpdf ping</div></div>
</li>
</ol>
<p>Enjoy!</p>
<p>*For newbies: The &#8220;man&#8221; command lists instructions — &#8220;manuals&#8221; — for various UNIX commands. For example, if you wanted to know how to use the &#8220;ping&#8221; command, you could open Terminal and type &#8220;man ping&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelprewitt.com/2010/02/os-x-create-a-command-to-view-unix-man-pages-as-pdfs-1833/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Mac OS X Leopard Even Better</title>
		<link>http://michaelprewitt.com/2009/08/making-mac-os-x-leopard-even-better-1539/</link>
		<comments>http://michaelprewitt.com/2009/08/making-mac-os-x-leopard-even-better-1539/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 23:45:32 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://michaelprewitt.com/?p=1539</guid>
		<description><![CDATA[Apple&#8217;s OS X Leopard (version 10.5) is a great operating system, clearly their best yet. Nevertheless, there are ways to make it even better. This is my short collection of favorite tips. In this collection, I am focusing on general &#8230; <a href="http://michaelprewitt.com/2009/08/making-mac-os-x-leopard-even-better-1539/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s OS X Leopard (version 10.5) is a great operating system, clearly their best yet. Nevertheless, there are ways to make it even better. This is my short collection of favorite tips. In this collection, I am focusing on general usability—things that enhance Finder and your general workflow. I&#8217;ve added a few general purpose apps that make working with OS X easier.</p>
<h2>Customize your Finder toolbar.</h2>
<p><span id="more-1539"></span></p>
<p>This is what my Finder toolbar looks like:</p>
<p><img class="alignnone size-large wp-image-1617" title="My Finder toolbar" src="http://michaelprewitt.com/wp-content/uploads/2009/08/Picture-32-450x52.png" alt="My Finder toolbar" width="450" height="52" /></p>
<p>The second button (which is one of the optional default ones available) gives you easy access to the folder hierarchy. I also added a shortcut to my home folder, and a shortcut to the awesome <a href="http://www.versiontracker.com/dyn/moreinfo/mac/12497">Open Terminal Here </a>app (which opens a Terminal with the path set to the current folder — mainly useful for those who like to do UNIX stuff). You can add any folders or files that you like. And there are various pre-designed buttons that you may find useful.</p>
<p>To customize, right-click on the toolbar, and choose &#8220;Customize Toolbar&#8230;.&#8221; Or from the Finder menu, choose View &gt; Customize Toolbar&#8230;. And then drag buttons on or off as you like. To add your own folders or files, drag them from another Finder window onto the toolbar.</p>
<h2>Add one or more &#8220;recent/favorite things&#8221; stacks to your Dock.</h2>
<p>You probably already know you can add folders to your Dock, in the space right next to the Trash. You probably also know that those folders appear as &#8220;stacks&#8221; — an OS X term for pop-up folders — and that there are various ways you can customize the display of stacks.</p>
<p>What you probably didn&#8217;t know is there are some special stacks — Recent Applications, Recent Documents, Recent Servers, Favorite Volumes, Favorite Items — which you can create only by following these super-secret steps:</p>
<p><a href="http://www.macosxhints.com/article.php?story=20071101055329470">http://www.macosxhints.com/article.php?story=20071101055329470</a></p>
<p>In summary, fire up Terminal and paste in the following code (and then press enter):</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">defaults write com.apple.dock persistent-others -array-add '{ &quot;tile-data&quot; = { &quot;list-type&quot; = 1; }; &quot;tile-type&quot; = &quot;recents-tile&quot;; }'</div></div>
<p>To see the new stacks, restart the Dock with this commend in Terminal:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">killall Dock</div></div>
<p>Like magic, your Dock will restart, and a new stack will appear. By default, it will be a Recent Applications stack. If you want to try another type, right-click on the stack and choose which kind you want from the options displayed.</p>
<p>The <strong>Recent Applications/Documents/Servers</strong> selections give you a list of the most recently accessed/used items in each category; in other words, it gives you stack versions of the same things you find in the Apple &gt; Recent Items menu. <strong>Favorite Volumes</strong> gives you the items in the Finder sidebar in the &#8220;Devices&#8221; section. <strong>Favorite Items</strong> gives you the items in the Finder sidebar &#8220;Places&#8221; section.</p>
<p>All of these stacks are dynamic; they automatically update to reflect your latest recent/favorite items.</p>
<p>If you want more than one, simply run the Terminal commands again; each time you run them, you&#8217;ll get another &#8220;recent/favorite things&#8221; stack.</p>
<h2 style="font-size: 1.5em;">Add Dock dividers.</h2>
<p>If you have lots of icons in your Dock, it can help to separate them into logical categories. A Dock divider can help. There are basically two ways to do this:</p>
<p><strong>Option 1. Insert a divider icon into your dock.</strong> You can download some pre-made ones, such as <a href="http://www.artofadambetts.com/weblog/?p=35">Dock Dividers</a> or <a href="http://www.macupdate.com/info.php/id/19733">Dock Separators</a>. Or if you have some creative flair, you can make your own (caveat: the divider must be an app or at least have an .app extension, or OS X won&#8217;t let you add it to the Dock; modifying one of the dummy apps in the pre-made dividers above is an easy way around this). When done, it looks like this (the animation shows various styles you can choose from; they&#8217;re not actually animated):</p>
<p><img class="alignnone size-full wp-image-1598" title="DockDividers" src="http://michaelprewitt.com/wp-content/uploads/2009/08/DockDividers.gif" alt="DockDividers" width="395" height="100" /></p>
<p><strong>Option 2: Use Leopard&#8217;s oh-so-secret hidden command</strong> to add space between groups of icons. To do that, run this command in Terminal:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type=&quot;spacer-tile&quot;;}'</div></div>
<p>To see the spacer, restart the Dock with this commend in Terminal:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">killall Dock</div></div>
<p>Once the spacer appears, you can drag it around. To remove it, simply drag it off the Dock.</p>
<h2>Add Activity Monitor to your dock.</h2>
<p>This application is found in the Utilities folder, in your applications folder. It is very handy for seeing which applications or processes are hogging your memory or your processor, and also allows you to quit (or force quit) them easily. It will even show you hidden processes (applications and such) that do not appear in the Dock.</p>
<p>It also has all kinds of cool little graphs (memory, drive space, network activity), and you can make its Dock icon show some of those charts in real time.</p>
<h2 style="font-size: 1.5em;">Add the Keychain Access icon to your menu bar.</h2>
<p>This menu bar icon gives you quick access to several things, but the most useful is the first item in the list when you click on it: Lock Screen. This will immediately activate your screen saver; and assuming you have set up a password for your user account, that password will be required to exit the screen saver. This is very handy when you have a computer in a shared environment, and you want to leave the room without leaving your computer open for others to poke around in; or if you are running an important computer task that you don&#8217;t want to be interrupted by your children, significant other, or pet.</p>
<p>To add it, launch Keychain Access (in the Utilities folder), go to Preferences, General tab, and tick the checkbox for &#8220;Show Status in Menu Bar.&#8221;</p>
<h2 style="font-size: 1.5em;">Install Default FolderX .</h2>
<p><a href="http://www.stclairsoft.com/DefaultFolderX/">Default Folder X</a> ($34.95) makes getting around the files and folders on your computer so easy. I don&#8217;t know how I could get along without it.</p>
<p>Most significantly, from within any application&#8217;s save or open dialog, it allows you to navigate to any open folder just by hovering your mouse over that folder for a second or two, and then clicking. This saves a tremendous amount of tedious clicking to find a folder that you already have open.</p>
<p>Default Folder X adds a translucent side menu to every file dialog box, which looks like this:</p>
<p><img class="alignnone size-full wp-image-1601" title="Default Folder X side menu" src="http://michaelprewitt.com/wp-content/uploads/2009/08/Picture-1.png" alt="Default Folder X side menu" width="77" height="283" /></p>
<p>These icons give you ways to access recent folders and favorite folders from any open or save dialog; set default folders for individual applications; open select folders in Finder; create, reveal, rename, move, delete, and get info on both files and folders; switch to any open Finder window; and set favorite folders. All this from within any file dialog box!</p>
<p>It also gives you this row of buttons beneath each file dialog box, which allow you to preview file contents, get information on the file, set Finder comments, apply meta tags, and view or change file permissions.</p>
<p><img class="alignnone size-large wp-image-1602" title="Picture 2" src="http://michaelprewitt.com/wp-content/uploads/2009/08/Picture-21-450x25.png" alt="Picture 2" width="450" height="25" /></p>
<p>If you work with files a lot, you know how tedious it can be to do some of these things when you are forced to switch back and forth between an application and Finder. With Default Folder X, you can do it all on the fly when you are opening or saving a file.</p>
<p>This program also gives you the options of a menu bar icon and a special icon you can put in your Finder toolbar, to perform the same functions.</p>
<h2 style="font-size: 1.5em;">Install LaunchBar or QuickSilver.</h2>
<p><a href="http://www.obdev.at/products/launchbar/index.html">LaunchBar</a> ($24.00) — not free, but more powerful; what I use</p>
<p><a href="http://www.blacktree.com/">QuickSilver</a> (freeware) — works well, is free, and you can change the &#8220;look and feel&#8221; of it</p>
<p>These apps make launching applications and working with files on your computer super easy. For example, say you have a rarely used program called Super Widget on your computer. One day you need it. Instead of hunting for it, you could simply call up LaunchBar or QuickSilver by hitting the activation command (Cmd-Space by default, but this can be changed), and then type &#8220;sw&#8221; (s for super, w for widget). Both programs will give you a list of apps that match &#8220;sw&#8221;, and both will learn from your past use. Select the app, if it&#8217;s not the main one listed, and press enter. All this can be done in about two seconds, which is much faster than doing it the hard way.</p>
<p>Both apps let you do much more complex tasks, and explaining all that is beyond the scope of what I can do here. Try them out!</p>
<h2 style="font-size: 1.5em;">Install Isolator.</h2>
<p><a href="http://willmore.eu/software/isolator/">Isolator</a> (freeware) does one thing very well: It grays out background applications and windows, so you can focus on the one thing you are trying to do.</p>
<h2>Install Dockables.</h2>
<p><a href="http://getdockables.com/">Dockables</a> (freeware) adds cool little icons to your dock to easily do common tasks (start Time Machine, close apps, eject, empty trash, hide apps, lock screen, log out, mute sound, restart, screen capture, shut down, put the display or computer to sleep, or start the screen saver).</p>
<h2 style="font-size: 1.5em;">Add Dock stack overlays.</h2>
<p>The current stacks implementation is a little messy; switching to &#8220;Display as folder&#8221; helps, but there is another option. Using these overlays, you get a functional, dynamic stack icon that has a clear meaning. You can find the instructions, a visual example, and download link here:</p>
<p><a href="http://t.ecksdee.org/post/19001860/stacks-overlays">http://t.ecksdee.org/post/19001860/stacks-overlays</a></p>
<p>It&#8217;s a little bit of a hack, in that need to add an icon file within each stack, and leave it there. But it certainly looks cool! I wish Apple had designed it that way to begin with.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelprewitt.com/2009/08/making-mac-os-x-leopard-even-better-1539/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Prevent OS X from ejecting a FireWire drive when logging out</title>
		<link>http://michaelprewitt.com/2009/06/prevent-os-x-from-ejecting-a-firewire-drive-when-logging-out-1364/</link>
		<comments>http://michaelprewitt.com/2009/06/prevent-os-x-from-ejecting-a-firewire-drive-when-logging-out-1364/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 22:30:57 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://michaelprewitt.com/?p=1364</guid>
		<description><![CDATA[We had a problem at work in which a shared FireWire drive would unmount when logging out of a user account. This is unfortunately the default behavior under OS X, and there is no easy preference to turn it off. &#8230; <a href="http://michaelprewitt.com/2009/06/prevent-os-x-from-ejecting-a-firewire-drive-when-logging-out-1364/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We had a problem at work in which a shared FireWire drive would unmount when logging out of a user account. This is unfortunately the default behavior under OS X, and there is no easy preference to turn it off. This default behavior is intended to prevent inexperienced users from unplugging a device after they log out, naively thinking it is safe to do so. However, in a network setting when you want a drive to remain mounted persistently, because it is a shared resource, this presents obvious problems. If someone logs out on the computer with the FireWire drive, all network connections are terminated, and anyone trying to read or write to the drive will be rudely cut off, possibly resulting in data loss.</p>
<p>I was happy to find a workaround, and it is pretty simple. Open the Terminal application (in the Utilities folder), and type all on one line (no line breaks):<span id="more-1364"></span></p>
<blockquote>
<p style="text-align: left;">sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true</p>
</blockquote>
<p>You must do this from an administrator account, and you will be asked for your password. Then restart, and you should have no more unexpected unmounting. I have tried this only under Tiger (10.4), but someone said in a forum that it works under 10.5 as well.</p>
<p>For more about this hint, see <a href="http://forums.macosxhints.com/showthread.php?t=38133">here</a>, <a href="http://www.macosxhints.com/article.php?story=20031103155828117">here</a>, and <a href="http://www.macosxhints.com/article.php?story=20050326210151430">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelprewitt.com/2009/06/prevent-os-x-from-ejecting-a-firewire-drive-when-logging-out-1364/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

