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

For quite some time Mac users where searching for a way to paste the currently playing song from iTunes in chat messages etc. I never thought about it much but recently a friend of mine, who was a former AMIP user on Windows, needed a similar functionality under OS X. Together we constructed a working solution.

So here it is the AMIP alternative for Mac:

    • Open Automator and start a new “Service”
    • Choose “no input” for “Service receives”
    • Drag the “Run AppleScript” Action into the workflow
    • Paste in the following and edit the output in (green) to your hearts desire
on run
 try
 tell application "iTunes"
 set songTitle to the name of the current track
 set songArtist to the artist of the current track
 set songAlbum to the album of the current track
 set songYear to the year of the current track
 set the clipboard to "np:" & the songArtist & " - " & songTitle & " \"" & songAlbum & ", " & songYear & "\""
 end tell
 end try
 try
 set the clipboard to Unicode text of (the clipboard as record)
 on error errMsg
 display dialog errMsg
 end try
 tell application "System Events"
 key code 9 using {command down}
 end tell
end run
  • Save the service. I named mine “music” (creative isn’t it? 🙂 )
  • Now your able to run the service from every application’s menu under “Services”. Be sure to have your cursor in a text field because the service will immediately paste in the constructed string.
  • If you’re in a super nerdy mood today, you can also give your service a keyboard shortcut.
    Go to “System Preferences”, open “Keyboard”, go to “Keyboard Shortcuts” and set your desired Hotkey. (mine’s CMD + SHIFT + M)

I’d be happy to see further improvements, thoughts & ideas about this solutions in the comments!

 

And to all my Austrian friends: Frohen Faschingsdienstag (not that I’d care!)

AudiogalaxyToday I’d like to highlight a software I found out about yesterday called Audiogalaxy.
If you’re about my age you surely remember the peer-to-peer audio file sharing application by the same name that took over Napster’s market share in 2001. Well this software is actually made by the same people only that they’ve shifted their focus from file sharing to a “placeshifting service” as they call it. Audiogalaxy lets you install a small client software on your computer that scans all your music and makes it available to you on the audiogalaxy.com website, Android phones & iPhone. And it’s completely free!

There have already been a number of attempts to offer this kind of service, the one I used quite a bit was Simplify Media which unfortunately was shut down. What makes Audiogalaxy truly stand out for me is it’s easy of installation, performance and iOS integration. I’ll outline the steps necessary to get the whole system up and running on a Mac and an iPhone.

  • First go to audiogalaxy.com and click on Sign Up. The easiest way is to use Facebook connect so we’ll choose that option.
  • Next you’ll be offered to download the client application for your computer which already has your login data included, so just drop it into your Mac’s application folder, start it and you’re good to go.
  • The website patiently waits to detect the client application on your computer which then starts scanning your default Music location.
  • It can take quite a while to index a big library, so hop over to your iPhone in the meantime and download the Audiogalaxy App from the App Store.
  • Start the Audiogalaxy App on your iPhone, log in with Facebook and you’ll be instantly connected to the music on your computer including all the Playlists you’ve set up in iTunes.

From now on you’ll be able to play all your computer’s music via the website or your mobile device (an Android client is available as well). What makes this service really special is the level of integration they’ve been able to accomplish with iOS. It can really replace you iPod App on the iPhone by offering background music playing, access to play/pause/skip/volume controls via all the available shortcuts and the headset buttons. One last thing I was doubtful about was how it will perform while being on the move, so I tested it out on my morning commute today and let me say I was extremely pleased.
I started music playback before leaving my appartement, so I was still connected to my home WiFi. When I reached the street my iPhone lost contact to the WiFi and switched to 3G, this only triggered a ~2 second gap in playback, after which the music just played on from where it lost contact. Performance on 3G is absolutely brilliant and I could keep on listening during the whole train ride. What was astonishing was that there is a tunnel on my way to work where I know that there is no cellular access at all (phone calls always drop while going through that tunnel), the Audiogalaxy app apparently had enough of the music buffered, so playback continued without interruption. When I got close to my office I once again experienced a little gap in the playback, that was when my phone picked up the company WiFi.

Let me finish of by stating a few things I’d love to see improved/added to the iPhone client:

  • Submission of played tracks to Last.fm
  • Updating of the playcount in iTunes’ library
  • Gapless playback between tracks of an album. If the software manages to play through short signal losses, why not pre buffer the next track as well to offer continuous playback?

Software download Links:

 

Android market QR code for Audiogalaxy

 

Available on the App Store