[Ruby] Delicious gem to play with bookmarks

Par défaut

One of my favorite tool is Del.icio.us, simply adding list of bookmarks to be shared with anybody, it’s easy enough to scrap a big list of HTML links to quickly make something more shareable, like Freeduino.org becoming http://del.icio.us/freeduino

So here is a quick ruby gem to play even more, just install it:

sudo gem install rdelicious

Then play with it:

require 'rubygems'
require 'rdelicious'

@delicious = Rdelicious.new("delicious_login", "delicious_password")

print "Correct login" if @delicious.is_connected?

@delicious.add("http://rdelicious.rubyforge.net/", "Rdelicious Gem")

if @delicious.url_exists?("http://rdelicious.rubyforge.net/")
	print "Url inserted into delicious"


unless @delicious.url_exists?("http://rdelicious.rubyforge.net/")
	print "Url deleted from delicious"

[Ruby] One line to save God

Par défaut

We’ve had unexpecting interruptions in our Feevy updaters last weeks, and the error (which is still strange) came from inside God, it was unable to decide if a process was still running.

If you’ve the same kind of problem, with your god logging showing « kill: 1: No such process« , then change the exists? method in /usr/local/lib/ruby/gems/1.8/gems/god-0.5.0/lib/god/system/process.rb file, gem path might not be the same on your system.

# Return true if this process is running, false otherwise
def exists?
    # system("kill -0 #{@pid} &> /dev/null")
    ps_int('rss') != 0

Here is our configuration if some people can find where this line is causing problem: Ubuntu Gutsy, Ruby 1.8.6, God 0.5

[Arduino] 3D LED Cube

Par défaut

3D LED cube

After a first try with tiny space between LEDs (see last post), here is another try with enough space to build a proper cube, still following MakeZine instructions.

The fun parts were to add transistors to the board, allowing to get more power for each led level, and the programming: Persistance-Of-Vision and binary manipulation for led on/off switching.

If you need it, you can download the arduino program related to this circuit.

[Arduino] Playing with LEDs

Par défaut

Arduino led-matrix The original project for tonight was to build a 3D LED cube, and the not-so-clever idea was to compact it the size of a normal dice.

Big mistake: first it was hell to solder all the tiny intersection of led cathods, then there is no way to pile up the array of leds if you don’t let space between them… maybe there’s a solution to that, and I’ve not find it yet.

Anyway, it was ready to connect to Arduino board, and to try to program this new led-matrix. Easy and fun, only problem is debugging messages while verifying source code on Arduino software that doesn’t help much, I’ll have to learn more about its syntax limitations.

Here is the result, 5 days before returning to Toulouse to visit Claire: