At the request of listeners I’m going to be publishing a big list of links with future Let’s Talk Apple shows. The logical format for me to create those notes in is Markdown – it’s plain text, and quick and easy for me to add new items and re-arrange them into logical groupings. for the most part markdown has little to no overhead, but when it comes to links there is a little work. What I wanted was a way of automatically taking a URL, and turning it into a markdown link where the text for the link is the site the story is from with /… after it.

When all is done I want to turn a url like http://www.macobserver.com/tmo/article/every-important-link-from-apples-9-9-event-on-one-page into a link that looks like: www.macobserver.com/…. In other words, I need to take the URL above as input, and turn it into the following Markdown code:

[www.macobserver.com/...](http://www.macobserver.com/tmo/article/every-important-link-from-apples-9-9-event-on-one-page)

My reason for choosing this format is that I want to give obvious credit to the sources of the stories, but not waste screen real-estate on long URLs.

Perl’s URI module can interpret URLs, and easily extract the host part of the URL, OS X Services can take selected text as input and replace it with processed output, Automator can create OS X Services, and Automator can execute Perl code. By putting all these pieces together I was able to solve my problem in just 20 minutes with a few clicks and a few lines of code.

You can just download the service with the link below, or you can read on to see how it’s done.

Download OS X Service …

Read more

Tagged with:

This post is part 21 of 39 in the series Taming the Terminal

This is the third and final instalment on searching. In the first instalment we learned how to search for text within files and streams using egrep. In the second we learned to search for files based on all sorts of criteria with the find command. In this final instalment we’ll start by looking at one last feature of find, its a ability to execute commands on the files it finds. Then we’ll end by looking at an OS X-only alternative to find that makes use of the Spotlight search index to really speed up searches.

Read more

Tagged with:

Fort 8Note: myself and Allison Sheridan had a good discussion around this post on episode 488 of the NosillaCast podcast (starting at 51:34).

Between 1851 and the end of the first world war, the city of Antwerp was Belgium’s so-called National Redoubt. It was decided that it would not be feasible to defend all of Belgium, so, the defence should instead be focused on holding a defensible part of the country until help could arrive from one of the powers guaranteeing Belgian neutrality. The city chosen for this purpose was Antwerp.

The fortifications built around Antwerp were impressive, in scale and design, both from a military and architectural point of view. They are without a shadow of a doubt archeological treasures, especially the late 19th century structures designed by the acclaimed fortification designer General Brialmont. While the later works were all more advanced militarily, they were never as architecturally beautiful as the late-19th century Brialmont forts.

Ultimately, the National Redoubt would never prove a resounding military success, but that doesn’t take away from it’s cultural, architectural, or historic importance. The redoubt had a big impact on the nation as a whole, and much more so on the province of Antwerp. The engineering work was on a scale comparable to that of building a railway network, and while much of that work is, by design, not easily visible at ground level, it’s immediately obvious from the air if you know where to look.

Read more

Tagged with:

This post is part 20 of 39 in the series Taming the Terminal

In the previous previous instalment we looked at using egrep to search for a particular piece of text in a stream or file. egrep is often a great tool for finding a file you are looking for, but only if the file is a plain text file, and only if you are searching for that file based on its content. What if you want to search for files based on other criteria, like the last time the file was edited, or the name of the file, or the size of the file, or the type of the file etc.? For that you need a different command, for that you need find.

Read more

Tagged with: