My Single Serving Site Prints A Simple Mailing Label

July 19th, 2009

While reading the new WIRED magazine, a little snippet “How Do I Make a Single-Serving Site?” (WIRED 17.08 page 26) inspired me to put a script I was using locally up in the ether. I use a simple HTML file to make mailing labels for boxes I have shipped. It’s cleaner than my hand writing and makes a simple, clean mailing label. This would make a great single-serving site! So I got a domain, http://www.simplemailinglabel.com/, tweaked and uploaded my little simple mailing label script, and posted it on http://wiredsingleservingsitegenerator.com/. Sweet! Now I wait and see how many green-up-arrows I get…

First Week Using My Standing Desk

July 10th, 2009

Monday I put together the IKEA FREDRIK Computer Workstation in my office and set it up as a standing desk. The workstation was not designed to be used as a standing desk, so any little vibration from typing or fidgeting moves the monitors. To solve this I plan on anchoring it to the wall. After a full week of use, I can tell you it does take a bit to get used to. I still use my trusty BreakTimer application, but instead of getting up and walking when the timer goes off, I sit down for a bit. I have noticed my back is hurting less, but my legs get fatigued and my feet kinda ache. Specifically my quads and hip-flexers. I can already tell that I need a fatigue pad (should be here next week).

Even though I am getting some relief from my shooting back pain, that goes down my left leg, standing all day is not exactly relaxing. I used to enjoy reclining in my chair after lunch and perusing the interwebs. Getting my daily does of technology news. But reading the news while standing doesn’t quite have the same effect. On the other hand I do not notice a decline in work quality. If anything the quality of work has increased. I guess standing and being physically engaged makes me focus more; though I am still only able to work in spurts of 30 minutes to a max of 1 hour straight before I have to take a break. Only this time, instead of having to get up and stretch my legs because of the pain in all the diodes on my left side, I need to sit a minute to rest the legs and feet. Hopefully the cheap Office Depot fatigue pad coming next week will ease the foot aches, which is the main reason I have to take a break from standing.

I still fidget and shift my position, constantly. Alter my wait from side to side. Widen my stance. Put a foot up on the bottom shelf of the desk. The same amount of fidgeting I did while seated. I guess I just can’t sit still.

The other option, the $1400 tangram desk with a slightly smaller work area and no higher shelf for monitors, was a lot more stable and it goes up and down with a push of a button. It even has height presets for single touch action to go to sitting height or standing. But 10 times as much money. Even with all those features, I don’t know if it’s 10 times as better. Maybe there is a way to make one and sell it for less…

So after the first week, I would gladly exchange dealing with fatigued legs than the pain going down my leg. We shall see how it is after next week.

photo of my standing desk at work

photo of my standing desk at work

Simple Linux Bash WordPress Upgrade Script

July 10th, 2009

There are lots of automatic WordPress upgrade plugins, but do to some server restrictions I couldn’t get them to work correctly. So I made a simple bash file to upgrade this WordPress site for me. The script only backs up the current web site directory, and does not do any DB backups. I used this script to upgrade from 2.7.1 to 2.8 and just today from 2.8 to 2.8.1 and the blog is still up, so I guess it works OK!

Variable definitions:

  • WORDPRESS_DOWNLOAD_URL – the URL of the latest WordPress version to download
  • WORDPRESS_LATEST – the file name of the downloaded WordPress version
  • WORDPRESS_EXTRACT – the directory the WordPress files are extracted when the download file is uncompressed
  • WORDPRESS_DIR – the web root directory where the WordPress files will be copied to, and where your wp-config and wp-content files will be copied to (your blogs web root)

To use, create a new file, say wordpress_upgrade.txt, copy and paste the code below, and make wordpress_upgrade.txt executable (chmod 755 wordpress_upgrade.txt). Run via ./wordpress_upgrade.txt and when its done, sign into your blog to run any DB upgrades. I run this script from my home directory, and “public_html” is where my WordPress files reside. This script can be run from any location, as long as the paths are setup correctly and accessible.

Note: this script does not perform a database backup!

#!/bin/bash
# Upgrading WordPress steps
# From home directory

WORDPRESS_DOWNLOAD_URL="http://wordpress.org/latest.tar.gz"
WORDPRESS_LATEST="latest.tar.gz"
WORDPRESS_EXTRACT="wordpress"
WORDPRESS_DIR="public_html"

echo "Removing current latest.tar.gz"
rm latest.tar.gz

echo "Backing up current WordPress"
tar -cf wordpress-backup.tar $WORDPRESS_DIR
#get wp-config.php and wp-content/ out of wordrpess directory
echo "Grabbing wp-config.php and wp-content/ and putting them in ~/mywordpressfi
les."
cp $WORDPRESS_DIR/wp-config.php mywordpressfiles
cp -r $WORDPRESS_DIR/wp-content/ mywordpressfiles
echo "Downloading latest WordPress form $WORDPRESS_DOWNLOAD_URL"
wget $WORDPRESS_DOWNLOAD_URL
echo "Extracting $WORDPRESS_LATEST..."
tar -zxf $WORDPRESS_LATEST
echo "Copying $WORDPRESS_EXTRACT to $WORDPRESS_DIR."
cp -r $WORDPRESS_EXTRACT/* $WORDPRESS_DIR
echo "Copying wp-config.php and wp-content/ files back to $WORDPRESS_DIR."
cp mywordpressfiles/wp-config.php $WORDPRESS_DIR
cp -r $WORDPRESS_EXTRACT/wp-content/* $WORDPRESS_DIR/wp-content
echo "Should be done, now go to WordPress Admin to upgrade!"

My Stand Up Desk Adventure

June 23rd, 2009

I am an active guy. One of those NCAA athletes that went pro in something other than sports. But after years and years of volleyball, my body has taken a beating. My back and knees in particular. So naturally, after I graduated and started working, sitting in front of a computer all day, my workout regime decreased dramatically in intensity. After about six months, I noticed an increase in lower back pain. I am not unfamiliar with lower back pain, but the pain was more intense than during college. I would rest, stretch, ice, rehab, and it would heal. Than it would happen again. Always after a hard workout or cleaning all day. But it would always go away after about a week.

After I moved out to Southern California, I started playing in some adult volleyball leagues. Three times a week. Warming up, optional. And thus I got lazy, my technique waned, and became prone to injury. The mix of playing without warming up or stretching and then sitting down for several hours the next day caused my muscles to tighten up. One day I woke up crooked. Leaning to the right. And like an idiot, I did not stop playing volleyball. I just figured it would heal like normal and I could push through it. But this time it just got worse. Rehab didn’t help anymore. I started to suspect a herniated disc. I went to a chiropractor, who suspected the same. Yep, the MRI confirmed it. L2 and L3 herniated disc with all the other lumbar discs also protruding. No surgery required to heal, thankfully. Just rest, rehab, NO VOLLEYBALL.

This really got me thinking about the ergonomics of my workspace. USC has a whole department devoted to it. I called them up for an ergonomic evaluation of my work area. Result: desk is too low, chair too small, not enough leg room, monitors too close, poor lighting, etc. Anyone over six feet and 200 pounds can relate to everything being too small. The ergonomics guy told me he uses a stand up desk and loves it. Sweet! That’s the only position that is pain free for me! Oh, they are over a grand? Grrr!

Searching the interwebs for stand up desks revealed not much under a thousand dollars. There were super sweet ones that go up and down with a push of a button, some with air compressors, or cranks. But I would be satisfied with just a desk that was 49 inches high. I’ll commit to standing all day. I did find lots of helpful DIY standing desks from Lifehacker which gave me some confidence in creating my own. Which is find for at home, but for work: you gotta go through all the proper channels, penetrate the bureaucracy, and wait.

I think I found a solution though. A single purchase, inexpensive desk that can be used as a standing desk or one of those old fashion sit-in-a-chair desks. It’s from IKEA: FREDRIK Computer Work station. Metal frame with notches every two or three inches to move the surfaces up and down. There is also a smaller one, 38 inches vs. 50 inches wide ( I just bought the smaller on for a standing workbench at home). I will post back with the result of if my work will spring for the new desk to replace my current setup as well as how my home setup works out. I also plan on making some wood boxes to put under my current desk (which is only 31 inches high, so the box needs to be 49 – 31 = 18 inches). I’ll use the new workbench to make those!

My Homebuilt HeNe Laser Lamp

June 20th, 2009

When I was in middle school, I read all about Light Amplification by Stimulated Emissions of Radiation (lasers). I saved up almost $100 for a crappy laser pointer (now they are practically giveaways). One book, the Laser Cookbook, was all about projects you could do with lasers. One, which every middle-schooler would love, is making a laser gun (a harmless one, but cool nonetheless). But it required a Helium Neon laser tube, and some fancy circuitry for a power supply and a big-ole hip holstered battery pack. But after spending all my lawn mowing money on that crappy laser pointer I couldn’t afford to build the laser gun. Thus the interest slowly faded away…

Many years later, I found a Desktop Helium Neon Laser Lamp Build tutorial on Hack N Mod, and BAM! I got so excited! I new where to get most of the parts, but not the laser. After searching the webs, I found Meredith Instruments which had good information and the parts I needed. But the everything there new, and more money than I wanted to spend. Searching the internets some more, I kept seeings “Sam’s Laser FAQ.” So I read that to learn how to actually put a laser and power supply together. Then I found his HeNe Laser Kit 2 and saw the price! It was just what I needed, and it had those brackets I could not find anywhere.

So I bought one of those kits, went to Hastings Plastics Co. and got my acrylic mirror sheets cut so I could mount the laser. I also got acyclic solvent from them to glue the pieces together. I lined up the laser on the acrylic and drilled some holes to mount the brackets. Glued the pieces together. Soldered the switch to the power supply. Connected the project box base to the mirrored stand. Done.

I made a complete parts list of all the parts I used and where I got them. I pretty much copied the Hank N Mod tutorial. Though my wall power adapter came already connected to the power supply. Finally, here is the pic of my HeNe Laser Lamp:

HeNe Laser Lamp

Now where the heck do I put it?

AIR/Flex URLRequest: Sending Authentication Headers

June 17th, 2009

If the request requires authentication and URLRequest.authenticate is set to true (the default) the operating systems login window will popup asking for credentials. These will be automatically sent in the request. To manually set the username and password there are a few ways:

URL Request Defaults:

URLRequestDefaults.setLoginCredentialsForHost("www.domain.com",username,password);

Headers:

var encAuth:Base64Encoder = new Base64Encoder();
encAuth.encode(username+":"+password);
var header:URLRequestHeader = new URLRequestHeader("Authorization","Basic "+ encAuth.toString() );
var request:URLRequest = new URLRequest(url);
request.requestHeaders.push(header);

Under both ways, once a successful login occurs the credentials are remembered while the application is open and the user is not asked for username and password again.

Tamiya Bull Dozer Kit

June 9th, 2009

So a friend sent me a link to a NY Time article about working with your hands and how sweet it is. And I totally agree.  Growing up I used to build model cars, planes, robots, X-Wings, TIE fighter’s, etc.  Lego’s too.  We had nice garage full of tools, and I would play back there.  During college I managed to rewire a 1966 Ford Mustang.  Got it running.  That was so awesome.

After I got my engineering degree, I got a job and sit in front of a computer and program all day.  Its almost, but not quite, entirely unlike working with your hands.  You type out code with your hands to create a virtual machine.  I miss making real machines.  Though, after I make the models or robot kits, I never did anything with it.  Usually just threw it away, because the process of putting real physical objects together to form another physical object was the most fun.  So over the weekend I went to Fry’s and got a Tamiya Bull Dozer kit.  Its a very easy, basic kit.  There is a wired remote control that sends power to three little motors. Moves the arm up and down and the tracks forward or backward.  Here’s a little video of it in action for my Pop.

Get the Flash Player to see this content.

Mac OS X Leopard and Windows XP File Sharing

June 6th, 2009

I have a Windows XP Media Center 2005 computer, a MacBook Pro and a few other Windows and Mac computers stroll through my network from time to time. I have my Media Center PC streaming media to the XBOX 360, file server, printer etc. I had the Media Center machine before the MacBook Pro. So when I got my MacBook Pro, and hooked it into my network I was suprised that all my file shares were automatically picked up and I could read my movies and print, all as a Guest. Which is exactly how I wanted it. Login to change, but anyone can view a movie, listen to music, and print.

Then the Media Center PC mother board failed! So I got a new AMD Athlon 64 LE (45w cool-and-quiet, and yeah, it runs very cool and very quiet) and reinstalled. I setup my shares again, but this time I turned OFF simple file sharing.

I go to my MBP and connect to the MC PC. I try as guest. But I got this message:

“The file server does not allow Guest access.”

Huh? So I enable the guest account, which I do not remember having to enable before. Reboot. Try to connect again. Same error message: “The file server does not allow Guest access.” WTF?! And the other Windows machine (Windows Vista) could not print without loging in. Gah!

So I googled around, played with my Mac samba settings. Deleted my networking settings on my Mac. Tripple checked my shared settings on my PC. So I went back to the basics. Reading one Microsoft KB how to setup Windows XP file sharing. There it was, simple file sharing. A light bulb came on. So I re-enabled simple file sharing (My Computer->Tools->Folder Options…->View->Advanced settings:->User simple file sharing (Recommended)).

And it all worked!  Reading my media shares, printing as guest! Even from the Vista machine! I know there is some security risks leaving it so open, but I keep my private data separate.

Yosemite – El Capitan Swinging Climber

May 24th, 2009

Just got back from Yosemite, and took some pictures of climbers headed up El Capitan. It has a 10 second intro, with a red circle showing how high the swinging climber is. After the intro is a zoomed sequence of 10 pictures showing the climber swinging across the face of the mountain trying to grab a ledge. The climber did make it after at least 1 hour of swinging. Click the link for the video.

El Cap Swinging Climber

Or if you prefer, the image sequence.