i’m even lazier than that

gruber has a post about how to restart your apache webserver on a mac using an applescript 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.

So because I’m really lazy, I made an AppleScript that does this. It’s just one single line:

do shell script "apachectl graceful" with administrator privileges

i’ll see your laziness and raise you a keyboard shortcut.

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.

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:

add shortcut

  • Applications : All Applications
  • Menu Title : Restart Apache
  • Keyboard Shortcut : ⌘⌥⇧R
  • hint. that last one is ‘command option shift r’
  • then press the ‘add’ button

keyboard and mouse pref pane

and there you have it. one shortcut to rule them all. you know, for all the times that i have to restart apache.

script menu

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.

tags : [ applescript ( ), apache ( ), lazyweb ( ), keyboard shortcut ( ), daring fireball ( ) ]

Currently playing in iTunes: I Try (Feat. Mary J. Blige) by Talib Kweli

Advertisements