Sending Chrome Tabs to get_iPlayer on MacOS via the Command Line.

It’s a pretty simple command line…

osascript -e{'set text item delimiters to linefeed','tell app"google chrome"to url of tabs of windows as text'} | grep -E 'www.bbc.co.uk/programme|www.bbc.co.uk/iplayer/episode' | xargs -t -n1  get_iplayer --pid-recursive
Continue reading “Sending Chrome Tabs to get_iPlayer on MacOS via the Command Line.”

Time Machine

Apple’s Time Machine is a neat little utility to automate onsite backups. However its machinations are, like so many of Apple’s products, completely opaque to the end user using the standard user interface and so troubleshooting can be rather difficult. Fortunately for us, this is one of those circumstances where Terminal commands can come to the rescue.

Our first magic spell is…

log show --predicate 'subsystem == "com.apple.TimeMachine"' --info

This will show logged message from the past and can be useful if you’re trying to troubleshoot an issue that’s already in progress. Run this command and macOS will display the last few weeks of Time Machine logs before exiting

The second magic spell is…

log stream --style syslog --predicate 'senderImagePath contains[cd] "TimeMachine"' --info

This command will run – and will remain running until you explicitly exit it – and will display any log messages that Time Machine writes out to the system log.

Prettier Blog Listings

The Jekyll’s introductory tutorial suggests using…

<ul>
  {% for post in site.posts %}
    <li>
      <a href="{{ post.url }}">{{ post.title }}</a>
    </li>
  {% endfor %}
</ul>

…as liquid code to display a programmatically generated, bullet-pointed list of blog posts titles each with a link to the post in question.

However, a more useful list of blog posts titles can be generated with a little extra effort.

The following code block will generate a bullet-pointed list of posts with a link to the post in question. Next to the post title it will add the canonical date of the post – formatted in a human friendly style – and, below, will append a generated excerpt from the post to tease any potential reader.

<ul>
  {% for post in site.posts %}
    <li>
      <a href="{{ post.url }}">{{ post.title }}</a>  ({{ post.date| date: "%B %d, %Y" }})
      {{ post.excerpt }}
    </li>
  {% endfor %}
</ul>

The end result is something like this:

  • Photography (January 30, 2019)
    As part of moving away from other people’s flaky, terms-terms-of-use changing sites (cough… Flickr!) I have started to add various image galleries to this site.

Jekyll Problems

The Jekyll introductory tutorial encourages you to create all pages with a header block that includes the key pair ‘title: A Page Title’. An unfortunate downside to this is that, under the default theme, every page is now added to your site’s auto-generated header – something that, as your site grows, you are unlikely to want to do.

Fixing this is simple; to exclude a page from the site’s header just omit your ‘title: A Page Title’ key pair.

For example:

---
layout: page
title: Blog
permalink: /blog/
---

… would add the page ‘Blog’ to the header and…

---
layout: page
permalink: /blog/
---

…would see it omitted.