27 Aug 2011, 7:52pm
Etc:
by

leave a comment

  • Mamiya RB67

    My earliest memory of real photography was this Mamiya camera my dad used for his work. My dad was an entrepreneur and started a small advertising company in the 80s, which means I grew up surrounded by tons of printing, design, photography, and various other creative works.

    The above pictures were taken at the garage of my parents’ house back in Jakarta, Indonesia, sometime in the 90s.

    15 Aug 2011, 9:42pm
    Projects:
    by

    leave a comment

  • Break Room

    On one weekend evening…

    13 Aug 2011, 6:46pm
    Work:
    by

    1 comment

  • Node.js Presentations

    I gave two Node.js-related talks within the past week.

    The first one was titled “From Java To Node.js”, at Shine Technologies‘ developers meeting on August 5th, 2011.

    The second one was titled “JavaScript Everywhere From Nose To Tail”, at Melbourne JavaScript usergroup on August 10th, 2011, with Carl Husselbee from Sensis.

    Happy with the positive feedback from the audience of both talks, thanks folks, much appreciated!

    Update (08/09/2011):

    And here’s the video from the second talk…

    JavaScript Everywhere – From Nose To Tail from Benjamin Pearson on Vimeo.

    4 Aug 2011, 9:21pm
    Projects:
    by

    leave a comment

  • Using Node.js To Discover Jenkins On The Network

    I’ve just added a new feature to Nestor to discover Jenkins on the network, and as it turned out, it’s pretty simple to do thanks to Node.js Datagram sockets API (hat tip Paul Querna).

    Jenkins has a discovery feature as part of its remote access API where it listens on UDP port 33848, and whenever it receives a message, Jenkins will respond with an XML containing the instance’s URL, version number, and slave port information.

    So how do you send a UDP message using NodeJS?
    Here’s a sample function adapted from Nestor’s lib/service.js:

    function sendUdp(message, host, port, cb) {
        var socket = require('dgram').createSocket('udp4'),
            buffer = new Buffer(message);
        socket.on("error", function (err) {
            cb(err);
        });
        socket.on("message", function (data) {
            cb(null, data);
        });
        socket.send(buffer, 0, buffer.length, port, host, function (err, message) {
            if (err) {
                cb(err);
            }
        });
    }
    

    For Jenkins discovery purpose, send any message to any hostname on port 33848:

    sendUdp('Long live Jenkins!', 'localhost', 33848, function () { ... });
    

    and if there’s any Jenkins instance running on localhost, it will respond with an XML like this:

    <hudson>
      <version>1.414</version>
      <url>http://localhost:8080</url>
      <slave-port>12345</slave-port>
    </hudson>
    

    Simple!

    konan cliffano$ nestor discover
    Jenkins 1.414 running at http://localhost:8080/

     

    Recent Posts

    Recent Comments

    • Cliffano Subagio: It does sound like something from Kelly, but it’s been a while since I read the book and I...
    • ben: I am trying to find & verify this quote of Kelly Johnson’s, (date, time, to whom and location) which...
    • Monty: Awesome post. I love what you have put out here. It is truly inspirational. I wish you continued success. I...
    • Cliffano Subagio: Good to hear about your opportunity to visit Japan, I’m sure you will have a great...
    • Kayla: I’m going to Japan for two week this summer. Our sister city is Tsubame, Japan and my school has an...

    Most Commented Posts

    Linkroll