Ruben Laguna's blog

Mar 20, 2009 - 1 minute read - dns dnscache dnschildren enable install mac macports port portfile webalizer

Warning: Invalid keyword 'DNSCache' (webalizer.conf) in MacPorts (Mac OS X)

If you installed webalizer via MacPorts in your Mac OS X you must know that it comes without dns support. That’s why you’re getting those

Warning: Invalid keyword 'DNSCache' (webalizer.conf)
Warning: Invalid keyword 'DNSChildren' (webalizer.conf)
Warning: Invalid keyword 'DNSCache' (webalizer.conf)
Warning: Invalid keyword 'DNSChildren' (webalizer.conf)

To enable it , uninstall webalizer

sudo port -d uninstall webalizer

Edit the Portfile for webalizer

vi /opt/local/var/macports/sources/rsync.macports.org/release/ports/www/webalizer/Portfile

to add an

  --enable-dns \

(note the ending backslash “") in the configure.args section just before of

Mar 19, 2009 - 2 minute read - arduino compass electronics heading hmc6352 library microcontroller

Arduino Library for Hmc6352

As part of my Xbee sensor project, I created an object oriented API to access HMC6352 compass functionality and I decided to make it downloadable as an Hmc6352 Arduino Library. Just unzip the file in the $arduino_home/hardware/libraries/. At the end you should end with $arduino_home/hardware/libraries/Hmc6352.

The library includes an example on how to use it (in File ⇒ Sketchbook ⇒ Examples ⇒ Library-Hmc6352 ⇒ Hmc6352.

Hmc6352 example menu

The example looks like this (also available as gist):

Mar 19, 2009 - 1 minute read - cyberduck mac macosx plugin quicksilver sftp

How to fix the cyberduck quicksilver plugin

If the CyberDuck plugin is not working for you, (you can’t right-arrow to see the bookmarks) make sure that you changed the default nicknames of the bookmarks.

Probably if you open the Console you’ll find some “missing nickname” errors there.

[March19] [March 19] 7:31:22 PM Quicksilver[6037] Error: No 'Nickname' key for favorite:

I found the answer in this google group Can’t right-arrow into Cyberduck - Blacktree: Quicksilver | Google Groups .

Mar 19, 2009 - 1 minute read - flip4mac mac macosx media os player plugin quicktime radio windows x

Listen to radio online (in Mac OS X)

I want to listen to Sverige Radio P1 in Mac OS X. It seems that Windows Media Player and RealPlayer are the only supported options so I thought I couldn’t do it but then I found Flip4Mac WMV Player also known as Windows Media® Components for QuickTime, by Flip4Mac™ . After installing it and restarting Safari 4, I could listen to SR P1 with no problem.

References:

Mar 18, 2009 - 1 minute read - arduino ds1620 electronics library sensor temp temperature

DS1620 temperature sensor library for Arduino

I talked about the DS1620 in a previous post. Now I created a DS1620 library for Arduino that has a more object oriented interface. The library has to be unpacked in the $arduino_home/hardware/libraries directory. After unzipping the library you should end up with a $ARDUINO_HOME/hardware/libraries/ds1620 directory.

The library contains an example that can be accessed through the File ⇒ Sketchbook ⇒ Examples ⇒ Library-ds1620 ⇒ ds1620.

library ds1620 example menu

Mar 17, 2009 - 6 minute read - arduino cluster compass electronics heading library measure measurement temperature tilt xbee zcl zigbee

Arduino XBee sensor (temperature, tilt, compass, and ambient light)

I finally put together an Arduino Pro Mini, the XBee, the MMA7260Q, the HMC6352, the TEMT6000 and the DS1620.

This is how it looks like on the prototyping board (ugly, I know)

xbee sensors on protoboard

Hopefully it would look better when I move it to the PCB. But before doing that I need to get the battery power set up. (I’m waiting for a MAX756 DC-DC voltage regulator and CoilCraft inductors to arrive)

Mar 12, 2009 - 2 minute read - api at command electronics examples frame response xbee

Example of XBee API frames

Some examples of XBee API Frames.

Modem status frame

7E 00 02 8A 06 6F

7E    : API Frame
00 02 : Length
8A    : Modem status
06    : Coordinator started
6F    : checksum FF – ((8A +06) & FF) = 6F

AT Command API Frame: MY

frame format
7e 00 04 08 52 4D 59 FF

7E    : API Frame
00 02 : Length
08    : AT Command Frame id
52    : Frame id
4d 59 : MY (4d 59) (4d ⇒ M, 59 ⇒ Y) Get the 16-bit network address of the module.
FF    : checksum ff = ff – ((08+52+4d+59) & ff)

AT Command Response: MY

command response frame structure
7e 00 07 88 52 4d 59 00
00 00 7f

7E    : API Frame
00 07 : Length
88    : AT Command Response API Identifier
52    : Frame id
4d 59 : MY (4d 59) (4d ⇒ M, 59 ⇒ Y) Get the 16-bit network address of the module.
00    : Status 0=OK
00 00 : MY value, 00 000 not set
7f    : checksum ff = ff – ((08+52+4d+59) & ff)

Explicit Addressing Zigbee Command Frame:

7E 00 1D 11 01 00 13 A2 00
40 3E 25 75 00 00 01 01 04
02 01 04 00 00 18 01 01 00
00 00 29 63 CE 9F

7E                         : Start frame
00 1D                      : Length (29 bytes)
11                         : explicit addressing transmit
01                         : Frame id
00 13 A2 00 40 3E 25 75    : 64 bit address
00 00                      : 16 bit address
01                         : source endpoint
01                         : destination endpoint
04 02                      : cluster id (temperature measurement cluster id/ Measurement and sensing functional domain)
01 04                      : profile id (home automation profile)
00                         : broadcast radius
00                         : options
18 01 01 00 00 00 29 63 CE : payload
9F                         : checksum

Let’s analyze the payload

Mar 9, 2009 - 10 minute read - algorithm based force graph java layout library netbeans prefuse topcomponent visual visualization visualizer

Force Directed Layout in NetBeans

I just came up with the idea of reproducing the GraphView demo I saw in prefuse by using the Netbeans Visual Library API.

The GraphView demo uses a Force Directed Layout algorithm to dinamically position the nodes on the screen. It’s really fast and cool. Download prefuse and experiment with it by yourself.

I wanted to achieve something similiar with the Visual Library and I succeed up to a point. The force based layout algorithm that I implemented is much simpler that the used in prefuse, so there is no spring-like movement. It looks way cooler with springs. It just uses repulsion between nodes and attraction between connected nodes.

Mar 9, 2009 - 1 minute read - column default get_sidebar kubrick narrow post sidebar single theme wide wordpress

How To Display Sidebar in Single Post in WordPress 1.5 / 2.0 / 2.7.x Default Kubrick Theme

I found this great tip How To Display Sidebar in Single Post in WordPress 1.5 / 2.0 Default Kubrick Theme.

The only problem is that the code that you should add is not properly shown in the post. He just copied the xml code verbatim in the post without escaping it and the browser doesn’t display it properly. So I’m reproducing it here for your convenience.

  1. Go to the theme editor. Appearance ⇒ Editor
  2. Click on Theme Files ⇒ Templates ⇒ Single post (single.php)
  3. Change the class of the first div to be "narrowcolumn" instead of "widecolumn"
  4. That is, replace:
    <div id="content" class="widecolumn">
    </pre>

    with