My configuration for bash, vim, git, tmux and a few other tools can be found on GitHub now.
I have spent a considerable amount of time to get them working on OS X and Linux.
(Tested on Mac OS X Yosemite 10.10.3 and Debian 7.8 – YMMV!)
Tag: osx
Set tmux pane title on SSH connections
I am frequently connecting to several servers over SSH at once and like to use tmux to organize those different sessions. To be able to keep track which pane is which server I am using the following function in my .bashrc
file to display the machine name in tmux’s pane title.
https://gist.github.com/florianbeer/ee02c149a7e25f643491
Waiting for a server
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
Modern Mac development setup
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.
Automatically add links from emails to Safari Reading List
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.