Archive for the ‘Unix’ Category

Controlling Screen Sharing from the command line

My world often narrows to Xcode and Terminal. There are times I just want to check in on another computer quickly and I don’t want the hassle of creating a new Finder window, going to the network, waiting for the items to load, and clicking Screen Sharing.

Let me share a quick osascript solution I use instead (and there’s an even better solution for launching just using open, thanks Chris). This example connects to Esopus Spitzenburg, my Mojave computer (aka the one that still runs everything including Photoshop and Microsoft Office).

#! /bin/sh

/usr/bin/osascript -e 'tell application "Screen Sharing" to GetURL "vnc://Esopus-Spitzenburg.local"'

If closed, the Screen Sharing application launches in the foreground. If already running, it stays at its relative hierarchy. You can add a command to activate to bring it to the front on each invocation, even if the connection is already active.

If you’d like to let the utility toggle visibility on call instead, add a request to Finder and append it to the script:

/usr/bin/osascript -e 'tell application "Finder" to set visible of process "Screen Sharing" to not visible of process "Screen Sharing"'

I have written similar utilities to open Broxwood Foxwhelp and Glockenapfel, depending on the computer I’m using. As much as I’ve intended to write a single utility instead of two or three dedicated scripts, I’ve can’t convince myself it’s worth the effort.

(Bonus points: Why are my computers named this way?)

Pronouncing all the things: Jumping into my bin folder

After dutifully training people to pronounce simctl correctly (“sim control”, not cuddle or kittle), I stopped by my binary folder (/bin, also pronounced “bin”, like the thing you throw stuff into) this morning to see how I pronounce all sorts of things. I’m curious as to how my pronunciations compare to yours.

Here is a list of how I say things from my highly unscientific survey of /bin:

  • cat: Meow. Does anyone not say “cat”? (From “concatenate”)
  • csh: See shell. See shell run. Run shell run. Who’s a good shell? Yes you are!
  • df: Dee Eff or occasionally disk free. Mostly “Run df to see how much free disk there is” (notice the inversion from “disk free” to “free disk”).
  • chmod, chown: Change mod but I mostly say “make it executable” or “add read permission”. I almost never say it out loud. Similarly, chown is just “change owner” because saying “change own” is just weird.
  • cp, rm, mv: See Pee (no 30) or copy. Are Em or remove. And “move”. Don’t let anyone convince you it’s “mivv”.
  • ls: Ell ess. I almost never say “list” but I do say “list the contents of the working directory with ell ess”.
  • rmdir, mkdir: Arr emm dear or remove “dear”, and “make dear” (which, you know, is really sweet when you think about it.)
  • pwd: I only ever say “print the working directory”.
  • ln: Going against the trend, it’s always “ell enn”, not “link”. Probably because I never use this and always use lns instead.

I’m not sure this post has much of a point other than to amuse you by how I waste time in the morning before the caffeine kicks in. Let me know how wrong I am and what the correct pronunciation of some of these items are.