flying monkeys

4000 series CMOS 24 hour clock

 For the last couple months a friend and I have been working on a 4000 series based clock in electronics class. After having failed building a FM receiver, we opted for a clock. We didn't go the microcontroller way, but old school ICs. So, we created a circuit for a simple clock. I opted for a 24-hour version, while my friend made the 12-hour equivalent. 

The above image was the basis of the circuit. Not shown was a 4060 and 4013 IC to make a nice 1Hz signal which we can use for the seconds. The rest is fairly simple: allow the seconds and minutes to count to 59 and use AND gates to reset at 60. Also pictured is the buttons to set the time. We used two 2N2222 transitors to make a NOT gate. Though, this ended up being too glitchy so I opted for a 4011 to create stable square wave.

Reverse postal code lookup in PHP

 I've never played with any geolocation tools before but I thought I'd take a whack at it. After stumbling across GeoHelper, I thought I'd test things out with it. Well, after finding that the only reverse postal code lookup is Canada Post, I might as well make my own.

Download GeoHelper and script at the bottom of the page and place it in the same directory. That's pretty much it, the code explains itself. It can also do a reverse lookup on IPs.

 

Live demo here

 

 

 

How not to order RAM

So, back in June or so, I ordered four sticks of 2GBs of RAM for my main workstation, DDR2 PC6400. Couldn't wait to get them right? So, a month goes by and they finally come in. Now, the board I have right now is a Supermicro X6DVL-EG2 which accepts ECC RAM. I thought my current RAM was non-ECC so I said fuck it and ordered non-ECC RAM. Wrong. RAM came in, tried it, motherboard beeped at me. Fuck. So I sent it back out east for a refund (to Newegg). A week or two goes by until I get the refund so I go ahead and order DDR2 PC6400 RAM. Though, when I remember installing the last sticks of RAM, I remember reading "DDR2 400MHZ ECC ONLY" on my motherboard. Ahh, fuck it. New RAM comes in and, oh, surprise! It doesn't work! 

 

Templating with Twig

I've been working on this shitty video sharing site for a couple weeks now and thought I'd try out some new things. I' used phpass for the password management and ended up using Twig as a template framework. I've never used a template engine before so I was new to using one. Twig is actually quite easy to implement into any of your projects. In your PHP script add:

 

require_once 'Twig/Autoloader.php';
Twig_Autoloader::register();

$loader = new Twig_Loader_Filesystem('templates');
$twig = new Twig_Environment($loader);
$template = $twig->loadTemplate('index.html');
echo $template->render(array('value' => 'test');

And that's it. In the example, 'index.html' is the template file. The array passes the variables onto the template. So, your index.html would look something like this:

 

This is a {{ value }} 

That would echo 'test'. The documentation for Twig is alright but it doesn't show how one uses the core extensions. See the below example as a block is transated for Twig's use:

 

      $a = $s + ($limit);
       if ($a > $numrows):
       $a = $numrows;
       endif;
       $b = $s + 1;
       echo "Showing results $b to $a of $numrows";

Becomes:

{% set a = s + limit %}
    {% if a > numrows %}
        {% set a = numrows %}
    {% endif %}    
{% set b = s + 1 %}  
   Showing results {{ b }} to {{ a }} of  {{ numrows }}

 

New hardware

 

So, I recently came into posession of an IBM Model M (1391401) and wow. This beats the hell out of my Logitech G15. A long with the keyboard, I thought I'd buy myself a new mouse while I was at it. Well, I ended up buying a Kensington Orbit with scroll ring.

 

The keyboard is amazing to type on. Though some may find it a bit loud, it's a pay off for the sheer coolness of it. I'm still getting used to my trackball and, as you can see, it has an extra wrist-rest attached to it.

PowerEdge 6400

 

So I got this Dell PowerEdge 6400 and wow. First, this thing is gigantic. Eight hot swappable SCSI bays in the front. Free is a good price ;)

Inside this thing has two Intel Pentium III Xeon processors, running at 750MHz each. Where you see the RAM is actually a tray of RAM. You can remove the tray and fill up 16 DIMMs. Hot swappable PCI ports too. Three redundant power supplies in case a tornado hits or something. I'm planning on getting a SCSI drive or two and getting Solaris running (or perhaps Nexenta).

Life update

Haven't posted in a bit, thought I'd tell everyone that I'm still alive. Schools started again, so that'll take some time away from coding. New motherboard has been running superbly. One of my other computers with an Asus P4PE board has a voice over when it's booting. So the other day, it's booting up and I hear voices coming from the headset. Finally figure out it's the BIOS that's speaking to me. I will say that I do admire my Solaris server. It's quite rock-solid (well, other than the random reboots when untar'ing something large) and everything feels like it's complete.



Other than that, life's been the same. My breadboard came in a little while ago so I've been experimenting with IC's and such. 



Well, back to doing nothing.


Dual Xeon build

I've had these Xeon processors sitting around for a while now and I thought it's about time to get a motherboard for them. Two are clocked at 3.0Ghz/1MB/800, other two are at 2.8Ghz/512/533. I ordered a Super Micro X6DVL-EG2  from eBay for $120 of which I seen this motherboard up to $250. Anyway, came the other day and finally put it together. Heatsinks didn't screw into the case as it should, so I had to screw the nut right onto the heatsink. 



iPhone borken

Yes, I purposely spelled that wrong. Anyway, the entire left of the touchscreen on my iPhone doesn't work. Plugged it in at night, then didn't work in the morning. So, I've had to suffer only using the right side of the screen for the last two weeks. Going to have to restore back to factory defaults, package it up and send it off.

 

Luckily, I've been somewhat productive lately. I've added some new features toSysode, the free project management app I've been working on since late August. There only needs to be a couple features added (member search, user control panel, etc.) and then it'll be mostly done (err..). And, for once, it looks half decent.

 

School'll be out in about two weeks; summer job then. Makin' bank...