[Textmate] Arduino Bundle

After first days with the Darwin machine, it became clear that something was needed to replace the current Arduino software and upload the RepRap firmware directly from Textmate.

So here comes my first Textmate Bundle, thanks to the elegant work of Arduino team to make it easier to upload program from command line:

Arduino.tmbundle

Once installed, only one shortcut is available to make and upload your program on the Arduino board: Command-Shift-A

You can clone/fork the project from Github too, make your own repository and I’ll be glad to add your patch to the current simple bundle.
And come back during the week, you’ll surely see some update during the intensive RepRap hack session!

On the way to launch Live Clöthing, I had to hack this morning the register action hooks for WordPress, that don’t work as simply as excepted.

‘register_post’ action

You won’t be able to add more errors in $errors if you do not make it global in register_new_user() of wp-login.php:

function register_new_user($user_login, $user_email) {
global $errors;

‘user_register’ action

For some strange reason, $user_id is not available, you’ll need to add this hack to read it in your hook function:

$user_id = (int) func_get_arg( 0 );

[Jabber] Delicious Bot

Because when I see a good link, my main pleasure is to send it to as many friends as possible on IM, here is a simple jabber bot I could use to also save these links to my delicious account:

Download from github.com

It uses jabber-bot and rdelicious gem for ruby, you just need to configure the config.yml with your jabber and delicious login information and maje it run with:

ruby delicious-bot.rb

The bot will connect to the master jabber you’ve configured in the config.yml, and you just need to send him the bookmark command:

bookmark url description

You can add your commands easily inside the bot, and fork the project from Github.com:

Delicious-bot project on github.com

We are going to use our own openid server for various projects, it was fairly easy to install at then end.

Because sources are diffused on the net, here is a all-in-one package you’ll just need to put on your webhost to start your server:

Download package

Update: OpenId-Server now on Github.com

Configuration

In the package, you need to edit some configuration in web/config.php:

/**
 * The administrator's email address.  You may leave this empty if you
 * wish.  If empty, the "Contact (email address)" message will not
 * appear on every page footer.
 */
define('SITE_ADMIN_EMAIL', "admin@example.com");

/**
 * Set these values for administrative access.  This account will be
 * able to create and remove accounts from the auth backend.  This
 * username will not be permitted to use an OpenID.  The password MUST
 * be an MD5 hexadecimal hash of the password you want to use.
 * Example:
 *
 * define('ADMIN_PASSWORD_MD5', '21232f297a57a5a743894a0e4a801fc3');
 *
 */
define('ADMIN_USERNAME', 'admin');
define('ADMIN_PASSWORD_MD5', '');

Visit this page to transform your password in MD5 hash

/**
 * Storage backend to use.  Currently the only choice is "MYSQL".  See
 * storage.php for storage backend implementations.  Parameters for
 * connecting to the storage backend.  See storage.php if you want to
 * create your own backend.
 */
define('STORAGE_BACKEND', 'MYSQL');
global $storage_parameters;
$storage_parameters = array('username' => 'openid',
                            'password' => '',
                            'database' => 'php_openid_server',
                            'hostspec' => 'localhost');

There are more options you can change in config.php, feel free to experiment :)

Link to HTTP server

You need to tell to your server to access OpenID server in the ‘web‘ directory.
Here is how it works on my webhost:

ln -sf ~/openid/web/ ~/public_html/openid/

Now you can access my OpenID server on http://openid.alexgirard.com

Indian Weekend in Asturias

Here is the video made by David from the rushes of our weekend with Mercedes in Asturias to meet Maki, a new Indianos.

Everything was perfect: cider bars, local food, hiking in the mountain, asturian connection y dulce alegria!

PS: estoy pensando en español cuando quierre escribir algo, probablemente vais a ver un cambio de idioma en los proximas semanas :)

[Git] Gitorious on Ubuntu

This is the bash history to install and run Gitorious on a Ubuntu server (you need ruby-dev, rails, mongrel and git-core installed to continue).

Some pitfalls:

  • Texpow is not installing because of Onigurama, so download it and build it from sources
  • Problem: “cannot open shared object file: No such file or directory – /usr/lib/ruby/gems/1.8/gems/oniguruma-1.1.0/lib/oregexp.so“. Solution: sudo ldconfig
git clone git://gitorious.org/gitorious/mainline.git  gitorious
cd gitorious
sudo apt-get install libopenssl-ruby1.8
sudo gem install mime-types textpow -y
cp config/gitorious.sample.yml config/gitorious.yml; nano config/gitorious.yml
nano config/database.yml
rake db:migrate
mongrel_rails start

Then open your browser to http://localhost:3000

During the rewritting of Feevy.com with Merb, I’m discovering RSpec, a framework to be sure your code behave nicely.

Follow and join Feevy rewrite on Gitorious

Instead of normal test-units, you describe how your app/model should behave, which give a more-human conversation when you read your test:

  it "should create a feed from website http://blog.feevy.com" do

    feed = Feed.new :website => "http://blog.feevy.com"

    feed.valid?(:save).should == true

    feed.link.should == "http://blog.feevy.com/feed/"
    feed.website.should == "http://blog.feevy.com"
    feed.title.should == "Feevy Blog"

  end

To re-initialize your database between each test:

  before(:each) do
      Feed.delete_all
  end

Next step: writing Feevy stories

Great news today for RepRap at Las Indias: the mechanical machine has just been ordered from BitsFromBytes, and it should arrive in Madrid in 3-4 weeks.

Ian Reprap

Fully assembled and tested, in a wooden crate for easier transportation, I’ll hope to have the time to make some demo at the end of the month.

What’s missing:

  • electronic: we already have all electronics, but it has became a bit obsolete over the last few month, it would be great to upgrade it to Arduino platform;
  • experimenting: we’ll need to melt stuff then, and see how it reacts. Faboroni, another fabbing project, has made a recent experiement with various cooking material (chocolate, cheeze, …). And I’ll need to find a source to buy some plastic polymers, or make our own.

Then, will it be possible to plug your wiimote in RepRap?

Johnny Chung Lee has release a lot of really cool wiimote hacks, and the Reprap Forum is now looking how they could be used

[OpenWrt] Command-line router

The wrt54g router is good fun for all geeks, such a versatile network component with a lot of great feature coming from the open-source scene. Learn about its history if you don’t know yet, it’s one of the greatest GPL success after its use in a commercial product (win-win situation for Linksys and open-source communauty).

I’ve tried most of 3rd-party firmware to customize my router: dd-wrt (best solution for most cases), tomato (great appealing interface), and since yesterday night, openwrt

openwrt

Openwrt is just a command line interface to configure the router, with a linux-type system to manage files and services. With great simplicity comes great power.
But it’s sincerely not a point and click interface. At least, you’ll be forced to understand the concepts under network interfaces, which is why we all want to try these complex tools, and it’s free education for anyone :)

Once your router is stable, the fun begin. Openwrt comes with an itsy package management system, with a lot of software ready to deploy: kismet, ruby, apache…
Then with some easy soldering, you can plug a MMC/SD card on it, then you just need to have some imagination to create some fancy stealth network box!