Posted by Shane Becker on
<p><a href="http://daringfireball.net/">gruber</a> has a post about <a href="http://daringfireball.net/2005/11/restart_apache_applescript">how to restart your apache webserver on a mac using an applescript</a> instead of the terminal or the sharing sys pref. and in classic geek form, he goes to lengths to make it easier for him to do later. laziness as the driver for technical development. classic.</p>
<blockquote>
<p>So because I’m really lazy, I made an AppleScript that does this. It’s just one single line:</p>
<code>do shell script "apachectl graceful" with administrator privileges</code>
</blockquote>
<p>i'll see your laziness and raise you a keyboard shortcut.</p>
<p>i followed all of john's instructions, but then decided that moving my mouse all the way up there and then selecting it out of the many options in the script menu ... ugh. i just couldn't be bothered.</p>
<p>so i did this. go to the apple menu. choose 'System Preferences'. from there choose 'Keyboard and Mouse'. click on the 'Keyboard Shortcuts' tab. near the bottom left corner, click the plus button. in the sheet that pops down enter these for the options:</p>
<p><a href="http://www.flickr.com/photos/veganstraightedge/153389202/" title="Photo Sharing"><img src="http://static.flickr.com/45/153389202_60a04fd65f.jpg" style="width:400px;" alt="add shortcut"></a></p>
<ul>
<li>Applications : All Applications</li>
<li>Menu Title : Restart Apache</li>
<li>Keyboard Shortcut : ⌘⌥⇧R</li>
<li><em>hint. that last one is 'command option shift r'</em></li>
<li>then press the 'add' button</li>
</ul>
<p><a href="http://www.flickr.com/photos/veganstraightedge/153389213/" title="Photo Sharing"><img src="http://static.flickr.com/62/153389213_7d636bbdda.jpg" style="width:400px;" alt="keyboard and mouse pref pane"></a></p>
<p>and there you have it. one shortcut to rule them all. you know, for all the times that i have to restart apache.</p>
<p><a href="http://www.flickr.com/photos/veganstraightedge/153389226/" title="Photo Sharing"><img src="http://static.flickr.com/55/153389226_7b2e56c292_o.png" alt="script menu"></a></p>
<p>waitasecond, i restart apache like once every blue moon. and i just spent a couple hours on this. this might have been an awesomely inefficient use of time.</p>
<p>Currently playing in iTunes: <i>I Try (Feat. Mary J. Blige)</i> by Talib Kweli</p>