Blog

Jekyll-plugin-include. Jekyll vial logo CC-BY Jekyll https://github.com/jekyll/brand/

Jekyll – use includes directly from plugins

Jekyll is a popular static site generator that I’m using to develop the new Decipher SciFi site. It’s pretty sweet.

But!

Normally, Jekyll’s include tag can only search for files in the site’s single configured includes directory (and that of the theme plugin, if it using one). That means that if a plugin wants to provide you with a template/fragment via includes, the best it can do is ask you to copy it into your own repo manually. That sucks.

So I wrote jekyll-plugin-include: a gem-based Jekyll liquid tag plugin which allows includes directly from plugins’ _include directories, with optional ability to override with files present in site includes_dir (if they exist).

https://github.com/decipher-media/jekyll-plugin-include

This plugin then makes it easy to use includes that ship with a plugin directly from a plugin. And if a modified version of the file is provided in the site’s own includes directory, it can intelligently use that one instead!

And for plugin developers, this provides a way to ship and use includes without leaning on the user to manage the unmodified files themselves.

ლ(╹◡╹ლ)

Bash rclone autocomplete logo

Rclone remote path auto-completion on Linux (Google Drive)

I started playing with rclone in the interest of easily editing files from Google Drive with Vim. As it turns out, you can’t edit native Google Docs files in this manner, so that was a wash!

But a side benefit of this misadventure is this bash autocomplete script which I wrote to auto-complete remote paths for rclone with a Google Drive target. It probably works for others too, I haven’t tested them. 🙂

This implementation is in pure bash all except for the call to rclone itself to check against known remote targets. I appreciated An introduction to bash completion to get me started on the concepts, and the rest of what anyone needs is all in the bash manpage under complete.

Here in this post is the initial version I’m using. If you’re going to use it, check the current version of the file on my Github in case anything changes.

 

 

splatmoji logo

Splatmoji – easier quick pop-up emoji/emoticon input on Linux

I previously posted about an emoji-input method using iBus that required jumping through some hoops and ultimately wasn’t a very pretty UX.

But now I’ve rolled my own, and added japanese emoticons/kaomoji as a bonus! I’ve titled it Splatmoji, with respect to its wildcard nature for emotive text input.

Quick start:

Some suggestions for customizing its configuration, binding it to a key combo in your window manager, using your own emoticon sets, and other bits are in the README.

splatmoji animated usage example

\(^▽^@)ノ

 

tmdb TMDB cli utility logo backdrop

Query TMDB for movie and tv info on the commandline

You know TMDB (The Movie DataBase)? It’s like IMDB, but without being awful.

tl;dr: I made a cli TMDB query tool in Ruby and here it is with documentation: https://github.com/decipher-media/tmdbget


As part of our podcast website migration from WordPress to Jekyll, I’m coding in a bunch of functionality that I’ve wanted for a while. The first one: a cli utility to fetch movie metadata into (semi-)structured data.

So here it is

https://github.com/decipher-media/tmdbget

Grab some API keys form TMDB and it’s easy-peasy to get some movie and tv metadata:

To get something like:

Check the help output for full and up-to-date functionality details, including a flag for interactive mode for when you’re less than confident that you’ll get the right answer. 🤓

 

 

vim-convert Vim plugin graphic

Quick and easy unit conversions within Vim (vim-convert)

Header image bits: Vim logo from D0ktorz and SI Units from Dono

Editing some varieties of documents I noticed myself jumping into a browser or terminal often to do unit conversion. But no longer! Vim-convert is a plugin I made for Vim that allows easy unit conversion from a simple command.

The command

Some usage examples

To convert in-place the currently visually-selected text which includes a
unit, e.g. 500g

To convert in-place the currently visually-selected text which does *not*
include a unit, e.g. 500, you’ll need to specify one:

To insert a unit conversion as a new value after the cursor, give both fields:

To cause an error because parsecs are a unit of distance:

 

This plugin will try to be mindful of whether the unit itself is desired when
replacing text. That is, if the selected text lacks a unit, the result will be
placed without one as well.

Installation instructions and other details in the README.

Brightness icon code backdrop

My Linux ACPI brightness control script

Brightness icon in featured image by Elegant Themes

When I started using i3 window manager, I knew I’d basically have to re-engineer a number of desktop environment features myself around the bare window manager. One of these features is easy brightness control on my laptop.

The Arch Wiki has a *great* and in-depth page on this as it can be a very complex matter with a bunch of different ways to manage it on different hardware. Here! But after that, and if the ACPI method works for you, here is the script I came up with to manage it on Ubuntu!

ACPI brightness controls

So if you see something listed like this then you probably have a backlight you can interact with

The files we’re interested in are brightness and max_brightness. Writing a value into brightness will… change the brightness! But one must be root to do this.

My script

So I made a script to do it! (Here is the current version of the script in my dotfiles, which may differ since the writing of this post)

Usage

If you’re going to bind this to some key combo, you may want to allow this to sudo without a password (as securely as possible).

Here is my binding for i3wm

So there you go!

Decipher SciFi recording setup

How we produce our podcast on Linux at Decipher SciFi

You may be a Linux podcasting person looking for some ideas after a couple of years of Linux podcast production. You may be a fan of Decipher SciFi who wants to see what it looks like on the back end. In either case, welcome!

This is not meant to be the guide to doing it right, but just a record of the hackey way that we do it for reference. It’s like looking at someone’s Vim config; you don’t just copy the thing, but take what is useful.

Our usual recording setup is the two of us in the same room with sporadic remote guest appearances via Skype. This is the stuff we use and how (links to products on Amazon may include an affiliate code 🙂 ).

Recording in the studio with guest co-host Jolene Creighton

Recording at the “studio” with Jolene Creighton for our Star Trek Beyond episode

Recording

Hardware

Microphones (ATR-2100)

ATR-2100 microphone

The ATR-2100 microphone can use both USB and XLR

My partner and I both use ATR-2100 microphones. We settled on these for a few reasons:

  • Each has both XLR and USB interfaces, so we were able to continue to use them when graduating  from computer to dedicated recorder.
  • They’re not overly sensitive so they work well when recording two people in the same room.
  • They’re affordable!

But, there is another. Since our mics and the system output from the Skype machine both go directly into the recorder, we need to have another microphone for our guests to hear us. We keep a Blue Yeti (which we do not recommend for the actual podcast recording) sitting in the middle of the table for this purpose, but whatever you have will probably do.

Recorder (Zoom H5)

We started out recording directly into the computer with Audacity which proved to ultimately be less than reliable. Maybe this could be a fine enough affordable option for one person, I suppose, but if you’re recording two people in the same room you have a lot of pain-in-the-ass fiddling with audio configurations to look forward to, iirc (to aggregate separate USB audio sources). After a while and a few disastrous software failures in this mode, we finally got a dedicated recorder. In fact, I would actually recommend a dedicated recorder no matter what platform you’re on.

Zoom H5 recorder

Zoom H5 recorder

So, this thing. This thing is pretty great! It can record four channels – two single-channel XLR inputs on the bottom, and a combined stereo input from whatever “capsule” is plugged into the top. With the X/Y capsule (it ships with this one) on top we are able to plug in remote guests from a Skype session on the nearest computer and record all three tracks separately.

Decipher SciFi recording setup

Our recording setup

 

Editing

Okay, finally on to some software stuff.

Convert

The H5 records in WAV, and can basically only record input from the capsule (Skype) in stereo. So I want to get these tracks into mono FLAC files because it is lossless without being huge.

Here is how I do this conversion (the current “production” version of this script can be found in my dotfiles).

Edit

Then I import the tracks into Audacity and go to town.

editing in Audacity

Here is my Audacity configuration and here are the plugins I use.

Post production

With the edit done, I can then run it through a final set of filters and cut in some intro and outro music (generously provided by Caelum Rale). Final export to 112kbps mono CBR LAME MP3 (plenty good enough for voice) with our id3 tags, add the thumbnail (Audacity doesn’t support this), and we’re done.

Final filters

We use Levelator because it works, still, and is at least free as in beer. It’s super old and out of support but it works just fine for us, so here it stays. You can get Levelator here, but the link to the Linux version is broken. The Windows version works superbly in Wine though!

using Levelator

Levelator is pretty easy to use

The alternative these days seems to be Auphonic, a web-based service that gives you a few free sessions per month or somesuch and is reasonably priced for more. It seems popular and I hear good things.

Thumbnail/cover art

Audacity doesn’t know how to write the cover art id3 tags, but it’s easily done on the cli anyway. eyeD3 is a good tool for this.

It’s not a big deal, but it’s nice to have.

Publishing

File Hosting

Our finalized MP3s get uploaded to Libsyn. Another good option I am happy to recommend is Blubrry. Either way, as an enterprising Linux nerd, you’d only be using it for file hosting because you’ll control the RSS feed itself from your own site? Right?

All kidding aside, people in the space continue to fight over whether you should control the feed from your own domain or relinquish control to the hosting service itself. You do you, but I prefer the former. And there’s a great WordPress plugin for that too mentioned below!

Website hosting

Our post for the episode then goes up on Decipher Scifi. The one good option here is WordPress(.org), really. How and where you do this is up to you but we run a multisite WordPress install on Linux on AWS and manage it ourselves. I do have a couple of tips re link shortening and Let’s Encrypt though if you’re into that sort of thing.

And then within WordPress, we use the only (and really good!) plugin for serving up podcast RSS feeds, Blubrry PowerPress. It’s never done us wrong.

Backups

Yeah don’t forget these! Both the audio and the website.

Audio backups

When the episode is up and out, we back up the raw tracks and the separate final edits of the tracks in FLAC, and the final cut in MP3. They go to Dropbox, Google Drive, S3, whatever, and a portable hard drive or two. The idea is to have both a local and remote copy if you value your backups.

podcast final edit files

The final edit files for one of our episodes

Website backups

I wrote a small hacky BASH script that does my WordPress backups. It tars and gzips both the entire WordPress directory and the database dump and then moves it around with Rsync. One day I’ll do the work of finding/creating a better, more robust solution. Let me know if you can recommend one?

 

Social

We have social channels! Twitter | Facebook | Instagram

Creating posts

Simple text posts are one thing, but I like to use images or video when possible. I use the following tools to help me with this.

GIMP. Here is my GIMP config, if you’re interested. As of writing, It is set to behave mostly sorta roughly like Photoshop, but I still haven’t tuned this up as much as I’d like. Caveat emptor.

Instagif is a script I wrote to convert GIF (from local or the web) to MP4 for Instagram. Facebook and Twitter both support GIF (though iirc they ultimately convert to MP4 anyway), but you need to handle Instagram differently and make the GIF into an MP4 that meets with Instagram’s length and color encoding requirements. Thus, the script. 🙂

Maybe I should just skip straight from GIF to MP4 for all the platforms? I’ll need to test to see if the viewing experience is diminished by this switch on Facebook and Twitter. Will report back.

Posting posts

Hootsuite!

The free tier of this wonderful service allows for scheduling up to 30 posts, which is more than I ever do at one time. And now it can even take advantage of Instagram’s direct-posting feature for business accounts, if you have one.

 

Summary

Hardware

  • Zoom H5 Recorder with a fast SD card
  • ATR-2100
  • Neewer NW-35 table-mounting mic arm. Super cheap and has been serving us with various heavy microphones for a good long while. It even holds up the super-heavy Blue Yeti which we used for a minute.

Software

Services

Decipher SciFi Bill & Ted selfie with Brandon Rollins

podcast on, dudes!

So there you have it. Amazon product links include our affiliate code, if you don’t mind helping us out a bit. Happy Linux podcasting! 😀

gif to mp4

Convert GIF to MP4 for Instagram with FFmpeg

I made a script to account for Instagram’s idiosynchracies when converting a GIF to MP4 using FFmpeg. Here it is:

https://github.com/cspeterson/dotfiles/blob/master/.bin/instagif

And now the details…

Doing a conversion of GIF to MP4 with ffmpeg seems like it should be simple enough:

But it isn’t! This can be insufficient in a couple of ways..

Problem 1: Video too short

instagram "video too short" notification

Solution: Use a filter to loop the input enough times to meet the 3s minimum time requirement

Problem 2: Wrong color encoding

Instagram blank video preview

Given a color encoding that it doesn’t understand, Instagram just kinda poops out

Solution: By default, my ffmpeg used yuv444p, which Instagram wasn’t happy with. I haven’t done an exhaustive survey of the color encoding that Instagram will accept, but here is one: yuv420p.

In addition, the conversion requires the file’s height to be divisible by 2, so we need yet another filter:

Automation

Now since so many GIFs that I wish to post to Instagram are actually shorter than 3s, I automated everything above and here is the script. To see if I made any changes since posting this, check the version I’m currently using in my dotfiles.

Usage

To convert yup.gif to yup.mp4

To convert yup.gif into yup.insta.mp4

To create an insta.mp4 directly from a remote GIF

Happy giffing! 😀

Vim config and logo

My intermediate Vim configuration and usage guide

This is my intermediate Vim configuration and usage guide.

It was aimed in particular at the newer Vim users at work, but someone else may get something from it too. Enjoy!

https://github.com/cspeterson/vim-guide-intermediate/blob/master/README.md

 

Linux pop up ibus emoji

Quick pop-up emoji input on Linux [updated]

<update> I’ve since rolled my own solution, which I prefer and recommend over this one. Check it out! Splatmoji. <update>

I need pop-up Linux emoji input that doesn’t require a mouse. Something like Emoji Keyboard or EmojiOne Picker require the hands to leave the keyboard and click on an emoji – this is a bunch  better than jumping into a web browser and looking one up, but still. Yuck.

The solution I finally found is ibus-uniemoji. Ibus is a framework on Unix that is most generally used for input of foreign characters from a standard keyboard, e.g. pinyin, Russian, or in this case, emoji. Uniemoji uses this to provide an easy pop-up for emoji selection by name or keyword. No mouse!

uniemoji emoji input

Ensure the ibus daemon is running at startup, or whenever suits you:

It’s not in the Ubuntu repos as of writing, so to install:

Here is the script I wrote to toggle between normal input and emoji input:

And finally to toggle between (or cycle across) an arbitrary number of ibus engines, find the engines you want by running ibus list-engine and call the script like this from some key combination (see your X or window manager config, whatever):

In my case, I bound this via my i3 config:

Note: you may, like me, need to re-establish your X keyboard settings after each time you switch ibus engines or else you’ll lose your compose keys, maps, etc. To ensure this I just re-run my .xsession as above.

?