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

In this instalment it’s time to make a start on one of the most important Unix/Linux concepts, file permissions. This can get quite confusing, but it’s impossible to over-state the importance of understanding how to read and set permissions on files and folders. To keep things manageable, I’m splitting understanding and altering permissions into two separate instalments.

Linux and Unix (and hence OS X) all share a common file permissions system, but while they share the same common core, they do each add their own more advanced permissions systems on top of that common core. In this first instalment we’re only going to look at the common core, so everything in this instalment applies equally to Linux, Unix, and OS X. In future instalments we’ll take a brief look at the extra file information and permissions OS X associates with files, but we won’t be looking at the Linux side of things, where more granular permissions are provides through kernel extensions like SELinux.

Read more

Tagged with:

I regularly find myself navigating to a folder in the Finder and then wanting to quickly get a Terminal window in the same location. In the past I would open a Terminal window, type cd and a space, then drag and drop the folder in question from the Finder into the Terminal and hit enter. Thanks to OS X’s great drag-and-drop support that works, and while it is easier than typing out the whole path (even with tab-complete), it’s still quite cumbersome.

Today inspiration hit me – the open command should let me open a folder with the Terminal, so I tested it, and it does. Armed with this simple command line solution I opened up Automator and threw together a simple OS X service that takes a folder as input. The service has only one action, a Run Shell Script action with the shell set to bash, the input passed as arguments, and the following content:

for f in "$@"
do
	/usr/bin/open "$f" -a /Applications/Utilities/Terminal.app/
done

Screenshot of Service
Click to Enlarge

It will only take seconds to re-create this service yourself, but for convenience, I’ve zipped up my copy of the service and am attaching it to this post. Install it by unzipping and adding to either ~/Library/Services/ (for just yourself) or /Library/Services/ (for all users).

Download

Once the service is installed it will show up in the Services menu in the Finder when ever you have one or more folders selected:

Terminal Here Service In Action
Click to Enlarge

You can also get to the service by right-clicking on any folder in the Finder:

Terminal Here Service In Action - Right Click
Click to Enlarge

Finally – if you keep the optional Path Bar shown in the Finder you can also right-click on a Folder there to access the service (including the folder you are in):

Terminal Here Service in Action - Path Bar
Click to Enlarge

ISS Passing over TaghadoeIreland is actually quite far north, so our summer nights never get fully dark. You watch the sun set, but the glow on the horizon doesn’t go away, it slowly moves from the west through the north to the east where the sun rises again. This takes away a lot of astronomical opportunities, but, when one door closes, another opens. Because the sun never gets far below the horizon during the summer in higher northern latitudes, the part of space where satellites orbit remains in sunlight the whole night long, which means summer is satellite observing time! (The same is true in the southern hemisphere for far southern latitudes during their summer.)

There are lots of ‘ordinary’ satellites which can be seen pass over each night – they look like stars that move slowly but purposefully across the sky – taking a few minutes to cross from one side of the sky to the other. These can be fun to watch, and you can photograph them with a bit of effort, but, the stars of the show are the International Space Station (ISS), which blazes across the sky shining brighter than any star, and the network of Iridium communication satellites which ‘flare’ regularly. Any satellite can ‘flare’, when the sun glints off a solar panel or communication dish, but those flares are not predictable or dependable. Iridium flares are different, because the Iridium Satellites have massive dishes pointing earthwards at all times, and as they pass over-head, the dish will come into alignment with the sun, and what starts off looking like a regular dim satellite will suddenly brighten for a few seconds and then dim again. The flare is effectively a cone that sweeps the earth, if you are in the very middle of the cone, the flare will be spectacularly bright, down to magnitude -8. For context, the magnitude scale is inverse, so the lower the number the brighter the object. The brightest stars are about magnitude 0, the brightest planets about magnitude -4, and the Moon about magnitude -11, so -8 is getting close to the brightness of the Moon!

Read more

Tagged with: