Today two of my servers went down. It turned out, that the datacenter they are hosted in had a slight connectivity hiccup – nothing serious. While I was battling my monitoring system and frantically typed support tickets, I wanted an audible alert if the hosts where reachable again in the meantime.

That’s when I thought of OS X’s text to speech system and devised the following little shell script.

https://gist.github.com/florianbeer/8c1e0a56bc306d603987

It will announce that the host is back up with your configured standard voice as soon as there is a ping response and then quit. Just copy it in your .bashrc file call it with the desired hostname or IP address, leave it running in a Terminal window in the background and turn up your speakers.

hostup no-panic.at

The year 2014 is almost over, but looking around my developer colleagues, I see that there is still a lot of old knowledge and outdated techniques for using your Mac for (web-) development purposes. To counter this lack of information I will outline the steps I took to lift my two primary OS X systems into the new age. Gone are the days where we need to have a webserver, database system and a plethora of different packages installed on our main operating system and deal with breaking changes whenever a new OS update (Hello Yosemite!) comes along.

This post talks about setting up your own private local development server with all the needed software to start developing applications with PHP and MySQL without having to install any server software on your main operating system. The end product will also give you the means to quickly set up an identical virtual machine on any number of additional computers you might want to use for your development.

Disclaimer: As I am a heavy user of Laravel these days, this set-up will mainly center around web development and PHP.

Continue reading

Click here to see the ifttt tasks

Click here to see the Mail Rule

This is kind of a stripped down version of Read It Later or Instapaper, but functions perfectly for my workflow.

Requirements

  • Apple Mail
  • Apple Safari (with Reading List Support)
  • ifttt Account

First I’ve set up actions in ifttt that forward Links I favorite in Twitter or Google Reader, to my personal Email and prepend the subject with “#ReadLater”. Next I constructed a Mail Rule that acts on all messages who’s subjects begin with said keyword. The Mail Rule will invoke the following Applescript, mark the message as read and move it to the trash.

using terms from application "Mail"
	on perform mail action with messages theSelectedMessages
		tell application "Mail"
			repeat with eachMessage in theSelectedMessages
				set mailbody to content of eachMessage
				set theUrl to paragraph 1 of mailbody
				tell application "Safari"
					add reading list item theUrl
				end tell
			end repeat
		end tell
	end perform mail action with messages
end using terms from

Use cases

  • Read newsfeeds on iPhone. Save longer or interesting articles for later by clicking the favorite star.
  • Interesting item pops up on twitter, but you don’t have time now to read the containing link right now.
  •  While walking in the street you see a URL you want to remember, just mail it to yourself with the appropriate keyword in the subject.