Tag Archives: github

Parsing WFM Oscilloscope files in C

So, I got this Rigol Oscilloscope – I wrote a little instructable about it. One cool feature is the ability to save waveforms to a USB stick. There are many options for the file format, but the default is a WFM file. Now, a true minimalist could just use the CSV option, but the WFM is a binary format that contains a lot more information directly from the scope. I wrote a little C program hosted on github that allows you to convert those pesky proprietary files into something useful – namely a gnuplot image!

This is super alpha, and I’ll happily take patches. Cheers!


Moving the mouse with Python

I’ve been using KDE4 in Ubuntu, and I really like it – it’s slick, has everything I need, and it all seems to gel together pretty well. Yet, the power management is really starting to make me angry. I’ve turned all of it off, checked ps and other tools for any signs that it’s still running, and despite my efforts, my screens still turn black after 10 minutes unless mplayer is running. So, I decided to fix that using Python, which actually turns out to be pretty nifty. I got the original idea from here, and modified it to loop a bit. Here’s the result:

This moves the mouse around just a tiny bit, and works well enough to watch flash video for extended periods of time. To kill it, just hit Ctrl-c. Thanks, Python!

Diving into OOC, a fun new programming language

OOC is cool.  Yesterday I started writing some code in it after reading about it on the github blog.  Here is the first result:

I’m extremely happy with how well this performs.  Using the latest ooc Java compiler from the github trunk to handle the each() functions, this compiles down to a bunch of C code, and then is automagically compiled behind the scenes into an ELF Binary!  This is totally awesome, and I have to commend nddrylliog and the other contributors for their work on this awesome project.  Now I should use it for something useful :D

A quick note about getting it running on Ubuntu:


sudo apt-get install sun-java6-jdk
git clone git://github.com/nddrylliog/ooc.git
cd ooc
JAVA_HOME=/usr/lib/jvm/java-6-sun/ make

At least, that’s how I did it. Then I compile all my ooc with a Makefile like this:


INPUTS=$(wildcard *.ooc)
TARGETS=$(patsubst %.ooc, %, $(INPUTS))

all: $(TARGETS)

%: %.ooc
  java -jar ~/repos/ooc/bin/ooc.jar $@

That will compile all ooc files in the directory.

Ruby to generate RSS feeds for sites that don’t offer them

There’s this site that has an equipment exchange I wanted to keep track of. Yet, it’s done with what seems to be a custom php file rather than vbulletin, so none of the usual RSS feeds from the site apply to it. So, I decided to make a scraper/feed-generator to get me the latest version every 5 minutes and generate a nice RSS feed, so I can view it in Google Reader. The volume of posting is low enough that this won’t be annoying to see in my daily feeds.

I usually use Ruby for this because it offers Hpricot, a very nice and fast scraper and XPath interface. This time, I resolved to find something that does RSS generation better, and I stumbled upon RubyRSS, which happens to be in the core ruby distribution!
Continue reading

GitHub Widget for WordPress

For all you coders out there wanting to show off all those forked repositories, the github-widget is for you.

There are a few ways to install.

  1. Download from here.  The most recent stable release will be available.  As of this writing, it’s REL-1.3.
  2. Clone the git repository: git clone git://github.com/hank/github-widget.git
  3. Get it through WordPress (Work in Progress)

If you use one of the first 2 methods, just drop the resultant directory into wp-content/plugins/.

Using any of the three methods, after you have it installed, go to the Admin panel, Plugins -> Installed.  Then, activate the plugin.  Then, go to Appearance -> Widgets.  Put it into a sidebar, and go look at the results.

Please report any errors or problems as a comment to this post.

UPDATE: I just found out that my minimal searching for ‘Github’ in the plugins area, which found no results when I tried it, was insufficient.  I should have used Google.  Oh, well – at least I know how a widget works now!