Archive

Archive for May, 2013

Redmine Command Line Interface – redlist

May 27th, 2013 subogero Comments off

redupload, redupdate, redshow, and now redlist. The new one prints the list of issues in plain text, project-wise or globally.

$ redlist -p test localhost/redmine
# Tracker Status      Subject      Assignee      Due date   
2 Feature In Progress Test Feature Szabó Gergely            
1 Bug     In Progress Test Issue   Szabó Gergely 2013-05-26

Uploading files? Check.
Creating or updating issues? Check.
Showing issue details? Check.
Listing issues? Check.

Redlist uses the CSV export feature of Redmine. As Text::CSV is not part of the standard Perl library, I decided to write my own CSV parser. It seemed easy until I tried it on an old mine, 0.9.3 to be precise. In which case it fell apart as the bastard puts each and every existing attribute into the CSV, including the multiline Description. What started with two simple regular expressions, ended up with five, plus a state-machine.

There was some trouble with encoding too. For best results, set your terminal’s locale to utf-8, as well as Redmine’s csv-encoding. On Debian, the yml files are in /usr/share/redmine/config/locales/ for each language. Look for

   general_csv_encoding: UTF-8

Bot the old mine’s output is still too wide for a terminal. Until you define your personal filters, that is. Create ~/.redgit and add

[redlist]
Created
Updated
Description
Parent task
Estimated time

Whatever. It’s still on Github: http://github.com/subogero/redgit

HP Laserjet P1102 on Raspberry Pi

May 22nd, 2013 subogero 3 comments

Printing is evil. Back in the day this evilness sparked even Richard Stallman’s ire and so the Free Software Movement was born. It was 1980 and the new Xerox 9700 laser printer’s proprietary software could not be modified to add an email notification feature.

Fast forward 33 years. The HP Laserjet P1102 has a proprietary driver plugin. It’s freely available for the hp-setup program on Linux. Except, that HP does not compile it for the armv6 architecture. So my home print server, a Raspberry Pi, did not work with my new shiny P1102.

Until I found Rick Richardson’s foo2jzs driver, that is. Instructions and download on http://foo2zjs.rkkda.com.

Morale of the story: free software has nothing to do with communism. On the contrary: it promotes private property rights. The communist, a.k.a. thief, is HP. I bought their printer with my own money, but the tricky bastards did not allow me to use it. A classic case of “redistribution of wealth”. It was Rick’s opens source driver that saved my day.

rpi.fm My Stations

May 20th, 2013 subogero Comments off

The Raspberry Pi kicks ass as a media player. Thanks to, among others, rpi.fm, my and my friends’ favourite internet radio player.

Ladies and Gentlemen!

Upon popular user request, I hereby present its new “My Stations” function. rpi.fm now remembers whenever you choose a station. It builds a list from them, ranked by how often you’ve chosen each, and offers a new command “m” to access them.

Enjoy. But only after you’ve updated rpi.fm form Github.

For those in the know:

cd rpi.fm
git pull origin master
sudo make install
rpi.fm

For rpi.fm Noobs:

git clone https://github.com/subogero/rpi.fm
cd rpi.fm
sudo make install
rpi.fm

Redmine Command Line Interface – redupdate

May 19th, 2013 subogero Comments off

We love Redmine. It’s everyone’s favourite integrated bug-tracker-wiki-gantt-roadmap-web-app running on Rails. It has everything. Except a decent command line interface.

There are some half-baked attempts on the internet, usually having suffered a few years’ time of bitrot and featuring loads of undocumented Ruby-related dependencies, so-called gems in Ruby-speak. I tried to install a few, but not being a hard-core Rubyist, I had to give up.

Long ages of desperation followed. Until I looked into Redmine’s email interface. Which, it turns out, is a command-line interface in disguise. I decided to leave Exim4 well alone, and write a user friendly command line wrapper around the obvious

/usr/share/redmine/extra/mail_handler/rdm-mailhandler.rb

My first attempt was a server-side only shell-script. But then I realized that any self-respecting person who uses the command-line has some sort of shell access to the Redmine server anyway, which also accommodates the central-ish git repos. So I added an option to run via SSH.

Ladies and Gentlemen: redupdate

Please find it on Github along with a few other scripts:
https://github.com/subogero/redgit

The other scripts include:

  • redupload: upload files to Redmine
  • redshow: view issues in plain text format
  • gitcreate: create bare repo, add HTTP access, optional email notification upon pushes