YAB Yet Another Blog

LaserTag at LasIndiasLast screw27 more to goRepRap for breakfastCrate numberingLed-discoMac-castLaser-light
Status » Blog theme updated

[Wordpress] Register hooks hacks
about Uncategorized on 07/05/2008 with no comments - like it?

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 );

Tags: , , , ,

[Jabber] Delicious Bot
about Uncategorized on 03/05/2008 with no comments - like it?

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

Tags: , , ,

[OpenID] All-in-One package to install your own server
about Uncategorized on 10/04/2008 with 4 comments - like it?

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

Tags: , , , ,

Indian Weekend in Asturias
about Uncategorized on 10/03/2008 with 1 comment - like it?

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 :)

Tags: , , ,

[Git] Gitorious on Ubuntu
about Uncategorized on 28/02/2008 with 1 comment - like it?

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

Tags: , , , ,

[Ruby] Behaviour Driven Development with RSpec
about Uncategorized on 24/02/2008 with 1 comment - like it?

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

Tags: , , ,

[Wordpress] Latest images attachment widget
about widget, wordpress on 16/02/2008 with 1 comment - like it?

Quick and dirty, a simple widget to display latest images attachment with a link to related post.

Update, more widget options::

  • Change Title
  • Set picture count
  • Set link destination to post or file
  • Select category to display

Attachement Viewer widget on Wordpress Extend

Tags: , , ,

[RepRap] Mechanical machine and Wii hacks
about order, reprap on 22/01/2008 with 3 comments - like it?

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

Tags: , , , , ,

[OpenWrt] Command-line router
about Uncategorized on 22/01/2008 with 1 comment - like it?

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!

Tags: , ,

[Wordpress] Theme viewer plugin
about Uncategorized on 18/01/2008 with 5 comments - like it?

Paco wanted a wordpress installation with one purpose: test different themes for the same blog.

The idea was nice, but know it’s even more fun with this new plugin: user controls which theme to display on the blog they are reading.

Try it yourself on lasindias.info

Theme viewer

There’re surely some more feature to add before the plugin is complete:

  • Use cookie to keep plugin whil navigating on the blog
  • Add form for admin to add or upload a new theme
  • Fun factor: save last selected theme as the default blog theme, users now control your blog presentation!

Download Theme viewer plugin for Wordpress

Thanks to Dougal Campbell for the original Preview Theme plugin.

Tags: , , ,