Dry The Rain

Dec 16, 2018
Tags: Music

“I will now sell five copies of The Three EP’s by The Beta Band”.

"If there's something inside that you want to say, say it out loud it will be OK"


My Favorite Things

Dec 16, 2018
Tags: Music

Do yourself a favor this year. Skip the clichéd Mariah Carey remakes. Throw those awful Michael Bublé CD’s in the trash. Avoid the whole “Baby it’s Cold Outsite” drama. Just listen to this.

iTunes Album Art for My Favorite Things

Wikipedia explains:

The famous track is a modal rendition of the Rodgers and Hammerstein song “My Favorite Things” from The Sound of Music. The melody is heard numerous times throughout, but instead of playing solos over the written chord changes, both Tyner and Coltrane take extended solos over vamps of the two tonic chords, E minor and E major, played in waltz time.

This track exists as a life affirming oasis amid the neverending desert of holiday muzack being piped into every square inch of the public commons this time of year. Coltrane offers an existential escape—a brief respite from the soul crushing weight of those consumer-driven cultural expectations that we call The Holidays.

Be kind to yourself—play it on repeat—breathe. Merry Christmas.


Using GitHub Actions to Deploy your Jekyll Site

Dec 1, 2018
Tags: Jekyll Web Development GitHub Actions

A few weeks ago, I got invited into the limited beta for GitHub Actions. In case you’ve not heard of Actions before—it’s GitHub’s pitch for the future of continuous integration/deployment of GitHub repos. As has been said:

The future has arrived, it’s just not evenly distributed yet. –Apocryphal William Gibson

Is Actions the future? I don’t know, but after playing with the beta for a bit—I do think it’s pretty cool. Even for something relatively straightforward like building a Jekyll site—the immediate advanages are obvious.

  • Want to use those custom Jekyll plugins that GitHub Pages has always blocked? No problem.
  • Want to update your search index with newly built pages everytime you deploy? Sure thing.
  • Want to run some NPM scripts to compress, concatenate, autoprefix, ship, resize, slice, or dice any, some, or all of your assets? Errr…OK.
  • Want to do it all while staying on GitHub…for free? Let’s do this.

Setting Up Your Workflow

Once we have access to Actions we can start things off by adding a do-stuff.workflow file in a .github directory sitting in the root of our repository. Github includes a little visual editor you can use to setup your workflow, but I found this to be more trouble than it was worth. Essentially: our workflow needs to identify itself, indicate a trigger, point to an action, and include any secrets or environment variables the action will need.

workflow "Deploy Site" {
  on = "push"
  resolves = ["Build and Deploy Jekyll"]
}

action "Build and Deploy Jekyll" {
  uses = "BryanSchuetz/[email protected]"
  secrets = ["GITHUB_TOKEN"]
}

Building the Action

In the action directory we need a couple things:

  • Dockerfile We’ll use Docker to setup a container within which we can import ruby and jekyll and any other gems we’ll need to build our site.
  • Entrypoint.sh This is where the heart of our action lives. We’ll install all our Gem dependencies, build the site, initialize and setup Git, and then push all the site files back to the gh-pages branch of our repo.
  • README.md Explain what the action does. One of the nicer features of Actions is that creators can expose them in a public repo—so that other users can call them from their own workflows!

Action Log

Try it Out

As mentioned above, I’ve put this action in its own public repository so anyone can point to it and use it to build and deploy their own Jekyll site. Or, just have a look around and see how I’ve sructured things—I’m sure there are efficiences I could make—if you have any suggestions, please let me know.


Concatenate JS for Free with Jekyll

Apr 15, 2018
Tags: Jekyll Web Development

This one’s a stupid little trick, but I literally use it all the time, and I’m always surprised how novel people find it when I explain it to them. Basically: use Liquid includes in a bundle.js file, and let Jekyll smash all your .js crap together for you.

Jekyll will parse any file that has a YAML front matter block at the top of the file. So, just drop one of those suckers at the top of your JS file and include your scripts in the order you need them.

bundle.js:


---
---

{% include _vendor/turbolinks.js %}
{% include _vendor/isotope.js %}

//More Awesome JS Stuff Below

When Jekyll hits bundle.js it will grab your partials and drop them into the file right where they should be. You may still want to minify, etc.—though your vendor files are probably already ugly. This is a super simple, no overhead, low config way to concatenate all your js crap together—letting Jekyll do what Jekyll does best: parse files.


Viewing AWS logs on the Command Line

Mar 28, 2018
Tags: Serverless Web Development

If you’ve ever tried to quickly check AWS logs from the command line then you know my pain. Don’t get me wrong, the AWS CLI is great and all but—if I just want to quickly double check that a Lambda function has returned what I think it has—it’s kind of a giant pain in the ass. You’ve got to first describe-log-streams for a given log group, grep to find the most recent stream and capture the logStreamName, then get-log-events for the stream (requires logStreamName), and then finally grep for what it is you were hoping to find.

I’d say that this was basically like “living in Mogadishu”—but then I’d have to punch myself in my first world face—so I’ll just say that it’s less than ideal. So, recently I’ve been using awslogs, a nice little Pyhton utility for doing the same type of thing—only more better.

Why better? Because you can do the same thing as above, in a single command.

awslogs get /aws/lambda/myGroup 2018/03/28 -s2h | grep objectIDs -C 1

Basically: get events for the given log group, where streams match the given expression, in the given timeframe—then grep for what I’m hoping to find. I’m sure there must be a better way of doing this kind of thing that I’m totally unaware of but, “works for me”™.

The Distress Signal is the personal blog of Bryan Schuetz. Bryan has been complaining on the Internet since the 90s. If you'd like to get in touch with Bryan, he can be found—it is known.