Support

Blog

Browsing all articles from December, 2011

Flattr this!

Once again, random browsing on Taobao brought the need for me to shop for random crap^Hstuff.

This time, I bought a USB eBuddy (for a grand total of 60RMB including shipping)

e-Buddy

eBuddy

The eBuddy is a small MSN / QQ physical avatar that performs certain actions based on its software – e.g. flashing lights, moving its wings, shaking left or right etc.

It looks like a little white angel with MSN color wings.

eBuddy

For a cheap toy, its actually quite cool. Cute too, but cool also.

Out of the box, its aimed squarely at Windows users. As I don’t actually run the devil’s OS, I hooked it up to a Debian box instead.
I was hoping for a little bit of fun integrating it with things, but that was not to be.
There is already a perfectly fine library written in Python that works beautifully to make it dance and sing* here

*Dancing and singing void where prohibited.

The python library is already set to run as a daemon on port 8888, and sits waiting for action out of the box.
The settings below snarfed from the code give an idea of what actions can be given:

Commands:

# GLADNESS =        00
# FEAR =            01
# FIZZ =            02
# PLEASANTSURPRISE =03
# GRIEF = 		04
# FURY = 		05
# QUELL = 		06
# REDHEAD = 		07
# GREENHEAD = 		08
# BLUEHEAD = 		09
# YELLOWHEAD =		10
# BLAME = 		11
# BLUEGREENHEAD =	12
# WHITEHEAD = 		13
# HEART = 		14
# WINGS = 		15
# BODY = 		16
# NOEFFECT = 		17
# ONLINE = 		18
# BUSY = 		19
# DAZE = 		20
# BACKSOON = 		21
# AWAY = 		22
# PHONE = 		23
# LUNCH = 		24
# OFFLINE = 		25

Mostly they consist of flashing various LED’s within the eBuddy on/off and optionally moving the wings or shaking the eBuddy left right.
Simple, but effective.

I use Zoneminder in the office on my Debian based ZFS NAS (HP Proliant Microserver), so thought one fun way would be to integrate the eBuddy to Zoneminder. This also proved to be too easy sadly.

Zoneminder has a wiki entry which gives 99% of whats needed here

I literally had to write 1 line of code to integrate the eBuddy with Zoneminder.

#!/usr/bin/perl -w

use strict;

use ZoneMinder;

$| = 1;

zmDbgInit( "myscript", level=>0, to_log=>0, to_syslog=>0, to_term=>1 );

my $dbh = DBI->connect( "DBI:mysql:database=".ZM_DB_NAME.";host=".ZM_DB_HOST, ZM_DB_USER, ZM_DB_PASS );

my $sql = "select M.*, max(E.Id) as LastEventId from Monitors as M left join Events as E on M.Id = E.MonitorId where M.Function != 'None' group by (M.Id)";
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );

my $res = $sth->execute() or die( "Can't execute '$sql': ".$sth->errstr() );
my @monitors;
while ( my $monitor = $sth->fetchrow_hashref() )
{
    push( @monitors, $monitor );
}

while( 1 )
{
    foreach my $monitor ( @monitors )
    {
        next if ( !zmMemVerify( $monitor ) );
 
        if ( my $last_event_id = zmHasAlarmed( $monitor, $monitor->{LastEventId} ) )
        {
            $monitor->{LastEventId} = $last_event_id;
            print( "Monitor ".$monitor->{Name}." has alarmed\n" );
	    #The Single Line of Code - it sends a flash green signal to the Python Daemon
            system ("echo 8 | nc -q0 -u localhost 8888");
	    #
            # Do your stuff here
            #
        }
    }
    sleep( 1 );
}

I think I’ll be getting a couple more of these, as the integration is easy.
Next up, server load monitoring – I can have a couple of these on the top of my desk for each server, and hopefully address each one separately for load purposes – e.g. flash yellow, red on load average, and shake if queue’s are large.
Gimmicky, but useful.

Here are a couple of shots of the current incumbent in situ –

eBuddy

…and one of it actually working.
(It flashes green if someone comes up the stairs and zone minder triggers.)

eBuddy

I’m quite happy I spent the 60rmb, although I would have enjoyed more hacking. I literally spent 5 minutes getting things running.
Thats not a bad thing, but I was hoping for something a little deeper!

Going to order a few more now.
I got mine here – http://item.taobao.com/item.htm?id=1799393549

Recommended.

Flattr this!

As its been a long while since I’ve done a non computer related post, its now time for something completely different.

Anyone who has visited our office has noticed that we receive a bazillion packages daily from my various shopping exploits on Taobao, slayer of money.

I just bought a new house back home, which has started competing with Taobao on the where do I spend my spare change, and I’ve been interested in decorating it with some “art”.
Yes, I know that one persons art is another persons ‘meh – you like that? icky’, but each to his own.

I found a gorgeous looking hi-res map of Shanghai for sale at one quite nicely designed store ( http://www.image1000.cn/ ), and contacted the seller.

Unfortunately he couldn’t sell the canvas image on a roll, as I needed for easy shipping back home, and could only sell pre-framed.

Roll on two weeks later, and I was still thinking about having that in my lounge back home, so decided on making a test order to check out the packaging, and its survivability vs Shanghai kuaidi (delivery) companies.

I picked a minimalist dot version of Mao for 100RMB including shipping, and ordered.
Two days later, Mao arrived.

Unpacking below:

Mao
Fresh from the Kuaidi company!

Mao
Nice packaging touches.

Mao
Uh oh!

Mao
Still well packed.

Mao
Kuaidi vs Packaging, who will win?

Mao
More uh-oh..

Mao
Packaging wins (although it was a close call).

Mao
Phew, looks ok.


Inside packaging (really really well packaged!)

Mao
Even comes with the hanging equipment, which is a nice touch.

Mao
So much attention to detail (plastic cover strip for acrylic front frame “glass”)

Twister^H Mao
Its Twister!

Mao
Oh wait, no, its Mao 🙂

Mao
Amjellybaby models the artwork.

Mao
Finally, in situ!

Overall, reasonably happy with this. Price is reasonable, and it (barely) survived the shipping company, so I think there would be a chance that a slightly better packaged version (i.e. adding a few layers of bubble wrap on the outside) will survive.

So, looks like I’ll be springing the 900rmb odd for the large canvas map version.

Wish me luck!


Addendum

Ordered the large triptych and crossed my fingers that it would survive Emirates.
It made the journey in better shape than the Mao print above did across Shanghai. No dents and zero issues.

Here they are in my new house, awaiting hanging…

Shanghai triptych

Shanghai triptych

Pricey at 900rmb, but worth it. Now I can point at locations on the satellite image and tell people I was here when they come visit the house!

2nd Addendum – final shot of this in place, finally on the wall after 2 weeks of sitting on the floor…

Archives

Categories

Tags

PHOTOSTREAM