The Stochastic Game

Ramblings of General Geekery

Posts tagged with github

Using Mercurial to publish a PieCrust website

These days, all the cool hipster kids want to deploy stuff by pushing a Git or Mercurial repository up to their server.

hipster cat

And that’s pretty cool indeed, because you basically update your website by doing something like:

hg push myserver

So here’s how you can do it with PieCrust (although 90% of this article has nothing to do with PieCrust):

  1. Installing Git/Mercurial/whatever on your server
  2. Setting up your SSH keys
  3. Pushing your repository
  4. Defining hooks/triggers

Keep reading for the meaty details…


XBMCFlicks in Canada

I recently cut the cord, as they say, giving up cable TV in favor of Netflix and generally doing more productive things otherwise (which is easy since Netflix up here in Canada doesn’t have nearly as much content as in its home country). The problem was then to figure out how to access Netflix’s streams at home.

The web interface works well enough but is obviously not suited for using from the couch (even with that very handy Rii remote). The other official options are devices that I don’t have, except for the Xbox360 and the Wii. I haven’t tried it on the Wii yet, but I know I certainly don’t want to use my Xbox360 since it’s loud as hell and I’d need to wait for it to boot up before I could watch anything… so I went the unofficial route, as it’s often the case with guys like me.

I started with Boxee, since it’s a lot better than XBMC when it comes to apps and its Netflix app looks very nice. The problem was that it’s only supported in the US at the moment (except on the Boxee Box itself). I tried tweaking the app’s code to make it work in Canada and eventually got that somewhat working, but it was a lot more effort than what I expected (maybe I’ll post about that later if I get it in a state I’m happy with, unless the Boxee guys actually release an update that fixes the problem). Still, it was a nice way to keep Python programming fresh in my mind.

I then reverted back to XBMC, which I’m a big fan of, and its XBMC-Flicks add-on, which lacks style but is at least functional and supports Canada. Still, there were a few blocking issues so I had to go in the code and change a few little things. I uploaded my fork on Github, so you can grab it from there and try it for yourself if you’re a canadian XBMC/Netflix user. Those fixes should be integrated into the offical add-on soon anyway.

Announcing PieCrust

You may have noticed that this blog has changed its look, and has migrated its comments to Disqus. You may also see at the bottom of the page something about some pie crust baking… here’s what’s happening.

I have a few websites around and most of them don’t have much in them (e.g. I use the domain name for other things). There’s clearly not enough content to use a proper CMS, but there’s a bit too much repetition for my tastes if I write HTML files by hand. Also, I wanted to take advantage of libraries like Markdown or SmartyPants to make my text look nice with no effort. Basically, I needed some micro-CMS that would handle some basic layout and formatting.

Then there was the issue of this blog. It was running with WordPress, which I’m very happy with usually, but it wasn’t geeky enough. Also, syntax highlighting for code snippets felt dirty and over-complicated. I stumbled upon the whole “static site generation” underground scene and figured I could find something in between: a micro-CMS (for my small sites) that could also bake its own contents into static HTML files (for this blog).

pie crust

Enter PieCrust.

There was already a shitload of static website generators, but none that could also work as a “dynamic” micro-CMS. Also, I’m a programmer geek, so it’s kind of my duty to not be happy with existing solutions and write one myself (“_this one uses curly braces, but I want to use brackets instead! Surely now I have to write my own!_). Anyway, isn’t the whole point of home projects to write stuff for yourself, to learn something new or just have fun with a new subject, regardless of whether it’s productive? I was bored, too.

I ended up writing PieCrust in PHP not because I like PHP (it mostly sucks), but because it’s still the most widely used web application language out there. And also because I’ve already got other home projects aimed at having fun with Python and Ruby.

So there you have it, go check out PieCrust. The code is on BitBucket, and mirrored on GitHub.