Choose color scheme

About the Author

544 Posts By ben

  • A sea of tomatoes

    A few pics of all the tomatoes to come. Roughly 100 tomato plants, at 10lbs of tomatoes per plants, this means we’ll be doing some serious canning this year.

    More cheapo frames – the tomato super-highway.

    Flowers means we’ll be getting some yum-yum soon.

    The plants that were planted the earliest of the season were given left-over scraps of wool in order to better retain heat & moisture. They are by far the most sturdy of all tomato plants. Lesson learned.

    Look at ’em fancy plants, even I don’t wear such nice fiber.

  • The impairing lack of light pollution

    When we lived in the city, ambient light pollution was such that I could set my CCTV cams to a certain brightness/contrast and the limited auto adjustments they did were enough to cope with day & night. In the middle of the forest, the night gets full on #000000 dark. The poor cams can’t adjust and I need to pick whether I want to record at night and get white frames during the day, or at daytime and get black frames during the night.

    I wrote the following script which computes the average brightness of a cam’s current frame and issues more drastic adjustments if needed. It is obviously tailored for my FI8918Ws but the same idea can be used for others.

    #!/usr/bin/php
    <?php
    
    $img = @imagecreatefromjpeg( 'http://192.168.1.203:8003/snapshot.cgi?user=<username>&pwd=<password>' ) ;
    if( $img===false ) {
        die( "Unable to open image" ) ;
    }
    
    $w = imagesx( $img ) ;
    $h = imagesy( $img ) ;
    
    $total_r = 0 ;
    $total_g = 0 ;
    $total_b = 0 ;
    for( $i=0 ; $i<$w ; $i++ ) {
        for( $j=0 ; $j<$h ; $j++ ) {
            $rgb = imagecolorat( $img, $i, $j ) ;
            $total_r += ($rgb >> 16) & 0xFF;
            $total_g += ($rgb >> 8) & 0xFF;
            $total_b += $rgb & 0xFF;
        }
    }
    
    $average_brightness = round( ( $total_r / ($w*$h) + $total_g / ($w*$h) + $total_b / ($w*$h) ) / 3 ) ;
    echo $average_brightness, "n" ;
    
    if( $average_brightness<30 ) {
        echo "night time!n" ;
        echo "moden" ;
        $result = file_get_contents( 'http://192.168.1.203:8003/camera_control.cgi?param=3&value=0&user=<username>&pwd=<password>' ) ;
        sleep( 10 ) ;
        echo "contrastn" ;
        $result = file_get_contents( 'http://192.168.1.203:8003/camera_control.cgi?param=2&value=6&user=<username>&pwd=<password>' ) ;
        sleep( 10 ) ;
        echo "brightnessn" ;
        $result = file_get_contents( 'http://192.168.1.203:8003/camera_control.cgi?param=1&value=240&user=<username>&pwd=<password>' ) ;
    } else if( $average_brightness>170 ) {
        echo "day time!n" ;
        echo "moden" ;
        $result = file_get_contents( 'http://192.168.1.203:8003/camera_control.cgi?param=3&value=2&user=<username>&pwd=<password>' ) ;
        sleep( 10 ) ;
        echo "contrastn" ;
        $result = file_get_contents( 'http://192.168.1.203:8003/camera_control.cgi?param=2&value=4&user=<username>&pwd=<password>' ) ;
        sleep( 10 ) ;
        echo "brightnessn" ;
        $result = file_get_contents( 'http://192.168.1.203:8003/camera_control.cgi?param=1&value=64&user=<username>&pwd=password>' ) ;
    }
    
    ?>[/code]
  • Woodchuck

    The neighbor’s vegetable garden has been ravaged recently by what he thought was a woodchuck. Now our garden is doing just fine but just in case I started reviving the old CCTV system. Bare in mind I have never had an encounter with one and only know what they look like based on the label of some mighty delicious cider.

    Pictured bellow, said mighty delicious cider in action.

    A casual look out the window and I see a fat cat inside my fenced garden. Thanks the the neighbor’s heads up & the power of delicious cider I know exactly what is going on: woodchuck, inside my fenced garden, having an all you can eat buffet…

    I run upstairs to get a pellet rifle thinking it’s not worth alarming the neighbors with gunfire and that it will probably be enough to give it the scare of its life. Turns out the rifle it much more powerful than I had imagined and just drops the poor thing dead.

    Sorry woodchuck…

    Devastation

  • Verizon’s 4620L, a great device for the technically inclined

    My family recently moved to a fairly remote area, the question of internet access has been a major one for the couple of months leading to the move. Besides satellite & dial-up, our only option was Verizon’s MiFi (3G or 4g if you’re lucky) in the form of a hotspot device: the 4620L.

    I was afraid that the 4620L would try to be too smart and not let you tinker with it very much, very few decent reviews are available online and the official documentation is seriously lacking. Fortunately this couldn’t be further from the truth, it is a great little device that performs well and lets you turn all its knobs.

    When using “USB tethered mode” I was afraid I’d need specific drivers and a software suite running but lo and behold, it actually just pretends to be an ethernet device over USB. Absolutely perfect to put a Linux router in front of it!

    One thing that did not get properly QA’d is the “Enable DCHP Server” checkbox which simply doesn’t work. But guess what, I want to do my own routing and I’d like to avoid NATing from the 4620L to the Linux router. One way to circumvent this is to use the “Config File Download” and “Config File Upload” options which are meant as a way to backup & restore configuration but since the file is all intuitively labeled XML it’s easy to disable the DHCP server from there.

    While you’re in there, you can also override the maximum number of “Available Wi-fi Connections” (5 when using 3G). They probably have this restriction so regular Joe user doesn’t hook a gazillion device and complain about speed over 3G. Reaching this limit is very easy nowadays.

    A new mission

    Verizon’s plan is pretty pricy and very metered… All we get is 5GB per month, each additional 1GB will cost us $10. Ouch… I need to configure the network to consume as few bytes as possible. Netflix is out, AdBlock is in, automatic updates of various types are out. Above all, my home server will now be doing some serious routing, the goal of which is to allow devices to be on the home intranet while minimizing their use of the internet.

    No inbound connection

    That’s right, the IP you get from Verizon is in the private range (RFC 1918), this means they are doing some NATing of their own. You can forward ports all you want on your 4620L this will have no effect. Your only option is some cumbersome hole punching.

    We’ll be talking routing in a next post, I would have liked to find this information about the device & Verizon’s setup so I wanted to put it out there sooner rather than later.

  • New England commuting

    Bicycle


    kayak


    free bus without hobos

    And of course, car

    More to come…

  • Rain

    My beautiful wife having more balls than me.

  • Removing the accident

    Further inspection showed that the comb on the floor was most likely a mis-attached comb that fell from a top-bar. The bees weren’t exactly expanding on it but they weren’t removing it either, it was time to give them some help. Doing so was like playing a game of Operation but it went very smoothly and the beesĀ  were very docile even though I was digging pretty deep in their hive.

    Not much in this wreck of a comb but the bees were still tending to some brood in there.

    Going at it very carefully.

    I’ll leave them to clean the remaining pieces.

    Eventually one of the back bars that I had set aside was abandoned of all bees so… I just took it! Not necessarily the best thing to do but I was very eager to taste what the bees were up to. And it was delicious.

    From comb,

    To sweet nectar.

    It tasted very much like a mix between sap & honey, super good.

  • Honey & an accident…

    I inspected my hive today and it’s doing great. I drilled a few holes in the part that is currently uninhabited to give the bees some air. I did it early in the morning to lock them inside for the drilling, they took it really well and didn’t care a bit about the ruckus, even after I released them. I continued on merrily with the inspection as if nothing happened.

    A few holes for aeration in the middle of the hive, I stapled netting to prevent robbing and to make sure they don’t become an entrance.


    Honey!

    Today’s surprise though, came with the presence of comb on the floor. I’m not sure if this fell from one of the top bars but I doubt it. I don’t know what to do with it right now, I’ll monitor the situation and decide later whether to remove it or not.

    The mess