Monday, January 28, 2013

Inverted Colors Cube

Back in October, I first posted about my Inverted Color Cube.  It's basically a stickerless DaYan Guhong, which has colored plastic instead of black with colored vinyl stickers on it.  In this case, I put black stickers on it.  So rather than getting squares of color, each framed in black, you end up with squares of black, framed in a color.  I had run out of black stickers when I originally made it, and only recently placed an order with Cubesmith, including a bunch of black stickers.  I was finally able to finish this sticker-mod!


I think it looks awesome, and it's a lot of fun to play!  It's not too much of a challenge, but it's certainly a nice change!

Here are some of the sticker sets I just got from Cubesmith.  Each of the sets was only $2.50, and arrived in about two weeks.  If you plan on doing this with your cube, be sure to get the plastic scraper tool thing.  It's essentially a plastic razor blade, perfect for removing stickers.


Also in the order were a few sets of other stickers.  The top set is the vinyl "Studio" color set.  The colors don't really translate well here, but the blue is a dark blue, the green is a regular green.  Also, in person, the difference between the red and orange is a lot more obvious.

The bottom row is the vinyl "Half-Bright plus Bright Blue".  The green is more fluorescent, and the blue is noticeably brighter than the above.


Here's the vinyl mosaic set.  There's no green, but there's a pink set instead.  The red and orange are about as similar as they appear here.  Also the white/silver is prismatic, while the gold is just circular-brushed.  I'm not sure I like this set all that much.


I also got some extra white/silver prismatic vinyl stickers, the stack of black stickers, one set of which I used on the cube at the top of this post.  Then the bottom six are the vinyl "Chrome" set.  Silver, Orange, Green, Gold, Red, Blue.  They look really pretty in person, nice and metallic shiny looking.


And here is my Zhanchi restickered with those chrome stickers.  The thing is brilliant.  The funny thing is that in person the red and orange are very distinct, and the silver/gold are difficult to see... the opposite of this image.  But man...SHINY!  I'll have to be sure to always put it in a carry bag so that it doesn't get scratched to hell. hehe.

Thursday, January 24, 2013

D15 Stepper Motor Reset Fix

One minor change I just figured out to my stepper motor to Arduino project from before, in relation to the wiring for the reset portion of the circuit.  I was having issues with programming these, once the Arduino firmware was on.  They wouldn't always reset properly when sending down new firmware via the Arduino interface.  I just looked at the circuit for the Arduino itself, and realized that a 10kΩ pullup resistor was missing from the circuit.

All of the circuits on the main page, as well as on the daisy chained serial project need to have the 10kΩ resistor added for proper functionality.  The resistor is essentially tied from +5 volts to the reset pin, pin 4 of the D15 connector.   It's a cheap and easy fix, which lets these things work oodles better!

Addressable LEDs



I'm in the process of constructing/setting up my office in the house, and for lighting, I have decided that I want to use xmas light-style lighting.  Many years ago, I used to light my room with multicolored incandescent lights. I loved the warm indirect glow, and smooth light without a single light source.  This time, I'm going to take it a step further.

While there's nothing about this project yet that is really innovative over what others have done, it is the first step to getting the office lighting done.  The real fun will come into play once I'm able to hang this up, and start programming effects, and tying those effects in to physical or time-based events.

A couple years back I picked up a strand of addressable LED lights, similar to this one, available at adafruit.com.  I got a strand of 50 lights, blew out one of them while being stupid, and used a few of them in Jasper's Toy Box (posts to come about that eventually), so I'm left with 42 lights.  A nice number.

In any event, the plan is to hang them up around the upper perimeter of the room, and it will give a nice comfortable glow to illuminate the room.  I can also extend it by doing lighting effects with the color.  For example, in the evening I can have all of them dim blue, and randomly twinkle one to white, to simulate a star in the sky.  I could also tie them in to an automation system to glow a particular corner of the room red or yellow when i have email from a specific person.  I could also adjust their color based on the content of my monitor, or the light outisde, etc.

The basic design for the control circuitry is that there will be an Arduino-based AVR micro (actually one of the D-15 servo controllers I've appropriated), which is perfect, since the strands only need two lines to control them.  The host computer will send down codes to address the LEDs (set all to color X, set led Y to color X, etc) and this will pass on the content to the strand, and twiddle the data lines and all of that fun stuff.  I had considered putting more "smarts" into the micro, but the amount of space in there would severely limit the kind of content I could "display", so I decided to put all of the grunt work back on the host computer.

To power it, I needed to get a 5 volt power supply. I snagged a power brick from an old external drive case, as well as a standard PC power connector, from a failed power supply, and spliced the two of them together.

Copious, yet appropriate amounts of heat shrink tubing and splicing some wires yielded a nice power supply.

Next, I built an interface board to tie it all together.  The ports on the board are (left to right) - 6 pin FTDI interface for serial IO, 2 pin jumper (power the D15 from the power supply rather than FTDI source), 3 pin power, 4 pin light strand connector.  You can also see in this picture, the process of crimping the terminals for the molex connector on the LED strand's wires.

I kept the layout and pinout of the FTDI the same as I used for my serial node experiment.  This will help me plug that connector in correctly.  I still need to add visual cues (colored sharpie markings) to help me align the pins correctly.  The power connector has GND on pins 1 and 3, and +5V on pin 2.  Keeping it symmetrical will help me always plug it in correctly, reducing the chance that I will blow it all up.  The 4 pin connector is the same pinout as the wiring of the LEDs.  GND, Data, Clock, +5.


The jumper on the board (dis)connects the power header from the D15 and FTDI portion.  If I make standalone firmware for it, I can power everything from the power supply, if need be. The tiny green LED on the board just lights when the D15 has power.  A nice indicator in case everything else is not functioning.

The protocol I used for this is very simple.  There's a command character sent through serial, then the data for that command.  If the firmware is expecting a command character but gets something it doesn't understand, it just keeps checking the serial input for a command it knows.  The protocol is as follows:

p<index of LED><red value><green value><blue value>

Five bytes.  It sets the specified LED (0..42 in this case) with the specified RGB value (0..255 each).  Note that this is not an ascii string, it is data.  So no matter what, it is 5 bytes to change a single pixel.

f<red value><green value><blue value>

Force all of the lights to the specified color.  This is handy for clearing everything to black, or flashing/fading effects.

Here's the Arduino firmware used to handle all of this:  (Note: it requires that the strand's library be installed.)

/*
 * Firmware for D15-based LED strand controller. (Arduino.ino)
 * Scott Lawrence yorgle@gmail.com January 2013
 */
#include "SPI.h"
#include "WS2801.h"
/*****************************************************************************
based on the example sketch for driving WS2801 pixels
*****************************************************************************/
int dataPin = 12;
int clockPin = 11;
int indicatorPin = 8; // LED indicator on the D15 node

// Set the first variable to the NUMBER of pixels. 25 = 25 pixels in a row
WS2801 strip = WS2801(42, dataPin, clockPin);

void setup()

  // set up the indicator for output 
  pinMode( indicatorPin, OUTPUT );
  digitalWrite( indicatorPin, LOW );

  // set up the strip
  strip.begin();

  // Update LED contents, to start they are all 'off'
  strip.show();
  // ready light
  allColored( Color( 0, 0, 0 ));
  setLED( 0, Color( 0, 255, 0 ));

  // start Serial IO
  Serial.begin( 9600 );
}

// Create a 24 bit color value from R,G,B
uint32_t Color(byte r, byte g, byte b)
{
  uint32_t c;
  c = r;
  c <<= 8;
  c |= g;
  c <<= 8;
  c |= b;
  return c;
}

void setLED( int idx, uint32_t c ){
  strip.setPixelColor( idx, c );
  strip.show();
}

int getSerial()
{
  while( !Serial.available() );
  return Serial.read();
}

void allColored( uint32_t c )
{
  int i;
  for (i=0; i < strip.numPixels(); i++) {
    strip.setPixelColor(i, c); 
  }
  strip.show();
}

void loop()
{
  int cmd; int ii, rr,gg,bb;

  // blink the indicator LED
  digitalWrite( indicatorPin, millis() & 0x80 );

  if( Serial.available() ) {
    cmd = Serial.read();

    // current commands:
    // p<index><red><green><blue>
    //     set a single pixel a color
    // f<red><green><blue>
    //     flood fill with this color

    if( cmd == 'p' ) {
      ii = getSerial();
      rr = getSerial();
      gg = getSerial();
      bb = getSerial();
      setLED( ii, Color(rr, gg, bb) );
    }

    if( cmd == 'f' ) {
      rr = getSerial();
      gg = getSerial();
      bb = getSerial();
      allColored( Color(rr, gg, bb) ); 
    }
  }
}

For now, that's it.  I made a simple interface on the desktop side in Processing, adapted from my previous controllable pixel software, to let me click and change the color of an LED. I also added some key commands to do simple effects with the lights. (all red/green/blue. flash, etc)


/*

 * Pixel Strand Driver (Processing.pde)
 * Scott Lawrence yorgle@gmail.com January 2013
 */
import processing.serial.*;

Serial myPort; // comms to the micro
PImage colorsPic; // color wheel image
color lastColor = color( 255 ); // last clicked color
PFont fnt; // font for display

void setup()
  // setup window
  size(450, 370 );
  // setup serial
  println( Serial.list()[0] );
  println( Serial.list()[1] );
  println( Serial.list()[2] );
  println( Serial.list()[3] );
  println( Serial.list()[4] );
  myPort = new Serial( this, Serial.list()[4], 9600 );

  // setup the pic
  colorsPic = loadImage("color_sphere.png");
  image(colorsPic, 0, 0);
  loadPixels();

  // setup the font
  fnt = loadFont( "Glass_TTY_VT220-20.vlw" );
  textFont( fnt );
  noSmooth();
}

// for main color display
color frameColor;
int selector = 0;
// for effects
float r,g,b;
int flash;

void draw()
{
  // fill with the last color
  background( lastColor );

  // draw the image over it
  image( colorsPic, 0, 0 );

  // draw the "selector" number (0..9)
  fill( lastColor );
  String s = "" + selector;
  text( s, 5, 20 );

  // if we're doing the "flash" animation, handle that now
  if( flash != 0 ) {
    if( flash == 1 ) {
      flash = 2;
      fillPixels( 1.0, 1.0, 1.0 );
    } else {
      flash = 1;
      fillPixels( 0.0, 0.0, 0.0 );
    }
  }
}

void keyPressed()
{
  // key 0-9 picks from the first 10 LEDs to change
  if( key >= '0' && key <='9' ) {
    selector = key - '0';
  }

  // key "a" means that the color picked will affect ALL LEDs 
  if( key == 'a' ) { selector = -1; }

  // key "F" will toggle flashing all of the LEDs
  if( key == 'f' ) {
    flash = (flash == 0)?1:0;
  }

  // keys r,g,b will toggle the mask to full intensity 
  if( key == 'r' ) r=(r==1.0)?0.0:1.0; sendRGBMask(); }
  if( key == 'g' ) g=(g==1.0)?0.0:1.0; sendRGBMask(); }
  if( key == 'b' ) { b=(b==1.0)?0.0:1.0; sendRGBMask(); }
}

// for the "full intensity" flags, send that down

void sendRGBMask()
{
  fillPixels( r, g, b );
}

// send down a "fill all pixels" command with the specified color
void fillPixels( float r, float g, float b )
{
  int rr = int( r * 254.0 );
  int gg = int( g * 254.0 );
  int bb = int( b * 254.0 );

  myPort.write( "f" );
  myPort.write( char(rr) );
  myPort.write( char(gg) );
  myPort.write( char(bb) );
}

// send down a "set this pixel" command with the specified color
void setPixel( int index, float r, float g, float b )
{
  int rr = int( r * 254.0 );
  int gg = int( g * 254.0 );
  int bb = int( b * 254.0 );

  myPort.write( "p" );
  myPort.write( char(index) );
  myPort.write( char(rr) );
  myPort.write( char(gg) );
  myPort.write( char(bb) );
}

// on mouse press, set the color under the cursor, and send it down

void mousePressed()
{
  lastColor = get( mouseX, mouseY );
  if( selector >= 0 ) {
    setPixel( selector, red(lastColor)/255.0,
                        green(lastColor)/255.0,
                        blue(lastColor)/255.0 );
  } else {
    fillPixels( red(lastColor)/255.0,
                green(lastColor)/255.0,
                blue(lastColor)/255.0 );
  }
}

// handle dragging the mouse as well
void mouseDragged(){
  mousePressed();
}



Eventually, I will write better desktop software which will use the LEDs for indication of events, as well as f.lux style color effects throughout the day, audio/visual synchronization to media being played, and other effects as well as time goes on

NOTE: All of the source/projects for this are available on github.

Tron Arcade Monitor Repair


I won't lie to you.  Having an arcade machine is a lot of fun.  I used to have about 6 of them, but I'm down to two, due to space restrictions and general sanity.  The two that I still have are a TRON Mini/Cabaret, and a generic full-size cabinet into which I can put one of a few game motherboards that I have. (Dig Dug, Mortal Kombat, Klax, Rampart, and a few others.)  But one of the less glamorous sides of collecting machines is troubleshooting and repairing these 30 year old beasts.

I bought the Tron Mini in the late 90s as an empty cabinet.  I was having a difficult time back then finding an affordable Tron board/control set to install, so I instead put Satan's Hollow into it.

Tron Cabaret cabinet with Satan's Hollow - Note the red joystick and white "shield" button instead of the standard blue stick and spinner from Tron.

Over time, I found all of the parts needed including a few tricks to restore this.  When I put the Satan's Hollow boardset in, I rewired/hacked/brutalized the wiring in the cabinet to accommodate SH.  Although SH used the same boardset, the controls were wired differently.  Once I got the Tron board, and realized how rare this machine really is, I re-wired it using a wire harness from a junked Tron machine.  I also found the correct power supply to install, repaired by a fellow collector.  The controls were also out of another junked machine.  Over time, I got the machine as restored as I could get it. 

Tron uses a boardset, three boards connected together, from Bally/Midway called "MCR-2".  It consists of a CPU/Program board, a Video/Graphics board, and a Sound/IO board.  Midway used this boardset for a few games, including Tron, Satan's Hollow, Two Tigers, and a couple other ones.  If you have a ROM programmer (which I do), you can buy one of the cheaper boardsets to use as a replacement for one of the more desirable machines.  Tron boardsets, when I was last looking, sold for about $75-$150.  Two Tigers sold for about $40.  The boardset I have Tron running on right now is a Two Tigers boardset.

When restoring a game, there's a line to walk with respect to what parts to put into it.  This machine has some vinyl veneer on the sides, which are somewhat damaged.  It also has a fair bit of wear on the front edge of the control panel.  I could have tracked down a replacement/reproduction for these parts, but I'd rather keep it factory original.  It's not like the damage is too severe for either issue.  I'm actually very happy with the overall condition....  except for the monitor.

The cabaret/mini cabinet uses a 13" monitor, compared with the full-size's 19" monitor.  The monitor on this one showed a wavy haze, distorting the image a little, and mucking with the brightness across the screen, which you can kinda see here:



I was given a solution about 11 years ago, involving modifying one of the boards in the monitor (the "neck board", which connects directly to the back of the picture tube) but never did it, and lost the parts a few years ago.  I instead bought a "cap kit" from Amusements Plus around 3 years ago, and decided to install it.  The last time I did one of these was in 2001, so it's been some time.  

Love that desoldering iron!  The pump just clears out all of the solder super fast!

All of the caps in the cap kit have been replaced.  Shiny new caps on the board.  Old, dusty, puffy caps in the plastic bag.  I'm not entirely sure why I kept them...

Thanks to the awesome desoldering tool at Interlock, I was able to do this in about 45 minutes, rather than the 3 hours it took me years ago.

The board is mounted into the monitor framework, and reconnected to the picture tube.


Just about all of these knobs needed to be tweaked to get the picture looking its best!

After some calibration of adjusting all of the controls (focus and drive on the flyback transformer, and R/G/B Drive and Cutoffs on the neck board), the picture looked better than it has ever looked before! Which you can't really tell from these pictures, but trust me, the picture is sharp, colors bright, and the imagery is stable. It's like it's a new monitor!

The boardset I had in it at first was the Satan's Hollow with my ROM hack so that it will work as a drop-in for TRON arcade cabinets with no rewiring at all.


Yeah, a horrible high score, but just let me practice and remember my old strategies!

The above pictures were taken before I realized how much dust had accumulated on the picture tube and shroud.  I've since removed the artwork glass as well as the tinted plexi below that, and cleaned off those items as well as the picture tube itself.  That eliminated all of the haze, and improved the picture as well!

Hopefully, I'll get 30 more years of life out of if!

Soon, I need to mount a bunch of UV LEDs in the cabinet to illuminate all of the art work.  That's one of the features of the full-size cabinet that I really miss.

Sunday, January 6, 2013

Jasper's Play Table


For Xmas, Jasper got a Plan Toys "Eco Town" (along with their parking garage and cars and such.)  We had it on the floor for him, but he was constantly walking over it, causing the play mat to fold up on itself, the town to fall apart, and so on.  We wanted to get a table for him to play with it on instead of it being on the floor.  Looking around, we found that the Plan Toys table was about $150 and didn't really have enough room for the parking garage, and such.  I knew I could make one less expensive, although not as "pretty".

The design is based on just simple 2x4 construction, held together with drywall screws (aka the duct tape of screws.)  I wanted to make it larger than the Eco Town, which was roughly 4' by 2'6".  I measured what the town + parking garage would take up, which was approximately 3' by 5'.   I was in a toy store recently and vaguely measured the height of a toy train table at the bottom of my knee, which is about 18" up from the floor.

Here's the basic sketch I made late on Friday night.  It shows a basic 2x4 frame that is 3' deep by 5' wide, with four 18" tall legs.  I decided not to put in any additional cross bracing as it is so short that they wouldn't really do much.  If i were wrong, i could always add them later.  Also, the way this is constructed, I can easily replace the legs with longer ones later, making it a standard table/work surface height.  One of the things that we wanted was to have a lip around the outer edge, so that cars wouldn't roll off to the floor.

I bought all of the wood the next morning, and even had them cut it in the store, so that I would only have to drill and screw it all together later that day.  Here's the full parts list:

- two 2x4, cut to pieces:  5', 2'9" (2'9" + two thicknesses of 2x4s = 3'), leftover
- one 2x4, cut to pieces: 18", 18", 18", 18", 18", leftover (one extra leg, because why not.)
- one 1x3, cut to pieces: 3', 3', leftover (for the lip)
- two 1x3, cut to pieces: 5' 1 1/2", leftover (for the lip, with added width for the side lip)
- one piece of 1/2" 4x8 plywood, cut to 5' by 3'
- One box of 2 1/2" drywall screws for connecting 2x4s into 2x4s
- One box of 1 5/8" drywall screws for connecting 1x3s into 2x4s
- finish nails (i had some leftover from before)

Total cost of materials was $54.  Quite a bit less than they sell the single-purpose table I could buy.

Construction was straightforward.

First, I attached the 5' 2x4s to the 2'9" 2x4s, using the plywood top to help line them up, since I'm an idiot and don't own a framing square.  Each one was connected at the corners using two 2 1/2" drywall screws, with the wood pre-drilled with a countersink so that none of the wood splits.

Once the top frame was completed, I put the plywood on top of it and starting in one corner, countersink-drilled holes and used the 1 5/8" screws to hold it on.  Once I finished one corner, I lined up the frame with the top for the next corner, and worked my way around it to get the frame to line up, square, with the plywood.

Next, with the table upside-down ("top" of the table on the floor), I drilled and screwed in the 18" long 2x4s in each corner, to act as legs.  I kept the top of the 2x4 against the plywood, and attached two screws into the 5' long front rail, and one screw through the 2' 9" long side rail.  This serves to hold the leg without it wobbling, and to additionally hold the frame together.  In the future, It's 3 screws to remove the legs, to replace them with longer legs.

Next, I added the 1x3 side rail lip.  I started by lining up the 3' sides. I used a piece of scrap 1x3 to get the proper height. It sticks up 3/4" above the table top.  After I got the 3' side on, I moved to the 5' 1 1/2" length and got that attached, lining it up with the first side... all the way around.  Once I nailed this on, It was basically complete!  A few more nails in the future, or perhaps using screws to hold on the lip might be necessary.

Just a detail showing the corner construction.

Jasper seems to like it a lot, and I think it will last for many years to come.  I may need to build a rolly-box to slide underneath it to store toys, but that's a project for another day.

Saturday, January 5, 2013

Howto: Setup a Sylvania SYNET07 Netbook with Linux


I recently picked up the Sylvania SYNET07 ARM-based 7" netbook from DailySteals for $40.  This is the same netbook that CVS as well as other convenience stores sell for $70-$100.  It came with Windows CE, although it is available with Android as well.  I figured that for $40, I could throw Linux on it, and use it as a portable, pocket sized hack laptop. Some people seemed to have some success getting Linux on it.  I can't afford a MacBook Air right now, so this will have to do for uberportable hackbox.  I ordered the red one, because why not.

I first decided to try out the latest Windows CE and Android on it before sticking with Linux. Windows CE booted super fast, but it was mostly unusable.  IE was sluggish, YouTube app didn't work at all. Android took longer to boot, and seemed to work ok, but the marketplace was empty for it, so no additional apps could be added, which made it kinda useless.

Next, it was Linux time!  Most of this follows this procedure, but with some additional changes.

Card Setup

The first thing to be done was to prep the SD card.  I had spun up a Linux box recently, so I'll be using that to prep the SD card.  I plugged it in and noticed from dmesg that it showed up as /dev/sdb.  I used "fdisk" to create two partitions on the card.  First is a 250 meg FAT-16 partition, then a 7.5 gig (? whatever filled the rest of the card) Linux/EXT3 partition.  I then formatted the partitions:

    sudo mkfs.msdos -F 16 -n FAT250 /dev/sdb1
    sudo mkfs -t ext3 /dev/sdb2

Then mounted them in /mnt:

    cd /mnt
    sudo mkdir fat
    sudo mkdir linux
    sudo mount /dev/sdb1 fat
    sudo mount /dev/sdb2/ linux

I had downloaded the two files provided at the above link, which I've mirrored here:  [fatpart.tgz] [extpart.tgz]  I then extracted these to the newly formatted SD card:

    cd /mnt/fat
    sudo tar -zxvf ~/fatpart.tgz
    cd /mnt/linux
    sudo tar -zxvf ~/extpart.tgz

The card is now bootable in the Sylvania netbook.  I like to make a few tweaks from here though; namely changing the hostname, and prepping the pacakge system to actually work as expected.

   cd /mnt/linux/etc/apt
   sudo vi sources.list  -- change "ftp.au.debian.org" to "ftp.debian.org"

   sudo echo "newHostName" > /mnt/linux/etc/hostname


   sudo mkdir /mnt/linux/var/log/apt/


Now, we'll disconnect the SD card:

    cd /mnt
    sudo umount fat
    sudo umount linux

First Boot, Package Installation

Next, put the SD card into the netbook, and press the power button to turn it on.  It will boot to a linux prompt.  Log in as root, no password.  Plug the netbook into a network connection, then type "dhclient" to get an ip address.

I like to change the password, just to keep casual people out.  I use something simple like "hunter2" ;)

The first thing we need to do is to update the old package database on the thing.

    apt-get update
    apt-get upgrade

Now, it's time to install some packages.  Here's the commands to install the developer packages I like:

    apt-get install gcc g++ gobjc make bison flex
    apt-get install ncurses-dev screen ssh
    apt-get install git-arch subversion-tools

Next, it's time for some X11 goodness

    apt-get install xinit xorg xorg-dev twm wm2 x11-utils

Audio, apps. console config stuff.  These may prompt for console configuration.  I use "UTF-8" and then "Latin 1"

    apt-get install mpg123 libmpg123-dev mp3blaster
    apt-get install console-setup console-tools nethack-console
    apt-get install irssi markdown arduino arduino-core

Past this, I like to install the window manager "wmx", building it from source

    mkdir ~/src
    cd ~/src
    wget http://www.all-day-breakfast.com/wmx/wmx-7.tar.gz
    tar -zxvf wmx-7.tar.gz
    cd wmx-7
    ./configure
    make
    make install

You should be able to start up X11 - "startx" and it should bring you into twm.  You can edit ~/.xsession to something like:

    twm &
    xsetroot -solid midnightblue
    xterm -fg red -bg orange -name "EXIT TO LEAVE X" -iconic

Shown running X11 with the "amiwm" window manager.

Crash prevention (Date and Time config)

There's something about the way it accesses the hwclock (hardware clock) on shutdown that crashes the machine.  We'll flat-out disable it here so that we get clean shutdowns.  This isn't elegant, but it works.

    vi /etc/init.d/hwclock*

and replace their contents with:

    #!/bin/sh
    echo "hwclock: disabled."

Now, let's do the same to the command at /sbin/hwclock

    mv /sbin/hwclock /sbin/hwclock.original
    cp /etc/init.d/hwclock.sh /sbin/hwclock
    chmod 755 /sbin/hwclock

This may mean however that we will need to enter the date each time we login, like so:

    date MMDDhhmmYYYY

eg, for January 4th, 2013 at 1:36 pm:

    date 010413362013

Now, we should get the timezone stuff setup properly. Add this stuff to your .profile or .bashrc:

    TZ='America/New_York' ; export TZ

Some commands may expect these, which you can probably ignore:

    export LC_CTYPE=en_US.UTF-8
    export LC_ALL=en_US.UTF-8

And now install locales and ntpdate

    apt-get install ntpdate

Do not install 'ntp' or locales ('locales-all'), as they may scrog the hwclock and dhcp client/ethernet hardware again.  (...Well, not particularly the dhcp stuff, but it makes the system forget that eth0 is broadcast capable somehow.  There's a fix for that by specifying eth0 on the 'dhclient' call, as seen in the following.)

I added the following to my .profile to make network starting easier:
    neton() {
        echo "dhclient..."
        dhclient eth0
        ifconfig
        echo "ntpdate..."
        ntpdate time.apple.com
        date
    }

If time gets out of sync, as well as after you login, you can just use:

    ntp() {
        ntpdate time.apple.com
        date
    }

To get your machine in sync with real time, if you have net access.  If you don't have net access, use the date command above.

Additional Stuff - Backlight Control

Add this in to your .profile to get a handy routine to change the system's screen backlight.  The values range from 0 through 255.  It seems that anything less than 90 is essentially off.  above 192, the intensity increase is minimal.  The default is 128.  I run it at 98 in very dark rooms.

    backlight() {
        echo $* > /sys/devices/platform/lcd-backlight.0/leds/lcd-backlight/brightness
    }

    backlight-lo() {

        backlight 95
    }
    backlight-hi() {
        backlight 192
    }

So now, you can just type "backlight-lo" or "backlight-hi" in any shell, and it'll adjust your screen's backlight.

Additional Stuff - Backups!

While you could do rsync from the laptop to another host, I've found that the easiest way to back up the system is to shut it down cleanly, pop the SD card, shove it into another machine and just tar the entire EXT3 partition to a file to be kept for safe keeping.  I only use about a gig of space on the card, so this takes up very little space on a desktop machine.  I also keep a directory of stuff that doesn't get backed up, "/NOBACKUP".

Plug the card into a host, I use an ubuntu machine.  CD to the root of the mounted SD card, and tar it to a file in your home directory (or wherever, adapt the line for your own use)

    cd /media/99bf3e8c
    sudo tar -cvf /home/myHome/laptopBackup_2013-01-04.tar .

Backups go fairly quick, restores take more time.

    cd /media/99bf3e8c
    sudo tar -xvf /home/myHome/laptopBackup_2013-01-04.tar

To restore, simply follow the first step above, where you just untar your new backup, rather than "extpart.tgz".  My backups are around 990 meg with all of the above installed.  gzip of that cuts it about in half to 450 meg, which is great for archival.

Additional Stuff - Package notes

I've found that some packages seem to totally scrog the NIC for no reason.  For example, as mentioned above, "ntp" causes bad things to happen, as well as "xscreensaver".  I'm not entirely sure why this is, they don't seem to touch anything that should touch the network, but apparently they do.  Backup often.  Get used to restoring. ;)