tags: #howto

2017-01-22 12:00

Creating an ePub from a list of links

I’ve read and enjoyed parts of Michael O. Church’s take on Venkatesh Rao’s Gervais Principle, but he took his blog offline before I was able to read them all. I decided to snag copies of all of the posts from the Wayback Machine and turn them into an ebook for convenient reading. This appears to be a solved problem thanks to this handy little Python library, pypub, but just in case it winds up being useful to someone here is what I did.

Read more…

tags: #fix | #mythtv

2013-10-02 12:00

MythTV high CPU usage - solved!

(originally from https://web.archive.org/web/20220521093228/http://ajcsystems.com/blog/blog/2013/10/02/mythtv-high-cpu-usage-solved/)

I’ve been dealing with a very strange problem with my MythTV HTPC for a while now. Occasionally, for no good reason that I could see, both the frontend and backend processes would spike to 100% CPU utilization and hang out there until they were restarted. This caused the fans to spin up, which was annoying.

I had some time today to investigate this problem, and it turns out (at least so far) to be related to the UPnP feature. Read on for more about how I fixed it.

Read more…

tags: #til | #windows

2013-09-15 12:00

TIL: Installing Windows 7 on a non-default drive

(originally from https://web.archive.org/web/20150423071752/http://ajcsystems.com/blog/blog/2013/09/15/til-installing-windows-7-on-a-non-default-drive/)

Quick one: today I learned that, when installing Windows 7 on a machine with multiple hard drives, it will refuse to install to a drive which is not set as the default boot device in the BIOS.

It doesn’t tell you this is why it won’t install, of course. It just says “I couldn’t find a valid drive to install to, go read the setup log to find out more.” If you’re inclined to figure out this problem, you then have to Google around a bit to actually find the location of the setup log files, read them through “type setupact.log”, and then happen to run into an error that could be interpreted as being related to BIOS boot order.

Hopefully this note saves somebody the several hours that I wasted today on this. =P

2013-09-12 12:00

Sometimes things just work the first time

(originally from https://web.archive.org/web/20150421220939/http://ajcsystems.com/blog/blog/2013/09/12/sometimes-things-just-work-the-first-time/)

For my wife’s birthday, I got her an Ouya game console so she could play an old emulated game (for which we own the cartridge, but our console is broken). I also recently ordered a Chromecast since hey, why not, it’s only $35. This required two more HDMI ports than our TV has, so I ordered a three-way HDMI switcher to plug everything into.

And it all works.

To be more specific, here are the things that are working that actually kind of astound me.

  1. I didn’t have a spare power plug close to the TV, so I wound up powering the Chromecast from the USB port on the Ouya. This works fine, even when the Ouya is off.
  2. The third item plugged into the switcher is our Xbox 360, which regularly has HDCP problems that prevent it from outputting sound to the TV. I was concerned that a $10 no-brand HDMI switcher wouldn’t support HDCP properly and would freak out the Xbox, but it works fine.
  3. The switcher properly detects which device is displaying video, and automatically jumps to the lowest-numbered device with a signal. This is particularly useful behavior (which I did not anticipate needing) since the Chromecast never actually turns off. This way, the switcher just stays on the Chromecast all the time unless we turn the Xbox or Ouya on; if we do, it switches to that other signal until we turn it off and then jumps back to the Chromecast. This turns out to be exactly the behavior I would have wanted if I’d realized ahead of time to try and engineer it that way.
  4. The HDMI switcher has a power port, but it didn’t come with a plug for it. I was initially bummed that it wasn’t going to work and that I was going to have to return it and get a new one, or try to figure out the voltage and find a matching pin, etc. etc., but I decided to try it anyway and see if it worked without external power. It did.

I spend so much time screwing around with our home theater setup (I have a custom-built HTPC running MythTV) and dealing with things that manage to not work in incredibly strange and unusual ways; it’s really rather refreshing when I build some Rube Goldberg contraption back there and things actually work the way they’re supposed to.

tags: #linux

2013-08-22 12:00

Adventures in One-Liners

(originally from https://web.archive.org/web/20150421214026/http://ajcsystems.com/blog/blog/2013/08/22/adventures-in-one-liners/)

I wrote this one-liner today, and that it exists makes me sad.

rrdtool update $tmpfile $(curl "http://127.0.0.1:4242/api/query?start=$(($(date +'%s')+$start))&m=sum:$metric\{cluster=$cluster,hostname=$hostname\}" | python -c "import sys, json; j=json.loads(sys.stdin.read())[0]['dps']; sys.stdout.write(' '.join(['%d:%s' % (int(x), j[x]) for x in sorted(j.keys())]))")

That it actually works just downright terrifies me.

tags: #mythtv

2013-08-22 12:00

New project: MythTV voice control

(originally from https://web.archive.org/web/20161024021737/http://ajcsystems.com/blog/blog/2012/06/11/new-project-mythtv-voice-control/)

From the README:

This script listens to a small set of voice commands in US English and translates them into instructions for a MythTV frontend. The intention is to emulate the voice control capabilities of an Xbox360 with a Kinect (e.g., you can say “Xbox pause” and it will cause the currently playing video to pause).

This post will detail some of the process I’ve gone through to get this working as far as it is, and what’s left to do.

Read more…

tags: #code

2013-08-22 12:00

The Little Ol’ Wiki From Pasadena

(originally from https://web.archive.org/web/20150422203816/http://ajcsystems.com/blog/blog/2012/10/30/the-little-ol-wiki-from-pasadena/)

It seemed like a simple enough desire. I wanted a small, functional wiki with (roughly) the following features:

  • Use a git repository for page storage and version control
  • Map files on the filesystem directly to web pages (making it equally easy to edit from a CLI or from the web UI)
  • Render various wikitexts (particularly Markdown) into some appropriate output format
  • Support intra-page links and image includes, etc.
  • Be written in a language I am comfortable with

I considered several projects, including:

  • Hatta: Backed by a Mercurial repo, non-trivial to change
  • Giit: Written in Haskell. I had neither the time nor the inclination to learn that for this project.
  • Gollum: Mostly suitable, but written in Ruby (which isn’t my strong suit). Plus I wasn’t super-fond of the way it handled subdirectories and other complex filetypes.

But none of them quite scratched my itch. Thus, I was left with no choice but to write my own.

Introducing valet

valet is a script that turns any directory into a simple wiki, complete with wikitext rendering, editing, and automatically committing changes to version control.

Here’s a short list of valet‘s features:

  • Single file, depending only on bottle
  • Handles navigating around the filesystem rooted where you start it
  • Automagically detects the type of various files, and (if you have the supporting Python libraries installed) renders them as they ought to appear. As a bonus, if you have pygments installed, source code will be syntax-highlighted where possible.
  • Changes from the web UI are automatically saved into the git repo (if desired)
  • Runs as a standalone service, serving from your local machine
  • Optionally supports CGI and WSGI; rename the script to something.cgi or something.fcgi and it will Do The Right Thing TM. This makes it suitable(-ish) for serving through Apache or some such with SSL, authentication, access control, etc. etc.
  • Installable with pip!
pip install valet

Hopefully this proves as useful to other people as it has been for me.

2012-10-22 12:00

"What do you mean, there's no podcast feed?"

(originally from https://web.archive.org/web/20150421230946/http://ajcsystems.com/blog/blog/2012/10/22/what-do-you-mean-theres-no-podcast-feed/)

Yahoo runs a little-known service called Yahoo Pipes, which lets you take inputs from a wide variety of sources (including, but specifically not limited to, RSS feeds), spindle, fold, and mutilate them, and then get an RSS feed out the other end. This is particularly useful if you have an RSS feed from a source that does some of what you want it to do, but isn’t quite perfect.

Case in point: the head designer for Magic: The Gathering started posting podcast episodes on his Tumblr blog. However, they’re mixed in with other non-podcast posts, and Tumblr’s RSS feed doesn’t link the podcast files up properly so they work in a podcast reader. Obviously, this situation cannot abide. I created a pipe to magically transmute the plain RSS feed into a fancy podcast feed, and this post will show you how!

Read more…