A Jekyll hook for Gitolite

I'm back again to share a quick hook for updating a jekyll based website or blog upon pushing to gitolite .

What is Jekyll?

jekyll is a small website/blog generator written in Ruby. It takes several templates, pages and posts, and combines them into a fully functional site ready to be served by any webserver.

I've used Jekyll to power this blog for a few months now as the ability for me to write posts in Markdown and keep them stored in git is highly valuable for me. Previously I have been building the site locally and pushing the generated content to my VPS, but this is suboptimal and causes massive changesets (as you can imagine). Time to move that processing to the server where it rightly belongs.

Read more...

Live project documentation in Redmine

Continuing this series of posts on Gitolite hooks, this time I will be adding live project documentation to Redmine, using Doxygen.

Background.

Documentation is often as important as code itself, especially when working in a team or introducing new programmers.

But keeping generated documentation up to date is a pain, and it really shouldn't be.

At CodeShack we use Redmine as our project/task tracker. From here our developers have access to relevant projects with the ability to directly view the repository for that project, so why not add a "Documentation Tab" too?

Read more...

A SkypeKit transport for DCBot

A couple of posts back I walked through putting together a (somewhat) decoupled bot system using ZeroMQ and a bunch of scripts in various languages.

The transports I supplied as part of the example were for IRC and a local console. At the time I had also written a very basic SkypeKit transport but had decided not to release it as I was unsure about the terms and conditions surrounding this type of use (it previously had banned "server-side" usage, and likely still does, however my interpretation of that is a little fuzzy). So while I'm still unsure about it I figure there's no harm in releasing it with a disclaimer that you use this at your own risk.

Read more...

A Redmine hook for repo updates

In my last post I showed how to build a simple hooking system for gitolite Now I just want to share a very small script used to update Redmine changesets when you push to a git repository.

Background.

Redmine has an excellent repository viewer built in. It is even capable of reading through commit messages and closing tickets based on the contents, a very useful feature that we are taking advantage of. Due to this, having a team member commit a bug fix can fire off an email to the person who originally created the bug ticket, or at least it should.

The problem.

By default Redmine only processes these repositories when you visit the repository tab in a project. This makes sense, how else is it supposed to know when you've actually updated the repository? The most common solution to the problem is to set up cron to run a task to tell Redmine to update all repositories. Excellent, we can use this in a hook and make it all on demand and avoid wasting precious cycles ;)

Read more...

A hooking system for Gitolite

gitolite is a wonderful tool that makes hosting git repositories pain-free. Gitolite also supports adding custom hooks but for whatever reason I found it a little hard to get my head around for what I wanted (a post-receive hook per repository).

For that reason I've written up a guide to setting up custom post-receive hooks for your repositories to automate various actions. Let's get started.

Read more...

Building a decoupled IRC bot. Part Two: Functionality

Welcome to part three of this series. In this post I'm going to show how easy it is to turn what is currently a completely useless bot into something genuinely useful to you and your team.

Why Use a Bot?

We interact with many systems every working day, and very often we are doing this as part of a larger team.

Bots in whatever shape or form allow us to coordinate, automate, and enrich communication amongst our team.

In this example we will build in the ability for our bot to notice a bug ID within a message and return some data about that bug.

Read more...

Building a decoupled IRC bot. Part One: Transports

Welcome to part two (well, "One" because we started at "Zero") of this series. One thing I realised after writing the first part is that I didn't really provide a definition of decoupling (which is kind of important).

What is Decoupling?

When referring to software, it is the process of removing coupling or dependencies between individual parts of a system. When decoupling is achieved correctly, the failure of one part of a system should not result in the other parts failing.

The bot that we are implementing is only loosely decoupled, in the sense that one part failing won't cause the bot to lose a connection (unless the transport is the part failing of course).

Read more...

Building a decoupled IRC bot. Part Zero: Core

In todays episode of demonastery.org I'm going to build yet another IRC bot!

For this series however I am going to focus on the idea of decoupling. That is to say, separating out the functionality of the bot from the transports by way of a message queue (in this case we will be using ZeroMQ). By the end of this three part series we will have a bot that is mostly decoupled, allowing functionality and transports to be added and removed on the fly. Each part of this bot can run on separate machines and will be written in different languages!

DCBot

Read more...

Lambda concealing in Vim

One of the features I miss the most from Emacs when using Vim is the ability to mask certain strings as other strings (eg. Unicode symbols). The most often used case for this is when dealing with Greek characters (such as lambda), or when writing Tex.

Luckily, a guy named Vince Negri wrote a patch for Vim to provide a "Conceal" functionality. Most of the examples I've found for using this functionality deal with either Tex, or only with certain languages. It turns out it's pretty easy to force it for all file types though, simply place this at the end of your .vimrc:

au VimEnter * syntax keyword Statement lambda conceal cchar=λ
au VimEnter * hi! link Conceal Statement
au VimEnter * set conceallevel=2

And enjoy your beautiful new λ's :)

Lambda

Comment on this post.

The Perfect Android Emulator

I've recently been getting further into Android development and as most people that have touched the official SDK know, the Android emulator is giant pain in the ass to work with. The reason it is slow is a combination of factors (ARM - x86 conversion, slow screen updates), but fortunately thanks to the Androidx86 project you don't have to live with it any more.

Android

The Androidx86 project aims to port AOSP to the x86 architecture and supply drivers for common devices; it does this well and is getting better with every release. I'm going to show you how to set up the perfect Android VM for development (this assumes you have the rest of the SDK working fine, including access to adb from the command-line).

Read more...