DIY Notes

This is an archive of miscellaneous projects and tech notes. I'm avoiding rehashing the stuff that's understood, and hope the information is concise and useful. Some articles are just reports of what works, or what has failed. There are older technotes from around 2000-2002. Most of the OSX articles are about version 10.1.

1-Pixel GIF File, in Base64, for Web Bugs

This little bit of code returns a 1-pixel gif file. You can add it to the bottom of any script that you want to call from an IMG tag.


<?php
header('Content-type: image/gif');
echo base64_decode('R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==');
?>

Advice on How to Avoid Late Fees on Your Credit Card and Save Money

Credit card late payment fees suck. They suck out $25 to $35 from your wallet every time you forget to mail in the payment. Here's how to avoid the fees. Also, if you're in debt, this will help you get out of debt and start saving!

Ask For Forgiveness

One time I hit one of these fees, and my payment got in one day later, I called up the CC company, and asked if they could remove the fee. That worked, and they removed it.

Pay When the Bill Comes In

After getting hit with a couple of these late payment fees, I started to pay the bill the day it came in. If I couldn't afford the full balance, I'd pay what I could. That way, I avoided the fees.

Pay the CC Bill Online

Eventually, I figured out the best solution. First, you need to set up your credit card account so it can get payments from your bank account. Then, you set up online access accounts for your bank and your credit card. Save the sites as bookmarks.

You also need to set up your work to pay you with Direct Deposit. (If you're a contractor, or get paid cash, you have to deposit your check immediately.)

Then, every two weeks, go look at your bank balance. The best time is shortly after your paycheck is deposited. At that time, go to your credit card's website, and pay off as much as you can.

Do this twice a month, at each paycheck. You'll never get a late fee again. Even better, your cash in the bank account will more accurately reflect how much money you really have, because you're drawing it down all the time. You won't overspend as much. Your credit rating will also improve, because paying bills before they are due raises your score!

Get Out of Debt, and Start Saving

I opened up an IRA account at the bank years ago, and, when I started to may the CC payments online, I also started to put money into the IRA. It was super-simple, because you can transfer from checking to the IRA.

I'd put in $150 to start. It wasn't "nothing" but it was a bearable amount. Within half a year, I had nearly $3,000 saved up, and getting to the $5,000 limit wasn't too hard.

Even if you're in debt, try to put away something into an IRA, just so you have the IRA account visible when you're taking care of your finances online. Transfer $20 into that account every once in a while, just to get the hang of it. It's fun!

A shorter, simpler version of this is at How to Avoid Credit Card Late Fees

AppleScript Notes

Some notes that JavaScript? or Java programmers might find useful when comprehending AppleScript?.

Many of the concepts below are covered in greater detail and depth by Bill Briggs on MacCentral?. http://maccentral.macworld.com/columns/briggs.shtml

Object References

Most languages use this syntax: parent.child.child.method(), with the root object on the left. AppleScript? flips this around, with syntax that looks like method() of child of child of parent. There is only a containment hierarchy; there's no class inheritance hierarchy. So, you don't need VisualBasic? style addressing.

User Defined Objects

The basic object in Applescript is the "script". Thus, this syntax will allow you to create an object definition:

script Name
-- code goes here
end script

This creates a "script object", which is similar to a Class in most languages. The difference is that there are no classes in AppleScript?. Rather, you take this script object an copy it into a reference, like this:

copy Name into foo

At this point, there's foo, a Name object, and Name itself, which is an object. This seems a little weird, but it's a valid style of object definition and creation. (Yes, you can modify Name and then copy it, but that's not good practice.)

Who gets what message

This isn't an issue in JavaScript?, because all messages are sent to first to the script, and then the interpreter. The methods that make up JavaScript? are packaged into classes like Math, String, and Array. Math.abs(), for example.

In AppleScript?, the language is extended via "AppleScript? Additions". Each extension defines new keywords, which may clash with each other. There's no real solution for this, except to undersand the order of passing an ambiguous message past different handlers. This is detailed well by Briggs.

Associative Arrays

These don't really exist in AppleScript?. There's a type called a record, which works a little bit like an array:

set props to { name : "john", size : "XL" }
size of props
-- "XL"

The only problem is that there is not command to convert from records to arrays, and there's no way to read or write records to disk. Also, you can't just define a new key-value pair in the record and append it to the list.

Automatically Naming a Page From the File Name

This bit of code will set the page's title based on the filename of the script. So, my_homepage.php will be titled "My Homepage". Laziness prevails, sort of.

<?php
	$title = $_SERVER['SCRIPT_NAME'];
	$title = ltrim($title,'/');
	$title = preg_replace('/\.php$/','',$title);
	if ( strpos($title,'_') === FALSE )  // if we don't have a _ in there, it's a single word
	{
		$title = ucfirst($title);
	}
	else
	{
		$title = explode('_',$title);
		$title = array_map(myucfirst,$title);
		$title = join( ' ', $title);
	}
	print "<title>$title</title>";

	function myucfirst($s) { return ucfirst($s); }
?>

Bash Shell Scripting Cheat Sheet

It's like a dos bat file, but with nifty little features, like actual looping constructs and the ability to mess with program output creatively. For a long time, a large fraction of the net's information infrastructure was programmed using shell scripts. The internet worm of 89 used them. Today, skript kiddies use "hack scripts" that are shell scripts that emit C code, compile it, perform the hack, and then clean up after themselves.

Here's a quick cheatsheet. Each line is a valid line in a program.

For more advanced notes Advanced Guide.
For info on doing math, see Bashguru.

 #! /bin/sh
 # THIS IS A COMMENT
 # the first line with /bin/sh is a comment, but it's also a unix script  
 #header that tells the program loader to pass the file to the specified 
 #program, in this case, /bin/sh
 ls ; ls ; # commands on a line are separated by semicolons
 X=10; # sets the environment variable X
 echo $X; # the $X is replaced with 10 before the command is  executed
 X=$HOME; # sets X to the home directory
 ls $HOME; # lists contents of home directory
 FIRSTCOMMANDLINEARGUMENT = $1
 SECONDCOMMANDLINEARGUMENT = $2
 THESHELLSCRIPTSNAMEIS = $0

 echo $VAR 
 echo ${VAR} ; # equivalent, but the latter is useful when you
 echo "FOO${VAR}FOO"; #do this kind of string catenation

 #zsh feature and caveat
 # in zsh, the lowercase variable names evaluate math, while uppercase ones do not
 X=2+3; # "2+3"
 x=2+3; # 5
 x="2+3"; # 5
 # In sh and bash, all the above evaluate to "2+3"
 # to evalutate math in sh, you use $(( expr ))
 x=$((2+3))

 test -e filename; # test is a special command that tests files, in this  case, for existence
 if (test -e $1) then
  echo $1 exists
 elif (test -d $1) then
  echo $1 is a directory
 fi
 # this tests for the existence of a file before proceeding.  The () 
 # evaluates its contents, and uses the return value.  0 means true,  
 # nonzero, false.  (test returns 0 on success)
 # There's a bug in that code.  This is the fixed code
 if (test -e $1 && test ! -d $1) then
  echo $1 exists but is not a directory
 elif (test -d $1) then
  echo $1 is a directory
 fi
 # the && is a shell programming convention that's like a logical AND.
 # It evals the left side, and if the return value is true (0), executes the right side.
 # The counterpart || acts like OR.
 # Sometimes, you see this, which acts like "if the left hand is true, do the right hand"
 test -e $1 && echo "it exists"
 # It's just shorthand.  Likewise, the following means "unless  everything works, do this"
 test -e $1 || echo "the file doesn't exist, aborting" && exit 1

#infinite loop
while true
do
  # commands
done

 for var in a b c d
 do
  rm $var
 done
 # That removes the files a b c and d

 for var in `ls`
 do
  echo "**" $var
 done
 # This lists all the files, prepended by "**"
 # The backticks (`) tell the shell to run the command ls, and then replace itself with the command's output.
 # All commands have three kinds of output - the return value, the output, and the error stream

 # About quotes.  Single quote (') means "don't do variable  substitution inside."  Double quotes (")
 # means don't treat spaces as argument separators, substitute variables, but don't expand filenames.
 # 'this is a string', "this is probably an expression", `this is definitely a command`

 # here's a skeletal mutli-mogrify (the mogrify syntax is wrong, but the overall thing should work)

 if (test ! -e $1) || exit 1
 name=`echo $1 | sed -e 's/[.]jpg$//' `
 for geom in 100 120 150 200 260
 do
   mogrify -format jpeg -outputfile ${name}.${geom}.jpg -geometry ${geom} $1
 done

 # Here's a simplistic "in/out" logger.

 CLOCKSTATE='/home/johnk/bin/clock.on'
 CLOCKLOG='/home/johnk/bin/clock.log'
 if ( test -e $CLOCKSTATE ) then 
	rm $CLOCKSTATE
	echo OUT `date` >> $CLOCKLOG
 else 
	touch $CLOCKSTATE
	echo IN  `date` >> $CLOCKLOG
 fi

 # Here's a way to check if a process is running, and if not, start it.
 @ The sed script looks for XWin, and if it finds it, returns a 'y'

 WINUP=`ps | sed -e 's/.*XWin.*/y/;T end; P;: end; d'`
 echo $WINUP
 if (test y != "${WINUP}") then
        startx &
 else
        echo "X is up"
 fi

 # Here's how to copy a file into multiple directories.
 for i in ../*/ ; do cp theFile $i; done

diff foo bar
RETURNVALUE=$?
if ( test $RETURNVALUE ne 0 ) 

Brother Print Head Carriage

These are just some random notes about symptoms and fixes with the Mfc7300 (and other inkjets in general). The printer is okay, but I can't recommend it because the ink carts are expensive. All inkjets are like that. So, I recommend getting a laser printer, which (in my experience) can last years and years.

Symptom in italics - solution in regular text.

The print is streaky - clean the print heads a couple times. You might want to set up a cart as a cleaning cart with windex in it, and replace each color individually, and clean.

Black (or color) does not print at all, or are streaky in very regular patterns - the electrical contacts connecting the print head to the printer may be off a bit. The connections are made on the left and right side of the print carriage. The contacts themselves are created by sandwiching two sheets of plastic printed circuits together, and clamping them against an array of metal points. All these things need to be clean and aligned just right.

To unclamp the sandwich, first, remove all the ink carts (go into ink replacement mode first, and then unplug the printer.) Then, remove the plastic tray that the carts fit into; there's a little tab on the front to release it. It lifts up and forward. Then, on either side of the carriage, there's a square plastic block that reads "R" or "L" in faint raised letters. Pull up and forward gently, and it'll unclip, and the sandwich will fall apart. Note that the holes in the plastic sheets are spindled onto the small steel pin, which aligns the whole deal. Make sure it all fits together, and replace the clip.

Reinstall the ink, and try again.

Head gets clean, and then gunks up again - it could be bits of dried ink sticking onto the head. Soak a paper towel in windex, and then clean out the head cleaning area. That's over to the right side of the carriage. There's some rubber suction thingies that get grimy with dried ink. Wipe them clean.

Burn a YouTube (or other website) Video to DVD on Windows

There are a bunch of different ways to do this, but this is the simplest in my experience.

Applications
Firefox
Download Helper extension for Firefox
ImgBurn
DVD Flick

Also optional: 2 second black bumper, attached to this post.

The workflow is this:
Go to the video's page, and use Download Helper's features to download the video. When you click on the down arrow, the menu item Download will show another menu with what versions of the file are available. Pick the highest qualitiy one, which will be "HD" or "720".

Fire up DVDFlick. Drag the downloaded video to the window. If you want a pause before the video starts, use the 2 second black video to create a little blank space.

Set DVDFlick to make an ISO and also burn the image. DVDFlick automatically uses ImgBurn if it's available.

If you need an extra copy, use the saved .MDS file to build another DVD. ImgBurn will automatically burn the same job again. (ImgBurn rocks.)

AttachmentSize
Black720.wmv395.96 KB

Cast Iron Pan Care and Seasoning

Lodge has a pretty good page about caring for their pans, but I respectfully disagree with them about almost everything.

1. Rust is not that detrimental to a pan, as long as it's not in the cooking surface. If it gets in there, just make sure to scrape down the rust and surrounding areas, and re-season it. If rust is on the outside, just wash it off and rub some grease into it -- or just rub some grease into it. Next time it heats up, it'll get seasoned.

2. Use animal fats to season the pan. It is smoother that way. They keep saying to use vegetable fats, but in my experience, animal fats work better. Fry up some bacon for the grease.

3. You can wash them with soap, and you can even put a little cold water in them when they're hot. The water will just boil. If you scrape off the nonstick surface, just re-season it.

4. Every once in a while, I get a buildup of gunk on there, and the regular gentle scraping with a turner won't smooth the surface. I go at it gently with a scouring pad or fine steel wool, to knock down the high spots. The seasoning is thick enough to handle it. Afterward, you have to get some grease in there and cook something to build the surface up again.

The surface is "non-stick" but you can't treat it like a teflon coated pan that doesn't require oil. You need to grease the pan before using it. If you're not into oils, at least wipe the surface with oil. This grease helps build up the surface.

The best greases are animal fats. Too bad for vegetarians. Animal fats seem to produce a smoother surface. A good way to apply fat is to use a strip of bacon, or a piece of animal skin with fat attached to it.

The best vegetable oil for frying is peanut oil. It takes the heat before smoking.

A really good, quick way to season a new pan is to use an outdoor grill. Wash the pan down with steel wool (to remove the casting grease) and coat it with fat, all over. Put it on the grill, and get it to start smoking. Then, toss some bacon into the pan and cook it up.

Don't start a fire!

Vegetarians might want to fry up some tortillas or something. Use some peanut oil.

Let the grease do it's magic, and turn brown, then black on the metal surface. Mop the grease around so it gets all over. If it looks "dry" add some more until it's shiny. Flip it over and do the bottom of the pan too. Coat everything. Let the heat build up and burn the surface until it smokes.

Then, coat it and burn it, over and over until you get a nice surface that's smooth enough to cook on.

By the way, I mean an outdoor charcoal grill, not one of those gas ones you see at the stores these days. Use the plain old cheap charcoal briquettes, not the fancy lump coal. You want even, high heat that will burn the surface.

Once it's seasoned, you should use the pan, a lot. After a few years, the real "non-stick" surface will develop. You can't really rush this process. It just takes a long time.

By the way, even with all this hassle, cast iron is a big timesaver. For one, you're not supposed to wash it, and that's a big timesaver. Another thing is that you don't go through a period of time when the pan is messed up, waiting to be replaced with another cheap pan. You'll just keep the same pan until you die, then pass it on to your kids.

Here's a site called Melinda Lee with better cast iron tips.

Comments about Firefox in a More Secure Setting, Posted to BetaNews

I posted this comment to a post on BetaNews saying that Firefox didn't really bring anything new to the table. I disagreed, because FF made it a lot easier to maintain a higher level of overall security for novice users.

----

My experience says otherwise. I've set it up a couple times. I'm not a major PC person, so, all the systems, on the first go-round, got infected by viruses, penetrated by trojans, and had spyware and adware installed. On the second attempt, I installed firewalls (Outpost Free), removed Outlook Express, and installed Firefox. I also visited the antivirus sites so the DLLs for their products could be installed, to ease virus checking.

My goal was to create a computing experience for novice users that "works". I wanted it to be responsive, and have no unexpected surprises (like adware). The first complaints I got were about adware; the systems had been compromized by trojans, and had some mail viruses as well, but the perception of problems centered on adware popups invading their computing experience.

Thus, my goal was to guard against invasion by trojans, worms, viruses, and all the other clandestine malware, but, ALSO, to guard against unexpected installations of adware and spyware.

Firefox, particularly the popup blocker, helps prevent adware and spyware installations. There are other blockers out there, but FF's is simple to teach to newbies.

Firefox is good because it's similar to IE, and generally works well.

Secondarily, I install the Adblock and set it to block ads on sites they visit, if they wanted. This helps speed up their browsing experience, and also tends to decrease the opportunities for adware installation.

The last thing I did was create two user accounts: Administrator and User. They were given good passwords, and the users were taught to log in as User to use the system, and to log in as Administrator to install or upgrade software. This created another hurdle to installing software, putting it in the hands of the end user rather than an aggressive web marketing campaign.

I also tried to train them on the use of the firewall. The firewall also needed to be configured to let more "active content" through, so some apps would work. Over time, users will learn that their actions will often trigger traffic -- so, they learn, over time, to make pretty good decisions about allowing traffic.

The good news was that the systems remained virus free and responsive after a couple months.

A firewall, Firefox, and a little education about how to use the system more safely combine to make a good user experience. Users are rewarded for their good habits with a responsive system.

Could these results be replicated with Internet Explorer instead of Firefox?

No. (Not yet, at least.)

The reason is simple. Firefox's popup blocker (and ad blocker) help discourage the installation of adware. Adware is one of the reasons why computers slow down, and people start to feel like they are "infected".

An increase of adware or spyware traffic would also trigger the firewall alerts, and decrease the overall feeling of "security."

Of all the malware out there, adware is the most "safe". It's not a trojan, and it's not a virus. However, it causes systems to slow down, and generates unexpected traffic, leading people to believe their computer is "infected" and out of their control. Thus, it's pretty important to keep adware and spyware off the computer.

Though this security system sounds complex, it's not too difficult to set up and teach. I set it up and explained it to people who knew nothing about computers. I provided customized documentation which included their PC's configuration info, some explanations, and their passwords.

Compu-Wasted in LA

(I’m not an expert in this.) Here’s some info about the computer junk universe.

Electronic Waste Recycling Act of 2003: Covered Electronic Waste Payment System (SB 20/SB 50) established the EWaste business. It collects taxes on products, and distributes payments for collecting product for recycling. The state’s friendly website with info is at eRecycle.org.

You can beg for parts at: Trash Nothing (directory of junk exchangers), LAReUseIt, LA Freecycle, Craigslist’s Free and Computer listings.

You can buy parts on Ebay or Craigslist, of course.

Other ways to find them are to poke around dumpsters and behind buildings. People leave old computers out for scavengers.

For surplus parts and new parts check out Apex Electronics, All Electronics, ITC Electronics, Marvac, Frys, Pacific Radio, Electronic City. These tend to be expensive.

(LA Dumpster Dive does free food… but maybe they’d have other things.)

Cooking Websites

Here are some cooking websites, youtube channels, etc. I'll try to put the ones I use or study here.

Just Hungry
Chanfles!
IMMAEATCHU
Cooking With Dog
Manjula's Kitchen
Cooking with Kai
Maangchi

Damaged CD Drive Installation Prevents Icon from Appearing

The CDRW on a laptop wasn't appearing. The Device Manager saw that it was there, but reported:

Windows cannot start this hardware device because its configuration
information (in the registry) is incomplete or damaged. (Code 19)

A fix was found here:

Google Search for the phrase above.

The solution was in the file cdgone.zip, attached below.

The fix wipes out a few registry keys. The next time the CD was removed and reconnected, the OS had an opportunity to create new registry entries.

AttachmentSize
cdgone.zip1.89 KB

Defeating Change Drum On a Panasonic 5400

By emptying the toner reservoir, you can continue to use the drum. The process is messy, but simple.

I like my Panasonic 5400. It's compact, quiet, and the toner available cheap at Office Depot.

After a couple years of solid use, my printer started flashing "change drum" over and over. Hoping to defeat the message (and fool the printer) I'd pull the drum out and pop it back in. This subterfuge worked, but only temporarily. Eventually, the printer refused to be fooled any longer.

I didn't want to buy a new drum. (I'm a cheapskate.) Printouts looked fine, so, logically, no new drum was required. After some experimentation, I found a way to get rid of the message, WITHOUT BUYING A NEW DRUM. I jumped for joy.

Here's how to do it.

You'll need a Philips head (cross top) and flat head screwdrivers, a trash can with plastic liner, and a room you can get dirty.

First, pull the drum from the printer. Consult the instructions on the printer's door if you get confused. Be careful, and don't touch the drum's green surface! The oils on your fingers can dirty it. Also, don't expose it to too much light. (This will damage the drum's surface, according to the warnings.)

Second, find the toner reservoir. It's the small, black, five sided plastic box at one the end of the green drum. If you look at the box, holding the drum pointed away from you like a rifle, you'll see three Philips head screws set into the box. Remove these and set them aside.

For the next step, you're going to need a flat head screwdriver. You'll also want to be in the bathroom or garage, because it's the messy step.

Third, put a plastic liner in your trash can (or use a big grocery bag), and hold your drum over it, toner reservoir down, green drum pointing up like a tree. (You might want to raise the trash can up to eye level and save your back.) Pull the toner reservoir apart (pull down), like a clamshell, just a crack. The sides of the reservoir are attached each other internally, and I don't think you can separate them without destroying the whole thing. So, be gentle.

Take your screwdriver head and slip it between the two halves, then twist to pry them apart, and leave it in there.

Now, the messy part. Gently tap the toner out. Angle it different ways, turn it sideways, do whatever it takes to get all the toner out. When you're done, wipe everything clean, close the reservoir so the two sides mate perfectly, put the screws back in, and tighten.

If you accidentally touched the green part of the drum, take a piece of clean bathroom tissue or paper towel and wipe it off. Don't worry about damaging the surface, because it's made of Teflon.

You're done. Reinstall your "new" drum, and print!

Notes

You can clean up your toner mess with window cleaner.

Dispose of the toner in a sealed bag, because the dust is probably harmful and definitely messy.

Downloading Windows Mobile 6 - Getting Around Referrer Checks

I had to download Windows Mobile 6 for Blackjack (1), and kept getting an error message.

Some proxies allowed me to get to it, but, wanted $$$ to download the file.

It turns out that Samsung's site is using the REFERER field to restrict access to the file. There's a feature in Firefox 3, and also in Chrome, that helps get around this problem.

Turning on any browsing privacy features will cause the browser not to supply a referrer. The Samsung site is programmed to allow non-referred links to proceed with the download.

On Firefox, this feature is called "Start Private Browsing" and it's in the Tools menu.

AttachmentSize
winmob.jpeg3.72 KB

Enabling Color In Terminal

Darn! The termcap database in OS X is wrong. You should fix it.

1. Edit the file /usr/share/misc/termcap, changing the entry for vt100 to this (note that there's no space in front of the first line... that's to deal with wiki):

 d0|vt100|vt100-am|vt100am|dec vt100:\
    :Co#8:Sf=\E[3%dm:Sb=\E[4%dm:\
    :do=^J:co#80:li#24:cl=\E[;H\E[2J:sf=2*\ED:\
    :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\
    :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
    :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:\
    :rf=/usr/share/tabset/vt100:\
    :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h\E[;r\E[0m\E(B\E)B\E[2J:\
    :ks=\E[?1h\E=:ke=\E[?1l\E>:\
    :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
    :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=2*\EM:vt#3:xn:\
    :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:

2. You should note that it's only the second line that needs to be inserted into the existing entry.

3. You reconstruct the database with:
cap_mkdb /usr/share/misc/termcap

4. Quit and restart Terminal, and you'll pick up the new termcap entry.

All this is done as root.

These instructions were gleaned from http://www.google.com/search?q=cache:eP_G8AlM17EC:www.ahdore.com/craig/v...

Energy Efficiency Page Links (Save Money by Using Less Electricity and Gas)

There's this Japanese word "mottainai" which was used on an almost daily basis when I was growing up. It means "don't be wasteful", particularly with regard to "stuff" and energy. This is a page of links to energy efficiency advice. I'm trying to favor pages with info on using less rather than buying more efficient appliances.

9 Ways to Save Water with a Water Heater
72 Ways to Save Money on Electricity Without Spending a Cent
Insulation and Sealing Air Leaks
5 Ways to Insulate Your Windows for Winter
Pelmets
on Instructables

Local Tips

Kotatsu
Solar Tips

Some tips that I haven't put on pages, yet.

Use plastic taped or glued to window frames to trap air against the window. This prevents heat loss to the cold glass. I used laminate floor underlayment, which is a plastic foam sheet.

Window film will slow down heat transmission through the glass as well. The slightly reflective type will also reflect sunlight back out, and keep the house cooler in the summer.

Formatting Mobile HTML Email

While writing a template for spam, I learned the following about mobile email formatting.

The iPhone will scale the email to match the width of the header image, but subsequent images won't be scaled. And the text below - might end up looking really narrow. The fix is to put the entire layout into a table. Then the iPhone will scale the entire message. The only problem is that the text will now shrink. So make the table 400 to 550 pixels wide. That reduces the shrinking.

The Android mail client doesn't scale the text, and doesn't scale the image either. The layout, overall, is preserved, so anything aligned center or right will be cut off. Images will be cut off. The text, however, will be sized and wrapped to the default font. The fix is to set the width of all graphics the same, around 400 to 500. Don't align any text right.

On both phones, rotating the phone to read email fixes most of the problems if you use a 500 pixel wide layout.

GIMP Script-Fu Notes: JamCam Cleanup Plugins

I've been using GIMP for around a year, and have started to script it. The tutorials out there were kind of dated, and confusing to me, so this is an attempt to address this situation. This document is still very rough. The examples are plugins that help enhance the quality of photos taken with the JamCam toy camera.
  1. Reference Materials
  2. Creating a Plug-In
  3. Automating a Single Filter
  4. Running a Sequence of Filters
  5. Doing it on Multiple Windows

Reference Materials

You will probably want to read some other script-fu examples. The application's default scripts are kept in /usr/share/gimp/2.0/scripts/. The user's scripts are kept in ~/.gimp-2.2/scripts/. The definitive book about Scheme is The Structure and Interpretation of Computer Programs by Abelson, Sussman, and Sussman. Some cool scripts:

Creating a Plug-In

Script-fu is used to create plug-ins. A plug-in is some code that performs an action in GIMP, with additional code that registers the plug-in into the application's menus. Plug-ins are read from the shared script directory (above) and the user's scripts directory in .gimp-2.2. They are named with the .scm extension. The following is code for a plug-in that does nothing. Save it to demo.scm in ~/.gimp-2.2/scripts
(define (script-fu-demo image
			drawable)
		1)

(script-fu-register "script-fu-demo"
		    "_Demo..."
		    "Demo Plugin."
		    "John Kawakami "
		    "John Kawakami"
		    "8/28/2006"
		    "RGB*"
		    SF-IMAGE       "Image"          0
		    SF-DRAWABLE    "Drawable"       0)

(script-fu-menu-register "script-fu-demo"
			 _"/Script-Fu/Demo")
This is a framework that holds code that operates on the image being edited. (You do things a little differently if you're generating a new image from scratch.) Let's go through the code line by line. The first three lines are the code that does nothing. When you write your script, you'll put the guts of your program in this function.
(define (script-fu-demo image
			drawable)
		1)
All plugins that operate on the current image take two arguments, image and drawable. There's a complicated explanation for this, and I'll link to it later. For now, just know the first two arguments, and know you'll pass the to your functions. All functions return a value, and this one returns 1. The second part registers our function, script-fu-demo, with the global registry of functions. This registry makes it possible for other functions to call your plug ins. There's a tool to browse the registry under the GIMP menu Xtns->Procedure Browser. You should probably check it out.
(script-fu-register "script-fu-demo"
		    _"_Demo..."
		    "Demo Plugin."
		    "John Kawakami "
		    "John Kawakami"
		    "8/28/2006"
		    "RGB*"
		    SF-IMAGE       "Image"          0
		    SF-DRAWABLE    "Drawable"       0)
The first seven arguments are strings that describe your function. The subsequent arguments are used to construct the argument list that's going to be passed to your function. The first is the image and the second is the drawable, just like in the function definition. (I bet you could switch them... but there's no point to doing that.) Note that they come in triplets (so there are six arguments to define two parameters). Later, these arguments will be used to display a simple dialog box to enable user input to the plugin. The last section creates a menu item for this plugin.
(script-fu-menu-register "script-fu-demo"
			 _"/Script-Fu/Demo")
Now you can save the file, and install it. To install it, go to the GIMP menu Xtns->Script Fu->Refresh Scripts. Then, go to an image window and look under the Script-Fu menu. You should see the new menu item there. Clicking on that item will run the script (which does nothing). The _"_AAAAAA" string is used in menus. The letter after the underscore within the string, "A", will be used as the accelerator key.

Automating a Single Filter

Here's the code for a plugin that sharpens an image. I have a cheap toy camera that always requires some sharpening to make it look okay. This plugin saves me a few clicks.
(define (script-fu-jamcam image
			  drawable)
		(begin
			(plug-in-sharpen 1 image drawable 40)
			(gimp-displays-flush) ))

(script-fu-register "script-fu-jamcam"
		    _"_JamCam..."
		    "Fixes up JamCam pictures."
		    "John Kawakami "
		    "John Kawakami"
		    "8/28/2006"
		    "RGB*"
		    SF-IMAGE       "Image"          0
		    SF-DRAWABLE    "Drawable"       0)

(script-fu-menu-register "script-fu-jamcam"
			 _"/Script-Fu/JamCam")
The new code, below, runs the plug-in-sharpen filter, and then calls gimp-displays-flush to refresh the window's contents. If you don't call gimp-displays-flush, the old image stays in the window.
		(begin
			(plug-in-sharpen 1 image drawable 40)
			(gimp-displays-flush) ))
The (begin ... ) construction executes a sequence of functions, and returns the value of the last function. To see more information about the functions, use the Procedure Browser and search for the functions. Simple documentation is provided.

Running a Sequence of Filters

To get the picture just right, I always do some adjustments to the saturation and contrast before sharpening. The code is as follows:
		(begin
			(gimp-hue-saturation drawable 0 0 0 5)
			(plug-in-sharpen 1 image drawable 40)
			(gimp-brightness-contrast drawable 0 20)
			(gimp-displays-flush) ))

Doing it on Multiple Windows

Doing the filtering on all the open windows should be simple, but it's kind of hard. I'm going to lose all the programming newbies and Scheme/SIOD newbies here. (If you are a noob, do a search for a Script-Fu tutorial on the gimp.org site. Study the tutorial. That will explain some of this.) The difficulty is due to the return value of gimp-image-list. gimp-image-list returns a list, the first member is the number of images, and the second member is an array of image IDs. An array is not a list. To get the elements out of an array, you use (aref array index). So, you have to use an index and loop over the array. More on this later. For now, here's the code. Save this script to jamcamall.scm:
(define (script-fu-jamcam-all)
	(let* ( 
		(image-num  (car (gimp-image-list)) )
		(image-ids  (cadr (gimp-image-list)) ) 
		(counter 0)
	      )
		(while (< counter image-num)
			(let* (
				(image (aref image-ids counter)) 
			      )
				(script-fu-jamcam image (car (gimp-image-get-active-drawable image)))
				(set! counter (+ counter 1))
			)
		)
	)
)

(script-fu-register "script-fu-jamcam-all"
		    _"_JamCam All Windows..."
		    "Fixes up JamCam pictures."
		    "John Kawakami "
		    "John Kawakami"
		    "8/28/2006"
		    "RGB*")

(script-fu-menu-register "script-fu-jamcam-all"
			 _"/Xtns/Script-Fu/JamCam")
This plugin is installed into The GIMP window, under Xtns/Script-Fu/JamCam. The function has a lot of new ideas in it. We'll go over these one by one. Scheme math is all prefix. To get the value of "x - 1" you type "(- x 1)". To get the value of "5 * n" you type "(* 5 n)". The operator is typed first, then the arguments follow. Comparison operators work the same way. "n > -1" becomes "(> n -1)". For more information about this, read Section 3 of the GIMP tutorial. (let* ( ...assignments... ) (func ...) (func ...) ... ) - this assigns values to names, and then executes a sequence of functions. The first block assigns values:
(define (script-fu-jamcam-all)
	(let* ( 
		(image-num  (car (gimp-image-list)) )
		(image-ids  (cadr (gimp-image-list)) ) 
		(counter 0)
	      )
car and cadr are list functions. For information about car, cdr, cadr, cddr, and other functions, read Section 3.3 of the GIMP tutorial. The (while (...cond...) ...sequence...) construction executes the sequence repeatedly, as long as cond is true.
		(while (< counter image-num)
			(let* (
				(image (aref image-ids counter)) 
			      )
				(script-fu-jamcam image (car (gimp-image-get-active-drawable image)))
				(set! counter (+ counter 1))
			)
		)
	)
)
Again, in the above, we see another (let* ... ...). (aref ...array... ...index...) extracts values from an array. An array is not a list. It's a fixed data structure that's returned by some functions. The data is from deep in the guts of GIMP. After extracting the value of an image from image-ids, we use it to call script-fu-jamcam, which was defined in the other plugin. The final new function we see is (set! ...name... ...value...). set! assigns a value to a name. It's not like let*, because the values assigned in let* exist only within let*'s block of code. set! assigns a new value to an existing name. (The real Scheme'y way to do this would be to recursively apply the script-fu-jamcam function to a list of image IDs. Unfortunatey, we don't get the data in a format that makes life so easy.)
AttachmentSize
jamcam.scm.txt566 bytes
jamcamall.scm.txt654 bytes

Generally Accepted Accounting Practices (GAAP)

I keep hearing that term, "generally accepted accounting practices". It turns out there's a standards body that defines what these practices are! FASAB's GAAP standards.

Generating Word Files with WordML (xml) as a Template

Background

I've been spending the past day messing around with WordML to get it to generate Word files from PHP. The goal was to create printable tables. As George Bush said as the Iraq War slid toward failure: "Mission Accomplished."

My strategy was to start with a Word file, save it as xml, aka WordML, and then using the file as an xml template for the table layout. This is analogous to designing your output forms in NVU or Dreamweaver, and then turning it into a template.

Note that I saved the document out as an .xml file, not an .htm file. The .htm file could also be used as a template, but it doesn't retain all the Word features. There's also an alternate format, .htx, that is a MIME encoded .htm with enclosures, but the entire thing is MIME encoded, and decoding (and re-encoding) is a pain. XML is clean and relatively simple, and allows you to embed graphics.

Step by Step

1. To convert a document into a template, first, save it out as xml.

2. Then, use HTMLTidy to reformat the xml into something readable. Use the command "tidy -i -xml filename > outputfile". That will indent the xml code so you can edit it.

3. Cut and paste the XML into your logic, just like you might use HTML. Use the <? and ?> style, not 'echo', please. There is a LOT of XML.

4. You must set the content type to application/msword. This will tell the browser to open the file with Word. In PHP, above the template, add a header line:

header("Content-type: application/msword");

5. You will need to use echo to emit the xml headers, before the reset of the page, if you are using the short tags mode in PHP:

echo '<?xml version="1.0" encoding="utf-8" standalone="yes"?>'."\n";
echo '<?mso-application progid="Word.Document"?>'."\n";

So, in PHP, you might have this block at the top of the page, in addition to your own code:

<?php
header("Content-type: application/msword");
echo '<?xml version="1.0" encoding="utf-8" standalone="yes"?>'."\n";
echo '<?mso-application progid="Word.Document"?>'."\n";
?>

That's all there is to it.

Tips

Reference Material

http://www.xmlw.ie/aboutxml/wordml.htm
http://rep.oio.dk/Microsoft.com/officeschemas/wordprocessingml_article.htm
http://www.informit.com/guides/content.asp?g=xml&seqNum=176&rl=1
http://www.tkachenko.com/blog/archives/000024.html
http://en.wikipedia.org/wiki/Microsoft_Office_Open_XML

How Much Money Can You Save on Gas by Riding the Bus?

This is a javascript calculator that will estimate if taking a bus will cost less than what you pay in gasoline. Surprisingly, for short commutes, commuting by car is cheaper than getting a bus pass. (Calculator is on the full article.) You can get prices at Gas Buddy.

How Much Can You Save on Gas by Riding the Bus?

Fill out this form with our information, and a report will appear below.

Cost of gasolline, per gallon dollars
Your car's highway MPG mpg
How long does it take to drive to and from work, in minutes? Total of the commute time in both directions. minutes
The cost of a monthly bus pas that gets you to work dollars

Your Report

Your cost to drive to work is approximately $ per day.  If you take the bus, you will break even on the cost of a bus pass at days.  If you ride the bus to work 20 days a month, you will save dollars each month.  (This is the savings after the pass' cost is recovered. A negative value indicates that driving is cheaper than a bus pass.)

This report is calculated by making the assumption that your highway mpg converts to your car's "gallons burned per hour".  If you get 55mpg, then you will burn through 1 gallon per hour if you drive at 55 mph.  If you get 27.5 mpg, then you will burn through 2 gallons per hour if you drive at 55 mph. This is not wholly accurate, but it accounts for the effects of start-and-stop driving common during urban rush-hour.  This effect is negated in hybrid cars with regenerative braking, which get better mileage in the city than regular cars with brake pads.  So this calculator doesn't work for hybrid electric cars. It also doesn't account for attempts at hypermiling.

The decision to use the bus and train depends a lot on the length of the commute, because the commute time will typically be doubled. A 10 minute commute becomes a 20 minute one (or even longer). That's not a big deal. Often, a 1 hour commute becomes a 2 hour commute. I'm not sure why that is, but it seems to work out that way. Adding an hour to the commute is very different from adding another 10 or 20 minutes. It's more expensive, in a way, because the impact of 10 minutes on your overall schedule is small. The impact of an extra hour is pretty big. And adding two hours is significant, and is a good argument against using a bus.

However, this extra time can be offset if you can use the bus-time or train-time to read or do work, or other things which you can't do while driving. (During commutes to USC games, some commuters drink alcohol.) Another argument in favor of riding the bus is that brisk walking for 10 or 20 minutes contributes to good health. There are also opportunities that open up once you have a bus pass: once you've recovered the cost by using it enough to break even, the bus pass is a way to avoid parking fees, downtown traffic, and even long walks (for example, instead of walking 5 blocks, you just get on an approaching bus or train, and it's free).

The cost of parking is severely undercounted. If you hunt for a space for 15 minutes, you're going to burn up around half a gallon of gasoline to move 0 miles. So it's sometimes worth it to just pay - but in some areas, the price of parking is high. In downtown LA the meters are $3 or $4 an hour, and lots are the same or more. If you bus or train it, you can park in a residential or industrial area, or a distant discount lot, and ride in on the bus.

How to Clean a Pool Water Filter

It's not here. It's on this page -> Pictorial Guide to Cleaning out a Pool Water Filter.

How to Register Trademarks, Cheap

I've only done this once, but, it was easier than expected. You don't need to pay a service hundreds of dollars to do this.

It costs $325 for the one trademark, but the costs can rise if your mark is used in different contexts. If you use the online forms and are well-prepared, you can save some money and get it done for $275.

Do You Need to Register the Trademark?

No. Your use of a name for trade is protected, inherently, in the US. Lawyers and websites say you should, but, legally, you're protected once you start using a name in conjunction with a specific product or service. Always document the first use, with photographs, web postings, etc. Also, use the "TM" trademark symbol with the name: Riceball.com™. You can type this &trade;, in HTML. You can also use Character Map (in Windows) or Key Caps (in Mac) to find the ™ symbol. You can use the trademark with the ™ symbol before you start selling something under the trademark (but I think you must start selling in a year).

It's probably more important to spend all the initial money on the project or product, to see if you even want to do it long-term. Do the work even before taking care of all the "business" aspects. Then figure out if there's a profit in it. If you are sure you're into it and the profit will come, register the trademark and start using it.

Domain Names

I don't know if domain names are considered a way to establish a trademark.

According to the Domain Names and Trademarks FAQ on nolo.com, the answer is "no" if you have a generic domain, like dictionary.com.

On the other hand, if your business is named HalCom and you registered halcom.com, it might be enough evidence in case someone else come along and does business as HalCom. You can say "I started it first, here's proof." However, to my untrained mind, it seems like flimsy evidence at best, because there's a lot of domain names that are being "squatted" and it's hard to show it was really being used. Get a "DBA" instead.

Doing Business As

If you want to be cheap, file a Doing Business As (DBA). It's $12 (LA County, 2008) plus the cost of placing a DBA ad - a "Fictitious Business Name Statement." I think that's around $40, but more in better papers.

Los Angeles folks can do this in Norwalk, CA at the LA County Registrar's Office. Check your county's website for your local details, prices, etc. When you get there, some people will be offering to help you file it and place an ad in their paper. These are hucksters and pretend to be government workers, but they are just salespeople for these papers. They'll overcharge you. Don't fall for it. There are plenty of underworked government workers inside willing to assist.

Before you go, you should do a search for the business name. The search is on the Registrar's website. This is the exact same search that the clerk can do for you - there are also self-serve terminals at the office, so you can search there too.

If this DBA doesn't sound like enough - or if you're going to do some interstate trade, you might want to register your trade mark, for the authority it carries. In the long-run, it might save you hassles. Besides, if someone else is going to start a business, and they do the trademark search, your name will turn up; they will choose a different name, and everyone is saved a lot of heartache.

Register Online, Save $

The US Patent and Trademark Office (USPTO) is at http://www.uspto.gov/.

Their trademark registration system is called TEAS. There's also a search system called TESS, which you use to search for existing trademarks to make sure you aren't already infringing on someone else's trademark.

Their online system works well, and you can go through the forms for practice, without paying. (Unlike commercial sites, government sites make it kind of difficult to pay, so don't worry about accidentally being charged.)

Before you dive in, there are some basic concepts that, if you know them, will make the process easier.

Words and Appearance

You can trademark the name of your company or product, or the way the name is presented, but not both at the same time. For example, let's consider IBM, their logo, and their name. (I won't display it here. Look at apple.com.)

They probably applied for several different trademark protections. First is the name "IBM". They've obviously registered "IBM". They probably registered "International Business Machines" as well, because that's their full name.

Additionally, they've probably registered the appearance of the logo, with the specific lettering, and the white stripes, as well as the blue color. The following logo might be considered an infringement on their trademark:


(yeah, this is an allusion to 2001: A Space Odyssey.)

If IBM had a logo in addition to their well-known one, they'd have to trademark that as well. This could be something artistic like Apple's logo, or something I'd consider less artistic, like AT&T's blue planet logo and that trendy typeface. +

The basic rule is, you have to register the words and the appearance separately.

For starters, you should stick to trademarking the name.

Classes of Trademarks

A "class" is a description of a range of types of product, service, or other sellable thing that can be trademarked. The term "class" is meant to be like "classification", not like "social class" or "classroom." For example, IBM sells computers (they still sell big ones). They also sell computer services -- if you have enough money, you can hire someone from IBM to come over and write software for you. These are two different classes of trademarks.

Here's another example. Chanel makes perfumes. Chanel also makes dresses. Perfumes are classified under "cosmetics", while dresses are classified under "clothing".

If you sell more than one class of product, you need to register a trademark for each class of product.

Registering for more than one class will cost more money.

You should do it, though. There was a record company called Apple Corps. They put out the Beatles records. There have been a series of lawsuits between Apple Corp and Apple Computer, as detailed in a Wikipedia article. (Then again, maybe it makes sense to let another company with your trademark get big, so you can sue them.)

Appeals

If you screw up your application, you'll have to appeal it. This costs money. So, practice on the website over and over until you get it right. Make sure your trademark doesn't conflict with another one.

Here's a link to their site.

http://www.uspto.gov/web/trademarks/workflow/start.htm

Cultural Aspects of Trademark

In the 1960s immigration laws changed, and many middle class ethnic Chinese people started moving into California, creating suburban Chinatowns, and I lived in one of these areas. One of the businesses that was created was called "AFC", and they used a logo that looked almost like "JFC" a competing business that had been established for a couple decades longer (and had roots back to the early 1900s). See: JFC and AFC. The logos are so similar.

I was surprised. The name and logo were designed to look the same. They were engaged in exactly the same business: distributing Asian foods. Not only that, but today, they are located on the same street. Wow! But they don't seem to have sued each other. I found this culturally weird. My cultural expectation is that a business is always trying to be unique - an individual identity in the market - or they are trying to be generic and blend into the market. Creating a name and logo to emulate another established identity seemed wrong, and a little creepy, like a stalker.

Over the years, I've seen a lot of this in Chinese trademarks. You go to the store, and there are multiple products with different brand names, but similar packaging artwork, logos, and even package shapes. There are business names that would violate trademark laws, were it not for the fact that they are in different classes. For example, "NBC Seafood". The business is aware there is an "NBC" tv network -- that was the point, "NBC" is a quality trademark, and the intent was to aspire to the existing trademark.

There are certain to be other cultural surprises out there, so, be aware and open-minded to dealing with trademark infringement.

More Articles

How to Register Trademarks by Stephan Schneider How to Register a Trademark by Kelly Spors Trademark Filing by Erik J. Heels.

AttachmentSize
hallogo.png1.4 KB

How to Stop the Political Telemarketing Phone Calls

Every political season, if you are a voter, you'll get political calls and mailers. Here's how to mitigate the number of calls.

First, when they call, answer, and tell them you wish to be removed from the list. If you want a reminder call on election day, tell them you will vote for them. If you don't want to be called again, tell them you want to be completely removed from the list. Hopefully, the operator knows how to do this.

There are multiple campaigns calling, so you'll keep getting some calls.

Second, consider registering to vote but leave the phone number field blank. The campaigns get fresh numbers each election from the secretary of state's office. No number = no call.

Again, multiple campaigns will call, so it won't eliminate all calls. For example, if you're on the League of Conservation Voters list, you might get a call from LCV.

Third, you can actually tell the person what your key issues are, and they may have a space in their system to record notes. Some campaigns look at those notes as feedback.

Information Technology Workers: an IT Labor Union?

If you have reached this page through a search engine, and are interested in IT organizations, please check out Bright Future Jobs. Their URL is http://brightfuturejobs.org/

This is a short list of links to groups that organize or try to organize programmer labor unions and other computer-based worker unions, as well as lobby organizations. This document is undergoing constant revision.

Page News
I just found out about CyberUnions a podcast and community about FOSS and labor.
Starting a new page about the computer programmer's exemption from overtime laws.

Threads
H1-B visas: Would lifting the cap really attract the 'brightest and best' to the US
Should IT Be Unionized? on TechRepublic
Answer thread about an IT union.
A Tech Republic thread about the direction of US industrial policy and Andy Grove's ideas..
A thread on Tech Republic about recruiters and salaries.
Old thread discussing work conditions in IT.
Old thread on Linux.com about Cyberlodge, with many interesting comments.
Why programmers are not subject to labor laws
Thread about the glut of STEM workers, following a Vivek Wadhwa column.
10 common career myths

Offshoring
This is an incomplete list of articles. Stuff I've come across. The coming collapse of IT jobs and wages.
No Easy Answers on Offshoring.

Resources

Techsunite has a good list:
http://www.techsunite.org/resources/orgs/index.cfm

In Europe: UNI IBITS IT
In Asia: UNI-APPRO IBITS news

CyberUnions a podcast and community about FOSS and labor.
http://www.programmersguild.org/
http://www.ieeeusa.org/
http://www.washtech.org/
http://www.techsunite.org/
American Radio Association, AFL-CIO
http://www.iitw.org/
http://www.dpeaflcio.org/about.htm - an AFL CIO department for professionals
http://www.ifpte.org/ - organizes NASA and other engineers
IWW 560

Also, some programmers and IT people are represented by unions like AFSCME and CWA at their workplaces as part of a bargaining unit.

Somewhat related:
http://www.freelancersunion.org/
http://www.sage.org/
http://www.acm.org/public-policy

Wikipedia has a good list of Computer related organizations including the major professional organizations.

Articles about "open source unionism" or unions for workers without an organized workplace:
http://www.thenation.com/doc/20020624/rogers
http://www.heardny.org/Open%20Source.htm
http://www.linux.com/articles/29390
http://papers.nber.org/papers/w13850 (new paper on results of Working America)

Articles about organizing workers, and organizations:
http://www.dpeaflcio.org/conference_2005_materials/ - good articles here
http://en.wikipedia.org/wiki/Organizational_studies

Also, computer user groups like LAMP SIG, LA JUG, LiLAX, Geek Dinners, and others can be a place to self-organize.

Existing organizations tend to lean toward professional associations, with the trade unions somewhat resembling professional associations, except they undertake collective bargaining. One overriding goal appears to be to gain more public respect for programmers and system administrators, and to raise the status of engineers.

These efforts seem to bear little fruit for programmers, and the field has been flooded by a number of simple "certification" programs.

The big public policy issues are offshoring work, and the H1-B visa program. Different organizations take different positions, ranging from allying with the American anti-immigrant movement - complete with nativism, to focusing primarily on stopping the movement of jobs overseas.

Except for the IEEE, these movements and lobbies seem to have little money, and not much teeth.

[There isn't a clear direction for international organizing, particularly in building bridges to collaborate with workers in India, to help them get reasonable work hours and equivalent work conditions. Due to the amount of trans-national work being done, and the level of immigration, it seems like such an alliance would be necessary.]

The National Writers Union voted in 1998 to not spend resources to organize programmers. Programmers may join if they qualify under other rules, but, the organization voted not to spend money to do any organizing.

Articles

Halo 4 contractor staff member calls for unionisation of the games industry
Old article about the IAM CyberLodge
Mention of a Palestinian IT union
IBEW article on missclassification as independent contractors
Programming as Labor
Has Open Source Reached Its Limits?
The Information Proletariat in the Era of Globalization
BLS says Computer Programming jobs will decline from 2009 to 2016
Composers consider unionization - a nonprofit professional organization considers becoming a union.

Computer Manufacturing

I don't know much about computer manufacturing, but had the idea that I wanted to buy from labor friendly manufacturers. That is already hard enough to find in America, but, it's complicated when you're going international. Computers are made with parts from many countries, and assembled in different countries. It's totally globalized. So, it's difficult to answer the question, "was my equipment made with union labor?" or "were workers making this computer treated well?" Chances are, the answer is "no". What follows are some links to stories and resources.

NEW I found a link from a story on This American Life, Mr. Daisey and the Apple Factory, for an organization called SACOM, which is a watchdog organiztion in Hong Kong. They have a study about work conditions for suppliers of major brand computer manufacturers.

Also see Good Electronics, and China Labor Watch.

Alibaba is a global wholesale site, and gives you an idea of what's out there. A starting point for reading: Contract manufacturers, also called EMS, make the electronics. These EMS companies are sometimes larger than the companies, like Apple, Dell, Cisco, that use the EMS. Another starting point for reading Supply chain management.

Dell to close Irish factory, move to Poland
Foxconn sued journos for exposing bad labor practices (they make the iPod and pay their workers the China minimum wage). Foxconn in Finland hired union busters. Foxconn forced to form union.

Other Resources

Davis-Bacon and Related Acts at the DOJ.
California Prevailing Wages
Fact Sheet #17E:Exemption for Employees in Computer-Related Occupations Under the Fair Labor Standards Act (FLSA)
Trade Adjustment Assistance is a government program to assist workers who have had their jobs sent to another country. TAA and ATAA at the Dept. of Labor

Labor Education and Resources Network

Other Articles About Work

Why I Don't Do Unpaid Overtime and Neither Should You
Anarkhos - some angry guy who is probably a programmer.

Installing Skype Dynamic on Linux AMD64

It's pretty simple to set up Skype (dynamic) on Ubuntu 9.10 (beta). I think all the 32bit libraries are installed by default. If they aren't, check out Daryl Dawkins' page about running it on Fedora.

The one oddity I experienced is that you need to run the skype program from within the skype directory. The following script does that - my Skype is installed in ~/bin, my personal bin folder.

#! /bin/bash

cd $HOME/bin/skype-2.1.0.47
exec ./skype

That's all there is to it. chmod u+x skype to make it runnable, and then run it.

The only difficulty I had was with the microphone - there were three different input options, and it wasn't clear which one was going to work. It turned out to be the one labeled Microphone 2. To select it, you use the Sound Preferences control panel. (You can't select it in Skype. Skype uses the default input.)

To test, use Sound Recorder. Other apps work, too, but, SR is the fastest and easiest.

If nothing works, try installing alsamixer (sudo apt-get install alsamixer). Alsamixer will let you adjust the input levels of the different devices, and seems to do a better job than the Sound Preferences panel. You might need to raise the level for all the mics. Alsamixer keystrokes:

LEFT ARROW, RIGHT ARROW : select channel
UP ARROW, DOWN ARROW: set level
ESC: quit, saving levels
AttachmentSize
SkypeBlue_48x48.png3.13 KB

Intel Motherboards (mid 2010)

This is a short list of Intel motherboards. Intels are usually regarded as the most stable mobos, but lately stability has declined somewhat, according to reviewers at NewEgg. You need to match the memory to the board to achieve stability. Look up lists of compatible, tested RAM.

This list is ordered from more expensive to less expensive.

DP55WG, +has fw, no video card
DP55KG, +has fw, no video card
DP55SB, +has fw, no video card
DP55WB, +has fw, no video card

DQ57TM, has IDE, VPRO if you get a i5-670, 660,650 or i7-870,860,860-s.

DH57JG, miniitx
DH57DD +video
DH55HC +video
DH55TC +video
DH55PJ +video
Core i5-750 quad core lynnfield - best cpu deal
i7-860 lynnfield quad

One interesting board is the DQ57TM, which has vPro. That allows you to use VNC (Pro version) to remote in and view the boot-up process, and also mount a DVD-ROM on your machine onto the remote machine. You can boot and install a system remotely. The cost of using the DQ57TM is a higher price for slower CPUs.

Another is the DH57JG, which is a mini-itx sized board, for low-profile or smaller computer cases.

JamCam Tips

The colors are a little off, and I find that going into the "curves" tool and boosting the green highlights, red midtones, and blue shadows just a little bit makes the picture look a little more vivid. They're not fully corrected, but a little truer.

Attached is the GIMP color curve file I use to correct for photos taken in outdoors shade.

Then, I use the "brightness/contrast" tool to increase the contrast a lot. Sometimes, I knock down the brightness a little bit.

Then, I use the "sharpen" filter (under the "enhance" submenu in GIMP) and apply around 50% sharpening. That's a lot, but, the camera needs it.

Here are some JamCam photos. They look "okay".

AttachmentSize
jamcam545 bytes

Keyboard Mod: Salvaging Keypad

I left my cheapo keyboard in the car, and the ABS plastic warped, contorting it like a potato chip. After some key sticking ugliness with my regular (great cheap) keyboard, I started using a BTC board that feels like a laptop keyboard. It's nice, but, lacks a keypad. I thought, maybe, I could use the keypad on the warped keyboard.

The keyboard is wired as a kind of grid, with a dimension of 14 by 12 wires, and each key is a switch between two wires. A squarish grid is used because it maximises the number of switches for the number of wires. Each key press is detected by seeing which two wires are connected. This detection is done by "scanning" the grid, testing each pair of wires by putting a voltage on the wire in one axis, and seeing where the voltage appears along the other axis. The physical keyboard isn't 14 x 12; it's 6 by around 23 keys... but the underlying wiring is the grid circuit adapted to fit under the keys.
This "illustration" shows how a grid might be mapped to the physical keys. The actual keyboard is more complex.

The mod consisted of taking the clamshell apart, then mapping out the wiring of the keys on the keypad. You take it all apart, and then use a continuity tester to see which terminals map to which keys.

Most of the pins were on the "right" side of the circuit. Two pins, 13 and 14, were not. Thus, if I could fix up the wiring for 13 and 14, I could just cut the keyboard circuitry with a pair of scissors, and isolate the keypad. That's what I did (more or less).

Reconnecting pins 13 and 14 was weird. I used the traces on the (now) scrap "left" side of the circuit as "wire." The circuit traces are nice, because the they are flat, and made of the same material. Connecting the circuit involves simply positioning the electrodes to touch, and then taping it down. To isolate the "wire", you just cut away the excess, unneeded circuit. There was a strip of circuit along the top that mapped perfectly to the traces for the keypad. The traces I needed to wire came in two sizes -- tightly spaced narrow lines, and larger, looser lines. A little hunting around found a bit of circuit that had the thin traces in one area, and the thick ones in another. The strip was nice and long, so I cut it out. Then, I "wired up" one side, with some tape, and the other side in the same way. The strip had to be twisted a little, but that wasn't a big deal. The ends were held down with tape.

I cut the clamshell to remove the keypad, cleaned it up, then, put it all back together. The keys were a little sticky, so I took them off (pry them with a credit card) and sprayed a little WD40 on the backs. This was a bad idea, and the keys got even stickier. The problem wasn't lubrication, but the warping of the plastic.

I plugged it back in, and it worked. The only problem was that the keys stuck, so the pad was basically useless.

Total time was around 2 hours from start to finish.

AttachmentSize
keypad.jpg5.73 KB

Lithium Coin Battery Sizes Explained

The common computer battery is a CR2032. The C means lithium. The 20 means 20mm diameter, and 32 means 3.2mm thick.

So a CR2023 (used in a remote control) is 20mm across and 2.3mm thick. I was unable to find a 2023, and bought a 2025 instead. It worked fine. I also used a 2025 in a computer, and it worked okay as well, but it was a tad loose.

Likewise, if you need a 2030 or a 2035, I bet a 2032 would work fine, and cost less, because the 2032s are so plentiful.. There's some flexibility with the last two digits.

On the flipside, if the first two digits are different, you can be pretty certain that it's not going to work.

Los Angeles County Real Estate, by Zip Code: Redfin Links

This is a list of community names and zip codes, linked to their respective Redfin market-conditions pages. The links will open new tabs, so you can click a load of them. The list was copied from LA Almanac's list. Acton :93510
Agoura :91301
Agua Dulce, Saugus :91350
Airport Worldway (City of LA) :90009
Alhambra :91801
Alhambra :91803
Altadena :91001
Arcadia :91006
Arcadia :91007
ARCO Towers (City of LA) :90071
Arleta (City of LA) :91331
Artesia :90680
Athens :90044
Atwater Village (City of LA) :90039
Avalon :90704
Azusa :91702
Baldwin Hills :90008
Baldwin Park :91706
Bassett :91746
Bel Air Estates (City of LA) :90049
Bel Air Estates (City of LA) :90077
Bell :90201
Bell Gardens :90201
Bellflower :90706
Beverly Glen (City of LA) :90077
Beverly Glen (City of LA) :90210
Beverly Hills :90210
Beverly Hills :90211
Beverly Hills :90212
Biola Univ. (La Mirada) :90639
Boyle Heights (City of LA) :90033
Bradbury :91010
Brentwood (City of LA) :90049
Burbank :91501
Burbank :91502
Burbank :91506
Burbank :91523
Burbank (Glenoaks) :91504
Burbank (Woodbury Univ.) :91510
Cal State Dominguez Hills (Carson) :90747
Cal State Long Beach (Long Beach) :90840
Cal State Northridge (City of LA) :91330
Cal Tech (Pasadena) :91125
Cal Tech (Pasadena) :91126
Calabasas :91302
Calabasas :91372
Canoga Park (City of LA) :91303
Canoga Park (City of LA) :91304
Canyon Country (Santa Clarita) :91351
Carson :90745
Carson :90746
Carson (CS Univ. Dominguez Hills) :90747
Carson/Long Beach :90810
Castaic :91310
Castaic :91384
Castellemare (City of LA) :90272
Century City (City of LA) :90067
Cerritos :90701
Chatsworth (City of LA) :91311
Cheviot Hills (City of LA) :90064
Chinatown (City of LA) :90012
City Terrace :90063
Civic Center (City of LA) :90012
Claremont :91711
Commerce, City of :90040
Compton :90220
Compton :90221
Compton :90222
Country Club Park (City of LA) :90019
Covina :91722
Covina :91723
Covina :91724
Crenshaw (City of LA) :90008
Cudahy :90201
Culver City :90230
Culver City :90232
Cypress Park (City of LA) :90065
Diamond Bar :91765
Diamond Bar :91789
Dominguez Hills, Cal State (Carson) :90747
Downey :90240
Downey :90241
Downey :90242
Downtown Los Angeles (City of LA) :90013
Downtown Los Angeles (City of LA) :90014
Downtown Los Angeles (City of LA) :90015
Downtown Los Angeles (City of LA) :90017
Downtown Los Angeles (City of LA) :90021
Eagle Rock (City of LA) :90041
East Los Angeles :90022
East Los Angeles (City of LA) :90023
East Rancho Dominguez :90221
Echo Park (City of LA) :90026
Edwards AFB :93523
El Monte :91731
El Monte :91732
El Segundo :90245
El Sereno (City of LA) :90032
Elizabeth Lake :93532
Encino (City of LA) :91316
Encino (City of LA) :91436
Federal Bldg (Lawndale) :90261
Firestone Boy Scout Res. :92621
Florence :90001
Gardena :90247
Gardena :90248
Gardena :90249
Glassell Park (City of LA) :90065
Glendale :91201
Glendale :91202
Glendale :91203
Glendale :91204
Glendale :91205
Glendale :91206
Glendale :91207
Glendale :91208
Glendale (La Crescenta) :91214
Glendale (Tropico) :91204
Glendale (Tropico) :91205
Glendale (Verdugo City) :91046
Glendora :91740
Glendora :91741
Glenoaks (Burbank) :91504
Granada Hills (City of LA) :91344
Griffith Park (City of LA) :90027
Hacienda Heights (La Puente) :91745
Hancock Park (City of LA) :90004
Hancock Park (City of LA) :90020
Harbor City (City of LA) :90710
Hawaiian Gardens :90716
Hawthorne (Holly Park) :90250
Hermosa Beach :90254
Hi Vista :93535
Hidden Hills :91302
Highland Park (City of LA) :90042
Hollywood (City of LA) :90028
Hollywood (City of LA) :90029
Hollywood (City of LA) :90038
Hollywood (City of LA) :90068
Huntington Park :90255
Hyde Park (City of LA) :90043
Industry, City of :91744
Industry, City of :91746
Industry, City of :91789
Inglewood :90301
Inglewood :90302
Inglewood :90303
Irwindale :91706
Jefferson Park (City of LA) :90018
Juniper Hills :93543
Koreatown (City of LA) :90005
La Canada-Flintridge :91011
La Crescenta (Glendale) :91214
La Habra Heights :90631
La Mirada :90638
La Mirada (Biola Univ.) :90639
La Puente :91744
La Puente :91746
La Puente (Hacienda Heights) :91745
La Puente (Rowland Heights) :91748
La Verne :91750
Ladera Heights (City of LA) :90056
Lake Hughes :93532
Lake Los Angeles :93550
Lake Los Angeles :93591
Lake View Terrace (City of LA) :91342
Lakewood :90712
Lakewood :90713
Lakewood :90715
Lancaster :93534
Lancaster :93535
Lancaster :93536
Lawndale :90260
Lawndale (Federal Bldg) :90261
LAX Area (City of LA) :90045
Leimert Park (City of LA) :90008
Lennox :90304
Littlerock :93543
Llano :93544
Lomita :90717
Long Beach :90802
Long Beach :90803
Long Beach :90804
Long Beach :90805
Long Beach :90806
Long Beach :90807
Long Beach :90808
Long Beach (Cal State Long Beach) :90840
Long Beach (McDonnell Douglas) :90846
Long Beach (North Long Beach) :90805
Long Beach (World Trade Ctr) :90831
Long Beach (World Trade Ctr) :90832
Los Angeles (Airport Worldway) :90009
Los Angeles (ARCO Towers) :90071
Los Angeles (Arleta) :91331
Los Angeles (Atwater Village) :90039
Los Angeles (Bel Air Estates) :90049
Los Angeles (Bel Air Estates) :90077
Los Angeles (Beverly Glen) :90077
Los Angeles (Beverly Glen) :90210
Los Angeles (Boyle Heights) :90033
Los Angeles (Brentwood) :90049
Los Angeles (Cal State Northridge) :91330
Los Angeles (Canoga Park) :91303
Los Angeles (Canoga Park) :91304
Los Angeles (Century City) :90067
Los Angeles (Chatsworth) :91311
Los Angeles (Cheviot Hills) :90064
Los Angeles (Chinatown) :90012
Los Angeles (Civic Center) :90012
Los Angeles (Country Club Park) :90019
Los Angeles (Crenshaw) :90008
Los Angeles (Cypress Park) :90065
Los Angeles (Downtown) :90013
Los Angeles (Downtown) :90014
Los Angeles (Downtown) :90015
Los Angeles (Downtown) :90017
Los Angeles (Downtown) :90021
Los Angeles (Downtown) :90029
Los Angeles (Eagle Rock) :90041
Los Angeles (East Los Angeles) :90023
Los Angeles (Echo Park) :90026
Los Angeles (El Sereno) :90032
Los Angeles (Encino) :91316
Los Angeles (Encino) :91436
Los Angeles (Glassell Park) :90065
Los Angeles (Granada Hills) :91344
Los Angeles (Griffith Park) :90027
Los Angeles (Hancock Park) :90004
Los Angeles (Hancock Park) :90020
Los Angeles (Harbor City) :90710
Los Angeles (Highland Park) :90042
Los Angeles (Hollywood) :90028
Los Angeles (Hollywood) :90038
Los Angeles (Hollywood) :90068
Los Angeles (Hyde Park) :90043
Los Angeles (Jefferson Park) :90018
Los Angeles (Koreatown) :90005
Los Angeles (Ladera Heights) :90056
Los Angeles (Lake View Terrace) :91342
Los Angeles (LAX Area) :90045
Los Angeles (Leimert Park) :90008
Los Angeles (Los Feliz) :90027
Los Angeles (Mar Vista) :90066
Los Angeles (Mid City) :90019
Los Angeles (Mission Hills) :91345
Los Angeles (Montecito Heights) :90031
Los Angeles (Mount Olympus) :90046
Los Angeles (Mt. Washington) :90065
Los Angeles (North Hills) :91343
Los Angeles (North Hollywood) :91601
Los Angeles (North Hollywood) :91602
Los Angeles (North Hollywood) :91604
Los Angeles (North Hollywood) :91605
Los Angeles (North Hollywood) :91606
Los Angeles (North Hollywood) :91607
Los Angeles (Northridge) :91324
Los Angeles (Northridge) :91325
Los Angeles (Pacific Highlands) :90272
Los Angeles (Pacific Palisades) :90272
Los Angeles (Pacoima) :91331
Los Angeles (Palms) :90034
Los Angeles (Panorama City) :91402
Los Angeles (Park La Brea) :90036
Los Angeles (Pico Heights) :90006
Los Angeles (Playa del Rey) :90293
Los Angeles (Porter Ranch) :91326
Los Angeles (Rancho Park) :90064
Los Angeles (Reseda) :91335
Los Angeles (San Pedro) :90731
Los Angeles (San Pedro) :90732
Los Angeles (Sawtelle) :90025
Los Angeles (Shadow Hills) :91040
Los Angeles (Sherman Oaks) :91403
Los Angeles (Sherman Oaks) :91423
Los Angeles (Silverlake) :90026
Los Angeles (South Central) :90001
Los Angeles (South Central) :90003
Los Angeles (South Central) :90007
Los Angeles (South Central) :90011
Los Angeles (South Central) :90037
Los Angeles (South Central) :90047
Los Angeles (South Central) :90061
Los Angeles (South Central) :90062
Los Angeles (Studio City) :91604
Los Angeles (Sun Valley) :91352
Los Angeles (Sunland) :91040
Los Angeles (Sylmar) :91342
Los Angeles (Tarzana) :91356
Los Angeles (Terminal Island) :90731
Los Angeles (Toluca Lake) :91602
Los Angeles (Tujunga) :91042
Los Angeles (USC) :90089
Los Angeles (Valley Village) :91607
Los Angeles (Van Nuys) :91401
Los Angeles (Van Nuys) :91402
Los Angeles (Van Nuys) :91403
Los Angeles (Van Nuys) :91405
Los Angeles (Van Nuys) :91406
Los Angeles (Van Nuys) :91411
Los Angeles (Van Nuys) :91423
Los Angeles (Venice) :90291
Los Angeles (Watts) :90002
Los Angeles (Watts) :90059
Los Angeles (West Adams) :90016
Los Angeles (West Beverly) :90048
Los Angeles (West Fairfax) :90035
Los Angeles (West Hills) :91307
Los Angeles (West Los Angeles) :90025
Los Angeles (Westchester) :90045
Los Angeles (Westlake) :90057
Los Angeles (Westwood) :90024
Los Angeles (Wilmington) :90744
Los Angeles (Wilshire Blvd) :90010
Los Angeles (Winnetka) :91306
Los Angeles (Woodland Hills) :91364
Los Angeles (Woodland Hills) :91367
Los Feliz (City of LA) :90027
Los Nietos :90606
Lynwood :90262
Malibu :90265
Manhattan Beach :90266
Mar Vista (City of LA) :90066
Marina del Rey :90292
Maywood :90270
McDonnell Douglas (Long Beach) :90846
Mid City (City of LA) :90019
Mission Hills (City of LA) :91345
Monrovia :91016
Montebello :90640
Montecito Heights (City of LA) :90031
Monterey Hills (City of LA) :90032
Monterey Park :91754
Monterey Park :91755
Monterey Park :91756
Montrose :91020
Mount Olympus (City of LA) :90046
Mount Wilson :91023
Mt. Washington (City of LA) :90065
Newhall (Santa Clarita) :91321
North Hills (City of LA) :91343
North Hollywood (City of LA) :91601
North Hollywood (City of LA) :91602
North Hollywood (City of LA) :91604
North Hollywood (City of LA) :91605
North Hollywood (City of LA) :91606
North Hollywood (City of LA) :91607
North Long Beach (Long Beach) :90805
Northridge (City of LA) :91324
Northridge (City of LA) :91325
Northridge, Cal State Univ. (City of LA) :91330
Norwalk :90650
Oak Park :91301
Pacific Highlands (City of LA) :90272
Pacific Palisades (City of LA) :90272
Pacoima (City of LA) :91331
Palmdale :93550
Palmdale :93551
Palmdale :93552
Palmdale :93591
Palms (City of LA) :90034
Palos Verdes Estates :90274
Panorama City (City of LA) :91402
Paramount :90723
Park La Brea (City of LA) :90036
Pasadena :91101
Pasadena :91103
Pasadena :91104
Pasadena :91105
Pasadena :91106
Pasadena :91107
Pasadena (Cal Tech) :91125
Pasadena (Cal Tech) :91126
Pearblossom :93553
Phillips Ranch :91766
Pico Heights (City of LA) :90006
Pico Rivera :90660
Playa del Rey (City of LA) :90293
Playa Vista (City of LA) :90094
Pomona :91766
Pomona :91767
Pomona :91768
Porter Ranch (City of LA) :91326
Quartz Hill :93536
Rancho Dominguez :90220
Rancho Palos Verdes :90275
Rancho Palos Verdes :90717
Rancho Palos Verdes :90732
Rancho Park (City of LA) :90064
Redondo Beach :90277
Redondo Beach :90278
Reseda (City of LA) :91335
Rolling Hills :90274
Rolling Hills Estates :90274
Rosemead :91770
Rosewood :90222
Rowland Heights (La Puente) :91748
San Dimas :91773
San Fernando :91340
San Gabriel :91775
San Gabriel :91776
San Marino :91108
San Pedro (City of LA) :90731
San Pedro (City of LA) :90732
San Pedro (City of LA) :90733
Santa Clarita (Canyon Country) :91351
Santa Clarita (Newhall) :91321
Santa Clarita (Valencia) :91354
Santa Clarita (Valencia) :91355
Santa Fe Springs :90670
Santa Monica :90401
Santa Monica :90402
Santa Monica :90403
Santa Monica :90404
Santa Monica :90405
Saugus, Agua Dulce :91350
Sawtelle (City of LA) :90025
Shadow Hills (City of LA) :91040
Sherman Oaks (City of LA) :91403
Sherman Oaks (City of LA) :91423
Sierra Madre :91024
Signal Hill :90755
Silverlake (City of LA) :90026
South Central (City of LA) :90001
South Central (City of LA) :90003
South Central (City of LA) :90007
South Central (City of LA) :90011
South Central (City of LA) :90037
South Central (City of LA) :90047
South Central (City of LA) :90061
South Central (City of LA) :90062
South El Monte :91733
South Gate :90280
South Pasadena :91030
South Whittier :90605
Stevenson Ranch :91381
Studio City (City of LA) :91604
Sun Valley (City of LA) :91352
Sunland (City of LA) :91040
Sylmar (City of LA) :91342
Tarzana (City of LA) :91356
Temple City :91780
Terminal Island (City of LA) :90731
Toluca Lake (City of LA) :91602
Topanga :90290
Torrance :90501
Torrance :90502
Torrance :90503
Torrance :90504
Torrance :90505
Torrance :90506
Torrance :90277
Torrance :90278
Tropico (Glendale) :91204
Tropico (Glendale) :91205
Tujunga (City of LA) :91042
Universal City :91608
USC (City of LA) :90089
VA Hospital (Sawtelle) :90073
Valencia (Santa Clarita) :91354
Valencia (Santa Clarita) :91355
Valinda :91744
Valley Village (City of LA) :91607
Valyermo :93563
Van Nuys (City of LA) :91401
Van Nuys (City of LA) :91402
Van Nuys (City of LA) :91403
Van Nuys (City of LA) :91405
Van Nuys (City of LA) :91406
Van Nuys (City of LA) :91411
Van Nuys (City of LA) :91423
Venice (City of LA) :90291
Verdugo City (Glendale) :91046
Vernon :90058
View Park :90043
Walnut :91789
Walnut Park :90255
Watts (City of LA) :90002
Watts (City of LA) :90059
West Adams (City of LA) :90016
West Beverly (City of LA) :90048
West Covina :91790
West Covina :91791
West Covina :91792
West Covina :91793
West Fairfax (City of LA) :90035
West Hills (City of LA) :91307
West Hollywood :90069
West Los Angeles (City of LA) :90025
Westchester (City of LA) :90045
Westlake (City of LA) :90057
Westlake Village :91361
Westlake Village :91362
Westwood (City of LA) :90024
Whittier :90601
Whittier :90602
Whittier :90603
Whittier :90604
Whittier :90605
Whittier (Whittier College) :90608
Whittier College (Whittier) :90608
Willowbrook :90059
Willowbrook :90222
Wilmington (City of LA) :90744
Wilshire Blvd (City of LA) :90010
Windsor Hills :90043
Winnetka (City of LA) :91306
Woodbury Univ. (Burbank) :91510
Woodland Hills (City of LA) :91364
Woodland Hills (City of LA) :91367
World Trade Center (Long Beach) :90831
World Trade Center (Long Beach) :90832
Trulia recently sold, Zillow recently sold, and Redfin market conditions.

Los Angeles County Zip Codes

Zip 	City
 
90001	Los Angeles
90002	Los Angeles
90003	Los Angeles
90004	Los Angeles
90005	Los Angeles
90006	Los Angeles
90007	Los Angeles
90008	Los Angeles
90010	Los Angeles
90011	Los Angeles
90012	Los Angeles
90013	Los Angeles
90014	Los Angeles
90015	Los Angeles
90016	Los Angeles
90017	Los Angeles
90018	Los Angeles
90019	Los Angeles
90020	Los Angeles
90021	Los Angeles
90022	Los Angeles
90023	Los Angeles
90024	Los Angeles
90025	Los Angeles
90026	Los Angeles
90027	Los Angeles
90028	Los Angeles
90029	Los Angeles
90031	Los Angeles
90032	Los Angeles
90033	Los Angeles
90034	Los Angeles
90035	Los Angeles
90036	Los Angeles
90037	Los Angeles
90038	Los Angeles
90039	Los Angeles
90040	Los Angeles
90041	Los Angeles
90042	Los Angeles
90043	Los Angeles
90044	Los Angeles
90045	Los Angeles
90046	Los Angeles
90047	Los Angeles
90048	Los Angeles
90049	Los Angeles
90056	Los Angeles
90057	Los Angeles
90058	Los Angeles
90059	Los Angeles
90061	Los Angeles
90062	Los Angeles
90063	Los Angeles
90064	Los Angeles
90065	Los Angeles
90066	Los Angeles
90067	Los Angeles
90068	Los Angeles
90069	West Hollywood
90071	Los Angeles
90077	Los Angeles
90079	Los Angeles
90094	Los Angeles
90099	Los Angeles
90101	Los Angeles
90201	Bell
90210	Beverly Hills
90211	Beverly Hills
90212	Beverly Hills
90220	Compton
90221	Compton
90222	Compton
90230	Culver City
90232	Culver City
90240	Downey
90241	Downey
90242	Downey
90245	El Segundo
90247	Gardena
90248	Gardena
90249	Gardena
90250	Hawthorne
90254	Hermosa Beach
90255	Huntington Park
90260	Lawndale
90261	Lawndale
90262	Lynwood
90263	Malibu
90265	Malibu
90266	Manhattan Beach
90270	Maywood
90272	Pacific Palisades
90274	Palos Verdes Peninsula
90275	Rancho Palos Verdes
90277	Redondo Beach
90278	Redondo Beach
90280	South Gate
90290	Topanga
90291	Venice
90292	Marina del Rey
90293	Playa del Rey
90301	Inglewood
90302	Inglewood
90303	Inglewood
90304	Inglewood
90305	Inglewood
90311	Inglewood
90401	Santa Monica
90402	Santa Monica
90403	Santa Monica
90404	Santa Monica
90405	Santa Monica
90501	Torrance
90502	Torrance
90503	Torrance
90504	Torrance
90505	Torrance
90506	Torrance
90601	Whittier
90602	Whittier
90603	Whittier
90604	Whittier
90605	Whittier
90606	Whittier
90638	La Mirada
90640	Montebello
90650	Norwalk
90660	Pico Rivera
90670	Santa Fe Springs
90701	Artesia
90703	Cerritos
90706	Bellflower
90710	Harbor City
90712	Lakewood
90713	Lakewood
90715	Lakewood
90716	Hawaiian Gardens
90717	Lomita
90723	Paramount
90731	San Pedro
90732	San Pedro
90744	Wilmington
90745	Carson
90746	Carson
90755	Signal Hill
90802	Long Beach
90803	Long Beach
90804	Long Beach
90805	Long Beach
90806	Long Beach
90807	Long Beach
90808	Long Beach
90810	Long Beach
90813	Long Beach
90814	Long Beach
90815	Long Beach
90822	Long Beach
90831	Long Beach
90833	Long Beach
90834	Long Beach
90835	Long Beach
91001	Altadena
91006	Arcadia
91007	Arcadia
91010	Duarte
91011	La Canada Flintridge
91016	Monrovia
91020	Montrose
91024	Sierra Madre
91030	South Pasadena
91040	Sunland
91042	Tujunga
91101	Pasadena
91103	Pasadena
91104	Pasadena
91105	Pasadena
91106	Pasadena
91107	Pasadena
91108	San Marino
91201	Glendale
91202	Glendale
91203	Glendale
91204	Glendale
91205	Glendale
91206	Glendale
91207	Glendale
91208	Glendale
91210	Glendale
91214	La Crescenta
91301	Agoura Hills
91302	Calabasas
91303	Canoga Park
91304	Canoga Park
91306	Winnetka
91307	West Hills
91311	Chatsworth
91316	Encino
91321	Newhall
91324	Northridge
91325	Northridge
91326	Porter Ranch
91331	Pacoima
91335	Reseda
91340	San Fernando
91342	Sylmar
91343	North Hills
91344	Granada Hills
91345	Mission Hills
91350	Santa Clarita
91351	Canyon Country
91352	Sun Valley
91354	Valencia
91355	Valencia
91356	Tarzana
91364	Woodland Hills
91367	Woodland Hills
91381	Stevenson Ranch
91382	Santa Clarita
91383	Santa Clarita
91384	Castaic
91387	Canyon Country
91390	Santa Clarita
91401	Van Nuys
91402	Panorama City
91403	Sherman Oaks
91405	Van Nuys
91406	Van Nuys
91411	Van Nuys
91423	Sherman Oaks
91436	Encino
91501	Burbank
91502	Burbank
91504	Burbank
91505	Burbank
91506	Burbank
91601	North Hollywood
91602	North Hollywood
91604	Studio City
91605	North Hollywood
91606	North Hollywood
91607	Valley Village
91608	Universal City
91702	Azusa
91706	Baldwin Park
91711	Claremont
91722	Covina
91723	Covina
91724	Covina
91731	El Monte
91732	El Monte
91733	South El Monte
91740	Glendora
91741	Glendora
91744	La Puente
91745	Hacienda Heights
91746	La Puente
91748	Rowland Heights
91750	La Verne
91754	Monterey Park
91755	Monterey Park
91765	Diamond Bar
91766	Pomona
91767	Pomona
91768	Pomona
91770	Rosemead
91773	San Dimas
91775	San Gabriel
91776	San Gabriel
91780	Temple City
91789	Walnut
91790	West Covina
91791	West Covina
91792	West Covina
91801	Alhambra
91803	Alhambra
91804	Alhambra
93510	Acton
93532	Lake Hughes
93534	Lancaster
93535	Lancaster
93536	Lancaster
93543	Littlerock
93544	Llano
93550	Palmdale
93551	Palmdale
93552	Palmdale
93553	Pearblossom
93563	Valyermo
93591	Palmdale

Make Meme/LOLCats Text with the GIMP

This tutorial explains how to make the "LOLCats" or "Meme" font so popular with the kids today. You can see a lot of these on the 4Chan /b/ channel, but don't go there if you have any illusions that our society isn't full of degenerates. The meme font is Impact Condensed, but to get the right "look", you need to create a black outline around the regular font letters.

A couple tutorials explain how do to this with Photoshop. This tutorial explains how to do it with the free GIMP program.

From the windows menu, open up the Layers and the Paths windows. You may not be familiar with Paths, but it's key to this task.

Select the text tool (the A icon), and then drag out a box. Type in your text. Set the font to Impact Condensed (on some systems, the meme font is simply called "Impact"), and a large pixel size, like 40 pixels. Set the color to white.

Then, click the "Paths from Text" button, which is down in the lower part of the Toolbox. This creates a new path in the Paths window.

Press the "D" key. This will set the colors back to black foreground / white background.

Then, click the "Paint along the Path" button in the Paths window. This is the weird looking brush icon next to the trash icon in the lower right. The "Stroke Path" dialog will appear.

Select "Stroke Line," and set the path size to around 3 pixels. Select "Solid color." Then click the "Stroke" button.

If the stroke steals too many pixels from the text, you might want to undo a few steps, duplicate the text layer, then re-do the path and stroke it. The duplicated text layer can be placed on top of the outlined text. That's what was done on the example above.

There you go!

AttachmentSize
meme1.jpg153.24 KB
meme2.jpg150.95 KB
meme3.jpg155.05 KB
photoshop.jpg39.26 KB

Making Wiki Work With Search Engines

Did you know that Google.com is the only major search engine that knows how to index your Wiki content? Egads! This is horrible. This page describes how to make your Wiki pages look like plain-old-web-pages.html!

First, this document works only if you are using Apache with mod_rewrite and Cunningham's Wiki.

If you're on a Unix box, you're probably using Apache. To make sure, you can try to browse, in Netscape, a nonexistent page, like http://www.riceball.com/nonexistent.file.txt. It has to be Netscape.

Then, you have to check that the web server can load in the mod_rewrite module. One quick check is "/usr/sbin/httpd -l", which prints out a list of modules compiled into the system.

If it's not in the list, it may still be a dynamically loaded module. Look in /usr/local/lib/apache or /usr/lib/apache.

Next, you will need to be able to create the Rewriter rules. This can be tricky. If you have access to httpd.conf, you can put the rules in there. Generally, that won't fly, because the last thing a sysadmin wants is you mucking through the main config files for a per-server issue. So, you'll have to create a .htaccess file in your web server's documents directory.

In the .htaccess file you need to add the following lines:

RewriteEngine on
RewriteRule wikiwiki/([A-Za-z0-9]+)\.html$ cgi/wiki.cgi?$1

This will cause the server to rewrite urls that look like:

http://www.riceball.com/wikiwiki/RiceWiki.html

Into the following:

http://www.riceball.com/cgi/wiki.cgi?RiceWiki

(If you cannot decipher this, check out http://httpd.apache.org/docs/misc/rewriteguide.html - the mod_rewriter guide.)

If this isn't working, the server may need to be reconfigured to allow you to use mod_rewriter. You may need the Apache FollowSymlinks option turned on.

Once this is set up and working, you need to modify the Wiki script to use these new URLs instead of the ones that call the CGI directly. I changed two lines in the script.

First, add this line:

$HTMLUrl = "http://www.riceball.com/wikiwiki/";

And then modify the lines that write the links, in AsAnchor, like this:

defined $db{$title}
# ? "$title<\/a>"
? "
$title<\/a>"
: "$title
?<\/a>";

As a final step, you might want to add a robots.txt file to your site. This can be used to tell robots to not index things inside your cgi directories. Generally, they don't by default, but sometimes, they will, and will hose your server with an unintentional DOS attack! Here's the file. It goes into your document root.

User-agent: *
Disallow: /cgi/

That should do it!

These tips can be applied with some care to other Wikis in other languages.

(Yes, this degrades performance significantly!)

Medion Laptop Power Socket Repair

The power socket broke due to age, being bumped around, and so forth. To inspect it, I took the computer apart, storing the screws in a little plastic bag. I measured the socket, identified all its pins, and searched for parts on Mouser, DigiKey, and Jameco. None had it.

So, I figured a possible fix would be to purchase an adapter or plug with a barrel connector, and cut it off. I went to ITC and found an adapter cord that fit, and it cost < $3. Cheap.

It turned out to have the wrong diameter for the pin in the middle. It was too small. I would not discover this until much later.

I let the project languish for a couple months, but eventually got around to it. I first tried to desolder the broken power socket. That didn't work at all, so I eventually tore it off with pliers. Tear it off carefully.

This should leave holes into which you can solder wires. I did not do this. Instead, I cut the end off the adapter cord, and stripped it, and then soldered it onto the board. This failed because the wires overheated when I put them in, and the insulation melted.

I had to remove the plug, and did... but ended up filling the through-holes. I tried to remove the solder with a braid, mostly unsucessfully. Eventually, I managed to push a paper clip through one hole (by melting the solder and pushing from below). The other pads were ground, so I decided to "surface mount" the ground wire onto those.

I stripped off more wire from the adapter cord, and pushed the "pin" or "tip" connector wire into the hole. Then I folded the strands down to hold it in place, flipped the board over, and soldered from the underside. I flow-soldered, putting the iron to the wire, heating the wire, and then melting the solder into the hot wire. The solder flowed through the wire quickly. Once filled, removed the iron and let it cool.

Then I arranged the ground wire, which was already stripped, by twisting it into a cord, and pushing the cord to fit the solder pads on the underside of the board. I flow-soldered them, making sure to get solder hot onto the pads.

I measured continuity and resistance. There is some resistance, about 100 ohms, between the + and ground, but it could still cause the continuity tester to beep quietly. To test the connections, listen for the loud beep.

The moment of truth was when I plugged it all together, and tried to power the laptop. It failed. Then I realized I needed to add the battery. That failed.

It turned out there was no continuity between the center pin and the board.

I eventually settled on shoving a small bit of solder-encrusted copper wire, flattened out a bit, jammed into the hole of the power adapter's plug. This helped the tip make contact, and the system functioned.

I then reassembled the system. But before screwing everything together, I cleaned off the dried thermal grease from the CPU, and added new thermal grease.

Reassembly took an hour, because I forgot which screws went where.

The only two issues I had were that I accidentally yanked the mousepad ribbon cable after reassembly - I wasn't going to reopen it for that because i like using a mouse instead. The other issue was the broken keyboard controller chip. It didn't work, so I just left they keyboard off. Now it's a computer with monitor and HD, that just needs keys and a mouse.

If I were going to do it again, I would have bought both ends of the plug. Then, I could replace the socket and also replace the plug on the power adapter, and be guaranteed a perfect fit.

(I just picked up a 17" LCD monitor from the street. It's missing the power adapter, and I suspect that's why it was dumped. So, to deal with this issue, it seems like I'll have to buy a set of power adapter plug and install matching plugs everywhere.)

Mencoder, mp3lame, xvid

These are just some notes on how I'm using mencoder. For some reason, my build (on an Ubuntu Hoary system) isn't going so easy.

To get mp3lame support, I had to get lame from their site, compile and install it, and then do the following:

# cd /usr/lib
# ln -s /usr/local/lib/libmp3lame.so.0 .
# cd /usr/include/
# ln -s /usr/local/include/lame lame

For whatever reasons, mencoder doesn't add an option in their configure script to specify where lame is located, so you have to link it into the main lib and include directories. (Optionally, I guess I could mess with the makefiles, but, lame is something other apps would like, too.)

Moving Your Linux Root Partition

I had a pretty fast IDE drive, but finally got a much faster SATA drive. I partitioned it with a large /home, and a smaller empty partition. The intention was to load the latest, new version of Ubuntu onto the empty partition on the SATA drive (and mounted as root), and retain the /home partition already on the SATA drive. Unfortunately, Ubuntu's installer would not install onto the empty partition without formatting both partitions. The installer will upgrade a system in-place; it'll reformat a new system; but it won't install into an empty partition, leaving the other partitions intact.

So, I had to move the root partition from the old IDE drive, to the new SATA drive. Specifically, the original setup was:

/dev/hdc3 /
/dev/hdc1 /home

After I got the SATA drive, it became:

/dev/hdc3 /
/dev/sda3 /home

My goal was:

/dev/sda1 /
/dev/sda3 /home/

This involves copying some files, and juggling the boot sequence a little bit, so that we creep toward the final goal.

So I had to copy hdc3 to sda1. Easier said than done, because the / contains special directories like /dev /sys and /boot.

Solution: Mount the new root under /mnt/newroot. Use cp -a to copy any non-special directories. Make the special directories (dev, sys, proc, home). Use ln -s to make the special symlinks for initrd* and vmlinuz*

Then, go into /boot/grub, and edit the menu.lst and add a configuration to boot from this new partition. Place it after the first menu item. It will look something like this:

title		Ubuntu, kernel 2.6.15-28-amd64-generic on sda1
root		(hd1,0)
kernel		(hd1,0)/boot/vmlinuz-2.6.15-28-amd64-generic root=/dev/hdc3 ro quiet splash
initrd		(hd1,0)/boot/initrd.img-2.6.15-28-amd64-generic
savedefault
boot

(hd1,0) refers to /dev/sda1 in grub notation.

Also, you will probably have to alter device.map to look like this:

(hd0)   /dev/hdc
(hd1)   /dev/sda

That just means all references to hd0 really map to hdc, and hd1 maps to sda.

This mapping compensates for the fact that bios boot order affects these values.

Once all this is done, run grub-install to put the bootloader on the disk:

sudo grub-install /dev/hdc

You'll probably specify /dev/hda instead of hdc.

Reboot, and try to load the kernel from the new partition. If it works, you know you can boot this copy of the kernel, and use the same old root file system. The next goal is to mount the new root file system. So edit the menu.lst to mount the sda1 partition as root:

title		Ubuntu, kernel 2.6.15-28-amd64-generic on sda1
root		(hd1,0)
kernel		(hd1,0)/boot/vmlinuz-2.6.15-28-amd64-generic root=/dev/sda1 ro quiet splash
initrd		(hd1,0)/boot/initrd.img-2.6.15-28-amd64-generic
savedefault
boot

Then do sudo grub-install /dev/hdc.

Before rebooting, mount /dev/sda1 to someplace like /mnt/sda1. Edit /mnt/sda1/etc/fstab.

fstab will contain the old mount points. Edit them so that /mnt/sda1 mounts on /.

Reboot. On this reboot, it should still load the MBR from hdc. Go into the grub menu, and pick the customized configuration.

If it boots, and then mounts /dev/sda1 as /, good. You can take it to the next step, by booting directly from sda.

Go into /boot/grub. Note that this is on /mnt/sda1, so the files will be the old versions (that you copied from the orignal disk to the new disk, up near the first step above).

First edit device.map so everything's flipped around, and hd0 is /dev/sda.

(hd0)   /dev/sda
(hd1)   /dev/hdc

Edit menu.lst, changing references to the old root (hdc3) to the new root (sda1).

Make sure grub references to the root are (hd0,0).

Run sudo grub-install /dev/sda

(At this point, I'm not going to bother with setting up an alternate boot on the old partition.)

Before rebooting, make sure you have some kind of bootable rescue disk. An ubuntu live cd is adequate.

Reboot.

Press DEL to get into the BIOS setup menu. Once in, disable the IDE hard drive, but leave the SATA drive enabled. This will prevent the old IDE drive from booting.

Let it boot, and go into the grub menu. You should see that the customized boot config, above, is absent. That's because you're not booting into the new partition, which lacks it.

Pick the first kernel, and boot. If it works, you're home free. You can now shut down and remove the old IDE drive. (And then, later, install the latest Ubuntu.)

Multiplication Table

x 0 1 2 3 4 5 6 7 8 9 10 11 12
0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 2 3 4 5 6 7 8 9 10 11 12
2 0 2 4 6 8 10 12 14 16 18 20 22 24
3 0 3 6 9 12 15 18 21 24 27 30 33 36
4 0 4 8 12 16 20 24 28 32 36 40 44 48
5 0 5 10 15 20 25 30 35 40 45 50 55 60
6 0 6 12 18 24 30 36 42 48 54 60 66 72
7 0 7 14 21 28 35 42 49 56 63 70 77 84
8 0 8 16 24 32 40 48 56 64 72 80 88 96
9 0 9 18 27 36 45 54 63 72 81 90 99 108
10 0 10 20 30 40 50 60 70 80 90 100 110 120
11 0 11 22 33 44 55 66 77 88 99 110 121 132
12 0 12 24 36 48 60 72 84 96 108 120 132 144
(I'm just wondering if this turns up in search engines.)

OSX Postgres Tip

Don't make the postgres user in the Users control panel. Just copy the www user from within NetInfo? manager. Also, you should create a postgres group for this user, and put it in that group.

It's nice to have it boot up to Postgres. You put the startup items into /Library/StartupItems?.

%mkdir POSTGRES
%cd POSTGRES
%cat > POSTGRES
#!/bin/sh
. /etc/rc.common
echo "Postgres : " ${POSTGRES}
if [ "${POSTGRES}" = "-YES-" ]; then
ConsoleMessage? "Starting Postgres Database Server"
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data > /var/log/postgres 2>&1 &
fi
%cat > StartupParameters?.plist
{
Description = "postgres database server";
Provides = ("POSTGRES");
OrderPreference? = "None";
Messages =
{
start = "Starting postgres server";
stop = "Stopping postgres server";
};
}

That's it, pretty much. Delete leading spaces. If it's too cryptic, maybe you should not be running postgres quite yet.

OpenWRT Router IP Exposure Script

If you have an OpenWRT router (any router that can run the software can be converted), you can do a little quasi-dynamic-DNS trick. This is useful if you don't really care enough to set up Dyn DNS, and you have a web server setup.

The main disadvantage is that you don't have a DNS record. The main advantage is that the updates don't need to propagate through DNS, so if you have an app that relies on talking to your LAN, you can quickly detect any changes.

First, save this as /usr/bin/checkmyip

#!/bin/sh

past_ip="first"
[ -f /tmp/myip ] &current_ip=`ifconfig | grep P-t-P | tr ':' ' ' | awk '{print $3;}'`

if [ ${past_ip} != ${current_ip} ] ; then
exec wget -q -O /tmp/myip.html http://yourdomain.com/networkname/wrt.php?ip=${current_ip} 2>&1 &
echo ${current_ip} > /tmp/myip
rm /tmp/myip.html
fi

Then add it to your cron via crontab -e. Run it every 15 minutes, or more often.

Add this to your web server, in its own directory, as wrt.php:

<?php
$ip = $_GET['ip'];
$current_ip = escapeshellcmd("$ip");
system("echo $current_ip > current_ip");
system("echo Changed on: `date` >> current_ip");
?>

Yes, not that efficient.

OpenWRT WDS Configuration with Webif

This document isn't really done. The part about the MAC addresses should have been left out. I didn't describe at all how to set up the Wifi parts. (For Wifi, make all the settings the same on all APs.)

This is a simple description of configuring OpenWRT with Webif (web interface) to use WDS. WDS is a simplified way to create a bridged network of many access points that use a single access point to route to the internet.

Setting up a WDS network is simpler than setting up a routed network or a bridged network, and has the advantage of being very easy to extend (by adding more access points). All nodes connected via WiFi or ethernet appear to be on the same network.

The network being set up consists of two access points. Both are running OpenWRT WhiteRussian RC5. That distro comes with the simple webif web-based config tool. You should reflash each of your APs with this software, for consistency. If you can, clear the NVRAM too, because the bridged interface must be enabled.

Connect your computer's ethernet to port 1 of the "remote" access point that won't be directly connected to the internet. In this example, I've named that AP "phobos". The AP connected to the internet is called "mars". (Phobos is a satellite of Mars.)

First, go into the system info and get the MAC address of the AP. Save it somewhere.


Next, go into the LAN configuration and change the IP address. Every AP should have a unique IP address (otherwise, you won't be able to configure them -- though the routing may still work).


Save the settings, and then activate them. The AP should no longer be accessible via the old URL. Type in the new IP address into your browser to continue configuration.


Set the WDS setting to Enabled. Then, save and activate this as well. You may need to turn the router on and off (or ssh in, and reboot it).

Once that's done, disconnect the ethernet cable from "phobos" and connect it to "mars", the AP that's on the Internet. Go into it's administration interface (http://192.168.1.1) and turn on WDS. Add the MAC address, which you saved before, into the allowed MAC addresses.

Set the Filtered mode to Enabled.


Save and activate. The network should now work. You may need to reboot this AP too.

Connect your ethernet to "phobos" again, and try to access the internet. It should work. If not, try rebooting the access point again.

Once you've done all this, you have a semi-private WDS network. Nothing is encrypted, and the network is open to everyone, but, your access point will restrict other WDS access points from extending the network.

To make the network totally open, so APs can be added without restriction, set the Filtered Mode to Disabled.

Disabling DHCP and the Firewall

You need to disable the DHCP server and the Firewall on the AP not connected to the internet. This way, only one router is providing DHCP and firewalling to the LAN.

I don't have a web-based way to do this (that I trust) so here's the difficult way:

ssh root@192.168.1.2
rm /etc/init.d/S50dnsmasq
rm /etc/init.d/S45firewall

(A web based method might be to remove the dnsmaq and iptables packages... but that might cause the router to stop working.)

If you don't disable dnsmasq, it'll do DHCP on the LAN, which would cause your computer to use 192.168.1.2 as it's DNS server. It should be using 192.168.1.1. It could also cause some problems when two DHCPs are competing to give an IP address to an interface that's being initalized.

AttachmentSize
1.png39.94 KB
2.png56.46 KB
4.png55.75 KB
5.png59.07 KB

OpenWRT with WDS, Kamikaze

I'm trying to get WDS working between an WRT54GL running OpenWRT, and a Motorola WR850G running stock firmware.

There's lots of info on this page.

The main difficulty I'm having is with the totally different interfaces on the two routers.

According to the openwrt.org forum, you need to run the 2.4 kernel with the proprietary Broadcom drivers. The 2.6 kernel uses the free drivers, but they don't yet do WDS.

Write down the MAC address of the WiFi interfaces for each router. That MAC is not the one on the bottom of the router. (That's the MAC for the WAN port, which the ISP may need.)

PNG Colors are Wrong in Firefox (and how to deal with non-sRGB wide gamut monitors at work)

I created a PNG that was bright red, but in Firefox, it is a duller red. The fix was to remove the color profile from the PNG by using the tool TweakPNG.

What happened was that the PNG was created in the sRGB colorspace, but the system is running with a color profile for the monitor. Nowadays, most monitors are sRGB, so there's no problem. Nicer monitors with wider gamut, however, are calibrated with their own profile. Firefox will do color adjustments to make the colors accurate. Unfortunately, that means going duller.

I believe that when monitors had a narrower gamut than sRGB, color correction resulted in brighter or more contrasty colors.

Anyway, whatever. The strategy for HTML is to edit the image in sRGB, and strip the color profile out. Do this only when it's critical to match the CSS colors with the image. Don't do it for photos.

Nice Monitors for Graphics Staff

Also, there's the issue of setting your monitor. (I get to use a nice Dell U2410.) I'm still learning this, but here is what I'm doing. If you do graphics for work, you need at least an sRGB monitor, and preferably a better one that has 100% coverage of sRGB. It's worth it. You set it to the sRGB preset, download color profiles from TFT Central, and load those profiles into Color Management. Log out, log in, and the new settings should apply everywhere. The monitor will look worse than it did before, unfortunately.

If you compare this sRGB mode image to a low-end monitor, it'll look pretty similarly washed out. That's what you want - you want to edit your photos to look good within the limitations of the average monitor. But you need the nice monitor so at least you'll be editing toward an accepted colorspace.

If you do print work, you will need to switch to wide gamut mode (standard mode) on both the monitor and in Windows, then log out and log in to be sure all apps notice the change. It's not hard, but requires two settings changes.

If you stay in sRGB, and use the color profile, the colors will basically be accurate - but the preview will have less color detail.

Nice Monitors for Others

If a user isn't only looking at images for average computer LCDs, but also viewing content for print, television, etc. they'll need a decent preview monitor with wider-than-typical gamut. The low-end monitors in this class are the U2410 and Asus ProArt. At the same time, unless this is a tech or accounting company that's really into graphics, juggling monitor settings, color profiles, and software settings isn't going to be feasible. So, for these people, set the monitor to its wide-gamut default. It will tend to look "bright", but that's tolerable after a while.

Print and video files will come with correct color spaces (we hope), and the color management between the monitor and the printer should be correct. Web files will be sRGB - and will wash out a bit - but because we strip sRGB profiles for our own files, they'll show up bright. Stuff in Flash is not color corrected. Video? I don't know. Overall, though, you'll get two effects - correct color for print (which matters), and bright or even unrealistic color on the web, and no color mismatches on your own site. There may be color mismatches on other sites.

If accuracy for print doesn't matter, just get current sRGB monitors. They'll look better than the older monitors, and are much cheaper than preview monitors, and don't have the risk of website colors screwing up. Just know that these aren't good for previewing print materials.

Pine On Osx

Despite my increasing like of Apple's Mail, I've gone "back to the future" and started using PINE. (I was always an ELM user, but PINE has much better features.) These are some notes.

Using mac.com email addresses

Mac.com is an IMAP mail service. Since I am using it, that's what I cover, for the most part. I'll hit up the POP mailboxes later.

Setting up IMAP is pretty easy, but not well documented. First, just register with iTools and get a mailbox. Then, quit Mail, and fire up PINE.

Press S to enter the setup. Press C to enter the configs. Scroll down to inbox-path (around the 5th setting) Press return and type in:

{mail.mac.com/user=wildgift}INBOX

Substitute your email name for wildgift.

You should also set up the smtp-server, personal-name, and user-domain. These will allow you to send mail.

Press e to exit this setting. Press y to confirm. Then press q to quit (and y to confirm).

Restart PINE, and you'll be asked for a password. You'll get logged in, and can access your inbox.

Symlink your existing email boxes

You'll want to symlink in some of your existing folders. To get at the emails, you symlink to the files named ~/Library/Mail/Mailboxes/(*).mbox/mbox

The links will go into ~/mail/ and will show up in PINE.

What I did was create this script to do the linking:
#! /bin/sh
# file name is makelink
BOX=$1
ln -s ~/Library/Mail/Mailboxes/${BOX}.mbox/mbox ${BOX}

You use it like this:
sh makelink personal

That links the mailbox personal into PINE.

You can deal with mailboxes in folders by doing an mkdir foldername and then sh makelink foldername/mailbox.

Once this is done, you need to fire up Mail, and then go into each of the linked mailboxes. Mail will begin indexing the emails, and you'll have to wait until they're all indexed (click on the spinner for a progress window). Indexing causes the emails to be copied into the mbox files from a holding mailbox named Incoming_Messages.

Also, while you have Mail open, disable the mac.com account. That way, if you start up Mail, you won't accidentally download (and filter) the mail.

Once done, you should avoid starting up Mail, especially when PINE is running.

More Pine Notes

It's a pain to use folders in PINE, so you end up deleting more and saving into archives. This is totally okay, because you'll tend to file messages immediate rather than allowing them to collect in the INBOX. (I hope!)

You have to type the mailbox names, so it's a good idea to rename hard-to-type file names.

I run PINE from a script that also performs a backup of all the altered folders in Library/Mail/Mailboxes. This is pretty paranoid, but, I'm afraid of losing mail switching between PINE and Mail.

#!/bin/sh
/usr/bin/pine
cd ~/Library/Mail/Mailboxes
find . -name mbox -newer /tmp/pinetimer -exec zip -u \
~/backups/mboxes-`date +%h-%m-%H-%M`.zip {} \;

There are a few things to note here, for script writing newbies.

Line 1 - tells the OS that this text file is to be run through /bin/sh, the command shell scripting language. Line 2 - when you run pine, you want to run a specific copy of pine - /usr/bin/pine. If you don't do this, and you name this script 'pine', you could end up running the script itself (over and over!) Line 3 - you need to cd for the next command. Line 4 - the find command examines a file system. Do a "man find" for more info. The -exec parameter runs a command on found files.

Umm - why did I switch? It's an experiment to see if I'll write shorter emails (and spend less time writing them).

Pizza

Pizza is not hard to make.

Dough:

In a large bowl, dissolve 1 packet of yeast in 1.5 cups of water. To dissolve it, let it sit 10 minutes.

Add 1 to 2 cups of all purpose or bread flour, and a pinch (1/8 tsp) of salt. Stir with a fork to mix. Cover with a plastic bag. A clean grocery bag is perfect.

Let the dough sponge form over 1 day (24 hours or so). It's ready when it smells a little funky, like beer.

The dough will be gooey. Add a half cup of flour and mix it in with your hand. If the mess is too sticky, add more flour. You can add a lot. The point is to get a big, soft ball of dough. Then, flour the counter or a cutting board, and plop the ball of dough out onto it. Knead it around 10 to 30 times, dusting it with flour to add the flour to the dough. The texture should change.

The longer you knead it, the harder it gets. Let the dough sit for an hour or so. It'll "relax" and become more pliable.

Roll the dough into a round flat pizza. If you want it thin, roll it thinner.

Let the dough sit, covered with plastic or a pan, for an hour or two. It'll rise again, forming big bubbles that taste good.

There's your crust. You may bake the crust a little bit before putting toppings on it. Bake it in a 500 degree F oven.

Put the crust on a baking sheet, or, better, on a pizza pan with holes in it.

To make a fancy pizza, don't use sauce.

With a spoon, spread olive oil onto the pizza.

Slice tomatoes thin, and layer them onto the pizza. If you want onions, do the same. If you want garlic, crush it and add it. Sprinkle dried herbs on this, if you want.

Shred mozzarella cheese over the tomatoes. You can go thick or thin. Thick will hold heat better but lead to a soggier pizza.

Bake in a 500 F oven for around 15 minutes. Check to make sure it's cooking.

When it looks done, turn off the heat.

If you want the cheese to be browned, put it in the broiler for around 30 seconds to one minute.

Polish Steel (and Chrome) with Aluminum Foil

Here's an awesome tip from WikiPedia's page about Aluminium foil:

A simple and inexpensive way to remove rust from and polish steel surfaces by hand is to rub it with aluminium foil dipped in water. The aluminium foil is softer than steel, and will not scratch the surface. As heat is generated by rubbing friction, the aluminium will oxidize to produce aluminium oxide. Aluminium has a higher reduction potential than iron, and will therefore leach oxygen atoms away from any rust on the steel surface. Aluminium oxide is harder than steel, and the microscopic grains of aluminium oxide produced creates a fine metal polishing compound that smooths the steel surface to a bright shine.

Printing MSDN (or other) Pages on Linux

I had trouble printing some MSDN (Microsoft Developer Network) pages from Firefox on Linux, and also from Konqueror on Linux. Konq was a little better, but still cut off the edges. The solution was to go to the "printer friendly" version of the page, and copy and paste the entire text into OpenOffice2 Writer. To fit more words per page, go into the Styles and set the Body Text to 10.5 pt.

This is just a way to say: printing web pages sucks.

Quick Fix for Subversion Locales

Had a problem with svn.

error: cannot set LC_ALL locale

Fix was

unset LANG
unset LC_ALL

It probably causes svn to use a default locale (English), rather than try to use en_US.

Rediscover The Windows Cd Key

You've already installed Win95 and you need to reinstall, but you've lost the CD KEY. What do you do? You've tried finding a key on the web, but it doesn't ever work. You've asked around for CD Keys and they don't work either. Life sucks.

The answer is on your hard disk -- if you haven't formatted it. You need a boot disk to start with. Hopefully, you have one. If not, make one, and then copy onto it, the files REGEDIT.EXE and EDIT.COM.

You will use Regedit to dump the registry to a text file. You will use Edit to search it for the key.

First, reboot the system into a command prompt. Then, tell Regedit to dump the registry:

regedit /R:C:windowuser.dat /L:C:windowssystem.dat dump.txt

That tells Regedit to use the specified registry files and dump it to the text file dump.txt. Now open dump.txt in Edit:

a:edit.com dump.txt

And do a search for the word "ProductID". It might take a few tries, but eventually, you'll hit upon a block of Win95 related data. Lo and behold, there's your CD Key! Write it down, and reinstall.

Reducing PC Noise Inexpensively

After several years of this very loud PC, and a few months of using these fancy new PCs that are quiet, the whine of the old PC was getting to me. (The quiet PC in question is a Compaq with a Celeron in it. Model number unknown. Also, the Mac Mini is very quiet.)

After doing some research, it looked like the cause of the noise was a combined result of loud computer parts: the power supply fan, the fan on the CPU, the fan on the graphics card, and the hard drives. The solution offered by websites was to replace each with quieter parts.


I came up with a simpler solution: install "sound deadening" material into the case. What I used was a sheet of regular bubble wrap, and a few pieces of shipping tape to hold it in place. This was installed into the inner panel of the case.


This material, like all sound-killing material, operates by converting high frequency sounds like the whining of hard drives and fans, into a lower frequency rumble. The irregular surface of the material also reflects the sound back into the case, where it bounces around a bit, turning into "white noise". Reflected energy is also dissipated from other sides of the computer.


The computer is now somewhat quieter.


The other main strategy I can envision is to replace the three disk drives with a single drive that is quieter.

Repairing Scratched CDs

TOOTHPASTE WORKS: Use colgate total.

These notes are about reparing CDs and DVDs. This is a project in progress, so don't do anything I describe here. Just consider it research results that you can use to try and fix your CDs. Also, check out CdRisks, to read a few notes about the dangers of CDR.

I got most of these ideas from CD Faq by Sam Goldwasser [1]

experiment 1: toothpaste Buffed the CD surface with toothpaste. Crest gel is highly abrasive, and completely unacceptable. Regular AquaFresh? is better, but leaves a pronounced haze. The paste washes clean under water.

experiment 2: video head cleaner Rubbed a scratched surface with this alcohol based solution. It had no effect. Rubbing it with chamois cloth introduced scratches, as there was probably dirt on the cloth.

experiment 3: heat Passed the surface over an open gas flame. The CD, surprisingly enough, is very heat resistant and does not catch fire. It takes around 30 seconds before visibly warping. The surface smooths down somewhat, but the CD appears to warp and buckle slightly. Scuff marks (from the toothpaste) felt less "scratchy", but deeper scratches were unaffected.

experiment 4: talcum powder Used a generic talc with cornstarch and baking soda. Mixed powder with some water to form a paste. Mild rubbing had no effect, but vigorous rubbing left a slight haze. This looked promising.

experiment 5: plastic eraser Used a "plastic eraser" -- the white kind, not the pink kind -- to buff down the surface. The eraser left a pronounced haze with no visible scraches. It seemed to reduce the scratches somewhat, but the haze is very prominent. I think it contains very tiny abrasives, and deposits matter on the surface.

experiment 6: scratched CD Intentionally scratched a CD-R of music with a needle until it would skip tracks reliably. Tried to buff the scratches away with toothpaste (which I thought was not very abrasive). Did not work.

experiment 6: buffing wheel Used a handdrill buffing wheel to buff the CD surface (of another CD-R, not the music CD-R.) The buffing scratched the surface considerably, but also reduced the scratches that were on the CD. I tried to put some toothpaste on the surface, and then use the wheel on it. The scratching increased.

Toothpaste, it turns out, is extremely abrasive and cannot be used as a rubbing compound on CDs. I cleaned the wheel a little bit by rubbing it on a surface, then applied the white stick of rubbing compound (which I think is called Tripoli). I buffed the CD again. This time, the scratching was far less pronounced, and was more of a haze than scratching. It looks like residual buffing compound from previous use was scratching the surface. A clean wheel would probably solve this problem.

The residue from buffing can be cleaned with a little 409 or similar degreaser. Apply a little with your finger, and rinse under running water.

I applied more white compound, and buffed the music CD-R. After around 30 seconds of buffing, the CD warmed up, so I paused, and then buffed again. A total of 90 seconds of buffing seemed to reduce the scratching significantly. I stopped, removed the compound, and tried to play the CD in a cheap player. It succeded.

I believe that another minute of buffing would have rendered the scraches nearly invisible, or at least indistinguishable in the haze. I believe that a thin coat of plastic would be able to "clean up" the scuffing from buffing.

Experiment 7: CD Repair Kit Memorex CD Repair kit, purchased at store for $15. Contains a compound that fills in scratches, and another to polish the surface. I applied this to the CD that had been repaired. It filled in the scratch a little bit, but not so much that it could not be detected if you're looking for it. The polishing spray made the surface more reflective, thus making it harder to see the scuffing.

Planned experiments Please, add any experiments you'd like to suggest by clicking on EditLinks? at the bottom of the page, and adding your comments.' Here are some ideas for experiments.

Ways to grind down the surface to eliminate scratches: Vary the abrasiveness of the tripoli. Use a wet solution of talc. Use a wet soluton of talc and alcohol.

Ways to remove the scuffing: Furniture wax. Car wax. Future acrylic floor polish. Glass polish. Miscellaneous solvents, to melt the surface. Rain X (acrylic glass polish). Denatured alcohol. Hair polish/shine enhancer (like Frizz Ease).

Notes: The best way to test the scratching is with your fingernail. The toothpase, eraser, and buffing wheel produced tangibly different scuffing of the surface.

I tried a lighter flame on the scuffing, and it smoothed it out, but didn't have much visual effect.

The polycarbonate used to make CDs is not a regular plastic. That is, it is not soft, like vinyl, and probably will fail to dissolve in my solvent experiments.

The scuffing on the surface doesn't seem to affect audio CDs. I don't know if this is true for data CDs.

Restarting WiFi on OpenWRT if the Link Goes Away

I put my WRT54G into a noisy electrical environment, and it seems to cause the wifi to fade out a couple times a week, sometimes permanently. (I did this after using a USB adapter on Windows proved too unstable.)

After some experimentation, this script below seems to do a reasonable job of keeping it up. Save it, and put it into the crontab. (You have to install the crond package.) The gateway is at 192.168.1.254.

#! /bin/sh

# Checks if the wifi conn is up.  If not, it tries to restart
# the wifi.  If that fails, then reboot.

if ping -c 1 192.168.1.254 > /dev/null
then
        echo nothing > /dev/null
else
        ifdown wifi
        ifup wifi
        killall wifi
        wifi
        /etc/init.d/S41wpa
        sleep 30
        if ping -c 192.168.1.254 > /dev/null
        then
                echo nothing > /dev/null
        else
                date >> /reboot.log
                reboot
        fi
fi

(Note that the date in reboot log will be the same, because the clock is not set right after booting.)

SSL Setup Tips

A short list of things to make purchasing an SSL cert easier.

1. Check your domain registration and make sure the Registrant and Administrative Contact will match the party that will purchase the SSL cert. Just to be safe, make sure the address matches the billing address of the credit card you will use. Changes may take a while, and may require email verification.

2. Decide on which domain name you want to associate with the cert.

3. In the DNS, make sure the IP address of the server matches the domain. Changes may take a day to propagage.

4. Make sure you know how to generate a certificate request (a CSR).

5. Make sure your web server is configured correctly. Use a CACert.org or self-signed certificate to test.

6. Make sure you can copy data from your web browser up to the server. Best way is to use SSH. You may want to be in a secure chat with the admins over at the web host.

When you purchase the cert, the SSL seller should be comparing your entered information with the WHOIS information. The critical part is the domain, of course, but I suspect it's checking other fields, like name and phone number.

Go through the process of getting a cert. Go to your email and do whatever it takes to push the process forward.

Saving Money at the Grocery Store

This was posted to Wise Bread, and reposted here:

Pick around a dozen key purchases of (relatively) nonperishable items like canned goods, dried pasta, some grains, sauces, frozen items, etc. Know the prices. When you see a price drop, stock up.

Then, over the course of the next few months, eat through the stock.

The weekly shopping trip should focus on getting the fresh foods that can spoil. Buy in season, and on sale. During the summer, eat mostly fresh, but stock up. During the winter, eat through your stock.

During the winter, add chiles to your diet. The extra spice will make the food taste better. Just buy two or three serranos or jalapenos, and add a couple slices to your cooking.

Buy junk food at the dollar store, or the Big Lots. There, you can get things for a dollar.

Shop at the bag-it-yourself stores in working class neighborhoods. They often have lower prices on most items. (Again, don't assume they're cheaper across the board.) Check to make sure the vegetables are okay. Unfortunately, in some stores, they are not that good; but at others, they're fine. (They may also double as ethnic markets, described below.)

If there's a spice rack with bagged spices, the prices are much lower than the bottled spices. Usually, an ounce of spice is around 70 cents.

People in big cities can shop at ethnic markets. Asian markets tend to have the lowest prices on vegetables. Watch out, though. They buy food that's riper, and won't last as long in the fridge. So you have to eat it soon. The 50 cent lettuce isn't a good deal if it rots. The $1.50 small bok choy is a great deal: I could eat the whole bag in one day.

Ethnic markets also have much better prices on sauces, breads, spices, and the like. The local supermarket has pita bread for over $2 a bag, but the Armenian market has it for under $1. Oyster sauce at the super was nearly $5, but at the Asian market, it was $2. A "specialty item" in a mainstream store is a common item at an ethnic store. (The reverse is also true!)

Learn to make dishes that use leftovers: sandwiches, fried rice, ramen, soups, small pot pies, scrambled eggs, burritos. Keep the starches like bread, rice, pasta, and tortillas on hand, and make the filling or soups with the chopped up leftovers. Learn to make some extra food for dinner so you'll be able to make these dishes for lunch.

Phil Brewer had a great article about shopping as a kind of investment. It's true. If you spend, say, $2,500 on food each year, and can shave off 10% of the cost, you've just "made money" - saved $250. That's equivalent to earning 11% on a 1-year CD valued at $2250.

Last I checked, there was no such thing as a 11%, 1 year CD.

Screen Printing

Hi, I want to screen print tee shirts @ home as an earning hobby. I do the designs on photoshop - can u tell me the easiest and cheapest way of going around this ?

Okay, I'm not a pro, and I've only screened a few times, but here's how you do it. Materials cost around $40 to start. (I'll take photos if I ever do this again.)

Materials - you can get them from an art supply shop:
1 Frame and Screen ($12)
1 Black Fabric Ink ($4)
1 Squeegee that fits the frame ($8)
1 Boxed kit of photosensitive emulsion ($15)
1 Sheet tracing paper
1 piece of clean glass or plastic that can fit in the screen and cover most of the area
1 sheet black construction paper that you'll use as backing on the screen during exposure

The popular brand for these things is Speedball. There are also beginners' kits that cost a little less. It's your call.

You'll need the following conditions. A fairly dark room with a dark cupboard, like a bathroom, where you'll dry the prepared screen. Daylight, to expose the screen. A high contrast black and white image, and either a photocopier or a laser printer.

First, you prepare your image and make a positive. What I did was, using a little "post it note" glue, adhered the top edge of the tracing paper to a thicker sheet of paper. This can be fed into a laser printer. If you don't do this, the paper will probably jam.

If you don't have a laser, you can use a photocopier. Just test it first to see if it'll feed the tracing paper.

If the image is light in spots, you can darken the positive with a sharpie or some india ink.

Next, you prepare the screen. You mix three teaspoons of the blue emulsion with one teaspoon of the activator, and stir well to mix it up (it'll be green). You should mix this in a disposable cup with a spoon you don't need.

Spoon a little of this across one edge of the screen, and using a cardboard edge, draw the emulsion down, filling the screen with the stuff. Repeat on both sides until the entire surface is covered with an even, green layer of emulsion. When you're done, double check to make sure there are no "holes" in the emulsion. (Fill those in!)

Put this in the cupboard in the dark room, and let it dry for around 30 minutes to an hour. (Turn the fan on, to speed drying.) Whatever you do, don't expose it to light.

When you're positioning the image, you have to work pretty fast, and in a dim light.

Take the prepared image, and cut it so it'll fit into the screen. Tape the black construction paper to the back of the screen. Put the image into the screen, using a little glue stick if necessary, and then put the glass on top. The glass holds the image down.

Now, you have to rush outside and put the screen in the sun, facing the sun. You need to expose it for around one minute. You'll see the color of the green change. Then, you need to carefully bring the whole thing in - don't move the glass or you'll expose new areas - into the bathroom.

Remove the black paper, the glass, and the image. You'll clearly see the image on the screen, as a pale green silhouette.

Turn the shower on, with cold water. Stick the screen under the shower. You'll see the pale green stuff go white and melt away, while the exposed emulsion resists the water.

If the image isn't flowing away easily, you can use a used toothbrush to gently scrub away the unwanted emulsion.

Look at a light through the screen, and ascertain what areas need to be cleaned up more. You can't neglect to do this.

Once the screen's washed, you just set it aside to dry, before printing.

Pulling screens is an art that you can learn only through experience. So, that first project should be scrap fabric, not your shirt.

First, you lay down a spoon of ink in a line, across the top edge. Then, using the squeegee, you "pull the ink across the screen." This first pass, don't have the screen down on the shirt. Rather, it should be raised a little. Your goal is to fill the screen with ink.

The second pass starts with putting the inked screen onto the shirt surface. Then, you pull the sqeegee down again, but this time, with a little force.

And, that's it!

You have to dry the shirt for around two hours.

To "set" the image, you have to iron it first to melt the inks a little. Don't be a fool - iron the backside of the surface, not the front side!

Thanks to Caroline for teaching me this.

Screen Scraping a Cel Phone Photo

This is a simple screen-scraper to pull an image from a cel-phone page. I guess when people send you a file, you can use this to download it, sorta. It appears to be for a canadian internet company.

There were a few roadbumps to success. First was finding the precise location where the photo's URL was. To find it, I went to the page, did a "view source", and then back to the page and "view image". Then, i did a search for parts of the URL within the source. It turned out the URL was in a bit of JavaScript (not in an IMG tag).

Plucking the URL out is simple. Copy the text surrounding the URL, then turn it into a regex. Escape all ( and ) characters. Escape the / and \. Escape the right quotes. Then turn the URL part into this: (.+?), and trail it with some predictable, unique text. Put / and / around it.

Next, prepare to get the page. It turns out that their app server checks the USER_AGENT, probably to deliver content to mobile devices or to determine what kind of script code to deliver. I wanted to act like Mozilla, so I found an appropriate string on the web.

Get the data, and match the file. If it bears fruit, load in the URL (prepending it with the path to the file), and save it out.


<?php
	// your url
	$pageName= "http://picturemessaging.rogers.com/share.do?invite=lEYrALTEREDh1U";
	// this matches the bit of code in the page with the image url
	$match = "/slideshowObjectInfo\(1, 'image','\/mmps\/RECIPIENT\/(.+?)'/";
	
	// this reads the url into a string
	ini_set('user_agent','Mozilla/5.001 (Windows NT5; N; x86; ja) Gecko/25250101 MegaCorpBrowser/1.0');
	
	$text = file_get_contents($pageName);
	// this tries to pull out the URL for the picture
	preg_match($match, $text, $matches);
	// this tries to pull down the picture
	if ($matches[1])
	{
		$image = file_get_contents('http://picturemessaging.rogers.com/mmps/RECIPIENT/'.html_entity_decode($matches[1]));
		file_put_contents( 'image.jpg', $image);
	}
?>

After a couple days, I did some more work on this spider.

Here's a new version of the script. It is a little bit better, and it tells you what it's doing. It works for the situation where it has to get the first image's large image, but it might fail if you have more than one photo. Then, you'll need something that can parse out different values in the javascript, and simulate the javascript url-generating code, to get the urls to follow.


<?php
$patterns = array(
    array(    'match' => "#viewLargeURL = '(.+?)slide=' \+ whichImg \+ '&pictureCount=' \+ pictureCount \+ '&fromMessage=#",
              'postProcess' => '',
              'linkPrefix' => 'http://picturemessaging.rogers.com',
           'linkSuffix' => 'slide=0&pictureCount=1&fromMessage=true',
              'fileName' => 'imagepage.txt' ),
    array(    'match' => "# '',
              'linkPrefix' => 'http://picturemessaging.rogers.com',
           'linkSuffix' => '',
              'fileName' => 'image.jpg' )
);
$startPageUrl= "http://picturemessaging.rogers.com/share.do?invite=lEYr42JXYkkCVY8zkh1U";

spider( $startPageUrl, $patterns );

function spider( $pageName, $patterns )
{
     ini_set('user_agent','Mozilla/5.001 (Windows NT5; N; x86; ja) Gecko/25250101 MegaCorpBrowser/1.0');

     echo 'getting: '.$pageName.'

'; $text = file_get_contents($pageName); foreach( $patterns as $rule ) { echo "matching ".htmlspecialchars($rule[match])."

"; preg_match($rule['match'], $text, $matches); if ($match = $matches[1]) { echo "match succeeded, found $match

"; if ($rule['postProcess']) $match = $rule['postProcess']($matches[1]); $url = $rule['linkPrefix'].$match.$rule['linkSuffix']; echo 'getting: '.$url.'

'; $text = file_get_contents($url); if ($rule['fileName']) file_put_contents( $rule['fileName'], $text); } else { echo "match failed

"; } } } ?>

Comments

The repetitious task of getting urls and following them was turned into a kind of "engine". Each step is, basically, like the last. The real difficulty in generalizing this will be the fact that the most important parts of the page are generated in JavaScript.

The correct way to handle this is to put the spider into a browser with JavaScript. That way, you can get the final output of the rendered page, and then spider the final output instead of code. Easier described than implemented, as usual:-).

Seasoning a Korean Stone Pot (Dol Sot)

These are used to make a scorched rice. Here's how I seasoned mine. First, wash and scrub with warm water, but no soap. Stone is porous and will take in the soap flavor, according to some sites. Some sites say to cook salt water in the bowl.

Put the bowl on a low flame to warm it up and evaporate the water. Using vegetable oil, coat the inside of the now-dry pot. Heat it for a while. Remove from heat, cool, and apply oil over every surface. Re-heat on the stove. Eventually, this didn't seem to work, because it left a sticky residue in some places.

Heating in an oven at 350F for a couple hours helped. The pot came out a dark gray, and no signs of stickyness. Also, the "cooked vegetable oil" odor declined. Presumably, the oil re-liquified, spread out, and hardened.

Test by oiling the inside, adding cooked rice, and cooking over a low flame for 15 minutes to see if the rice gets nice and brown.

Set UID C fragment

I'll be getting back to the regular code in a bit. For now, here's a tiny code fragment I'm using, now recorded here for posterity. I'm in a little shock - this is the only C code I use anymore.

Sometimes, you need to run a script as root. This is a little bit of C code that does that. The program compiles, and you chmod it to setuid, and chown it root.

#define SCRIPT "/usr/local/buildserver/setup_web"
main(argc, argv)
char **argv;
{
    setuid(0);
    seteuid(0);
    execv(SCRIPT, argv);
}

Yikes! I didn't know I still had old K&R C lying around. I thought that went out of fashion at the same time as Michael Jackson's "Bad" album.

The main() should be: main(int argc, char *argv[])

It's also uncool to pass argv to the script. Setuid proxies can filter the arguments so that the script exposes a limited interface to root. Maybe this library could help impose some order.

Why This Was Written

Normally, I write setuid scripts in perl[1], but had some problems working around PHP's path restrictions. Rather than reconfigure PHP to work with my script, I just compiled this setuid proxy, put it into the PHP docroot, and PHP had no complaints.

1. Setuid Perl scripts are safer than C programs through a dataflow tracing mechanism that prevents many stupid security holes. -- the perl man page.

Setting Up Many Windows Computers Quickly

How to set up a bunch of new computers for deployment to your staff. This page is under construction.

Using a USB key, build up the Offline Update boot disk.
See also: http://www.heise-online.co.uk/security/Do-it-yourself-Service-Pack--/fea...

I didn't make the USB key self-starting. Instead, I put the updater into a folder. Once the key is working, burn it to CDs - one CD per computer.

Take the computers and start them up. Then, insert the CD into each computer, and run the updater.

Once done, run Windows Update to install any updates that the offline updater didn't install. This will take a while - but less time than if you didn't run the offline updater.

If you really wish to reduce the time spent downloading, you should put the additional updates into the offline updater disc.

In Vista, the updates are installed from .msu files. This site: http://technobuff.wordpress.com/2008/07/22/what-is-an-msu-file/ has information about msu files, and how to extract them into cab files and xml files.

See also: http://windowsitpro.com/article/articleid/95608/how-can-i-extract-the-fi...
http://www.aeroxp.org/board/lofiversion/index.php?t8012.html

An alternative method is to use disk imaging. The most popular product is Norton Ghost. What you do is set up one computer, then build an image of the disk. This image is copied to all the other computers.

Setting Up Video for a Presentation or Meeting

Lately, I've become the guy who shows videos at the office. Somehow, it became part of my job to set up the video projector, and prepare a laptop computer to show a video (or presentation). It sounds easy enough, but, when it's a screening for a group of people, it actually becomes just a little bit technical. This document describes some pitfalls and how to avoid them.

Back when I was younger, the job of a projectionist at a movie theater never made sense. It seemed like they just loaded the film and pressed a button. It didn't seem very hard

I was being young, judgmental, and my thinking was foolish.

The real issue isn't whether it's easy or difficult to run the projector, because it's not really that hard. The trick is doing it over and over, for a large crowd of people, and not screwing it up. Chances are, if they didn't work at their job, they'd mess it up a couple times a week, and the theater would get a bad reputation, and lose money. On the other hand, if they did a good job, the audience wouldn't notice, and they'd be enthralled by the film (if it was any good).

So, take the task kind of seriously, even if it's just for a meeting.

The most important factor to repeatable success is time. Time allows you to prepare for the event. If it's a very critical presentation, allow more like 6 hours of lead time, just to be safe. Seriously. For simpler non-critical presentations, allow around 30 minutes to set up for a short, 10-minute video.

6 hours of lead time is what you need for a critical screening. Why? Because you might discover that one piece of equipment is broken or missing, and you need to find a rental or replacement, fast. In a big city, 6 hours is enough time to fix pretty much any SNAFU.

30 minutes is what it takes to set up the equipment, get a nice image, set the sound levels, and get everything ready to go. It might even take an hour.

Yes, it sounds excessive. Any “a-v club geek” can plug the parts together, and get a focused image in under 5 minutes, it's true... but said geek can also get things perfect in 30 minutes. It's just a question of whether they care, or not. Here are my steps:

  1. First, I run Windows Update, to get everything up-to-date. Then, I shut off Windows Update. That's so the computer doesn't start trying to install the updates when the video is playing. If this happens, DVDs skip, the video and audio lose synchronization, and sometimes the video will get jumpy.

  2. Next, if it's a DVD, I copy it to the hard disk, and find which VOB file(s) matter. If the whole video is in one VOB file, delete the other files. If the video spans VOB files, keep all the files so a DVD-oriented player like CyberLink PowerDVD can display the video. Moving the DVD to the hard disk reduces the risk of skipping.

  3. Test the file against Video LAN Client (VLC), my player of choice. Configure VLC so it'll always start playing in fullscreen mode. When it's set this way, double-clicking on the video file should bring up the player's controls, but won't start playing until you hit PLAY or the space bar. See the next section for info about how to cue up video with VLC.

    Set VLC so it gives itself a little extra CPU priority. Set the volume on VLC to the top. Then set the volume of the computer to the top, or near the top. (I believe audio engineers call this “unity”, and it refers to the sound level where there's least distortion.) Then, play the video and adjust the volume at the speakers (or the amplifier).

    Step to the back of the room to listen, then adjust the volume. You will have to boost the volume a little bit more, because bodies will soak up the sound. Don't let the sound distort. (At this point, you may get the sense that computer speakers might not be loud enough.)

    Doing audio properly is a real art, especially for crowds. When it's done right, you don't even notice it.

    By the way, if your setup has a microphone, use the Volume Control app to shut off the microphone.

  4. Adjust the video. Move the projector and screen if necessary. If you are projecting onto a whiteboard, use the cleaner to remove the gray gunk on the whiteboard. Adjust the colors on the projector as best you can, so you get the greatest range. Projector colors generally aren't very good, and it's better to preserve maximum range rather than maximize brightness. (Just like the way our perceptions will “correct” the color of Van Gogh's self-portrait, they'll correct for distortions in color.)

  5. If the video file is not associated with VLC, make it associated. Shift-Right-Click on the file icon, and select Open With... Then select VLC and check off the box to tell it to always open the file that way. This will help in an emergency situation where you need to restart the video.

  6. Make sure all the cables basically work. Don't twist them around, but, move them a bit to see if the connections are all solid. Do this while the movie is playing, so you can tell if the audio cables are broken. If cables are broken, replace them, but if you can't do that, you may need to use a little tape to hold things together. Make sure your electrical cords are long enough and nobody will trip on them.

  7. If you have an audio mixing board, set your levels and then put a piece of cloth over the board so people don't touch it.

  8. If you have house lights, you may want to figure out what combination of lights turned off makes the video visible, and then label the switches so you can flip off the right ones.

  9. Write instructions about how to start up the video, save as a README, and leave the window open on the computer. Open the folder that contains your video – and the folder should contain only that one video, so you don't make a mistake and click the wrong one. Set the computer's Power Options to cause the system to Suspend, but never Hibernate. Then, lock up the room and leave the setup there until the meeting starts.

Cueing up Video with Video LAN Client

For no particular reason, it's hard to cue up a video in computer video players. Most don't come with a built-in way to put up a blank screen, then transition to the video. A blank screen beats having the bright-blue Windows desktop on the screen.

One way to deal with this, in VLC, is to pause the video on a frame without much motion or a talking-head. Then, when it's time to play the video, press “p” to move to the “previous” video. This will cause the video to restart from the beginning.

What Gear Works?

The setup I'm dealing with is mostly old. The laptop's an IBM P4 mobile, around 1.6Ghz, but it has okay video output. A newer Mac generally has better video output. The portable LCD projectors I've used are a Dell, and Optoma, and an InFocus. They were all so-so in quality, but I haven't really seen any better, either. The speakers are Altec Lansings, which sound good. We also have little Harmon Kardons, which aren't that good. If I had my druthers, it would be nice to get a regular old solid state stereo and attach some decent speakers. People keep saying “Bose”. I like my old Infinitys and Polks. They all sound pretty good to me, these days.

DVD Flicks

This is a little last-minute note - there's a tool called DVD Flicks that turns videos into DVDs. I suspect this is an interface to Free dvd authoring software and Free transcoding software. It works well. You can burn computer videos to DVD, and run presentations off a DVD player.

Setting Up Win2000 for Reasonable Security

I had to set up Windows for my friend, after her first install of it (I did that install too) got trojaned heavily, loaded with adware, and probably some spyware. This was a standard install of Windows, with the usual easy-to-guess password.

Once upon a time, that was a reasonable install, but, no longer.

So, after running the antivirus and other crap, I decided to do a full reinstall. Here are the ingredients:

Windows 2000
Outpost Free Firewall
Knoppix on CD
Firefox browser
Thunderbird mail client
A fast internet connection

Put the Win2k CD in there, and fire up the setup.

First, you need to wipe the disk. Repartition it so that around 2 gigs are unused. Unless the disk is really old, the 2 gigs will be cheap insurance. This spare partition will be used if we need to boot into Knoppix and copy out data files to reformat the first partition. (There's a method to my madness.)

Second, complete the installation. When it comes time to set an Administrator password, use something weird, like: ii8aEV*. This throws off some worms that try to guess passwords.

Third, once you're set up, create another user, named User if you can't think of a name, and set the password to something weird. Make this a "Restricted" user. Don't log in as User; log in as Administrator for the rest of this recipe.

Fourth, connect to the Internet via a high speed connection. Run Windows Update from the Start menu. When it says restart, restart. Repeat until there are no more updates to install. Then, if you want, add a few more updates that sound relevant. (If you don't have a high speed connection, you'll have to get CDs with all the service packs and updates.)

Fifth, go to http://www.agnitum.com/products/outpost/ and get the Free version of their firewall. Install it. Reboot as requested. (Make sure you're Administrator when you install.)

Sixth, download Thunderbird and Firefox from http://mozilla.org. Install each application. We'll stop using Internet Explorer and Outlook Express. Go into the Internet control panel, and set your default browser to Firefox, and your default email to Thunderbird.

Then you can install any other software you need.

Seventh, write instructions about how to log in as User and Administrator. Explain that, to install software, you must be Administrator. When you're normally using the computer or Internet, you need to be User. User has fewer permissions, and cannot wipe out important files easily.

Then, log out, and log in as the User.

This seems to work pretty well. The firewall alerts the user to the various attacks coming from the Internet, highlighting exactly why it's important to maintain good passwords, to stay logged in as User rather than Administrator, and (if possible) to disconnect before logging in as Administrator.

Short SQL Tutorial

I was going to write a simple tutorial about SQL for people who know HTML and some programming. I found this other excellent tutorial, however, and scrapped my own.

http://www.hotwired.com/webmonkey/databases/tutorials/tutorial1.html

The article describes how to set up a server and database and create a real db driven website.

There are also a number of tutorials about SQL, which I'm sure I'll get linked in here eventually.

In the meantime, here's a very short description of some common SQL queries that might prove useful to bright HTML coders.

About Databases

The simplest database is a table, with columns and rows. In SQL lingo, we call these things columns and rows. (In other systems, they're called fields and records, but we're in SQL-land, so let's not confuse the issue by using alien terminology).

Here's an example of a table. In SQL lingo, a database is a collection of one or more tables.

TABLE: cream 

Generally, in SQL-land, you work with only one database at a time. You start using one database, and limit your accesses to the tables in that single database. You'll see why in the exaple SQL statements below.

But, before you can start typing statements, you need to get into MySQL and tell it what database to use. Here's a short transcript of a session. You can't use it verbatim, but you can study it:

system% mysql
mysql> use icecream;
Now using icecream
mysql>

Sample SQL statements:
SELECT email FROM cream;
SELECT name FROM cream WHERE ice_cream = 'marble fudge';
SELECT * FROM cream WHERE ice_cream = 'vanilla' OR ice_cream = 'cherry';
SELECT * FROM cream WHERE email LIKE '%cyberjava.com';
SELECT name FROM cream WHERE name LIKE '% K%';

Each SQL statement returns some rows. More specifically, each query returns a table composed of the results. Here's each statement, followed by the rows they return. 

SELECT email FROM cream;

johnk@cyberjava.com
fredf@hannabarbera.com
vamp@cyberjava.com
ralph@honeymooners.org

The statement returned a table composed of all the email addresses in cream. It returned only the emails because we wrote 'SELECT email'. 
SELECT name,email FROM cream WHERE ice_cream = 'marble fudge';

Fred Flintstone fredf@hannabarbera.com
Ralph Kramden ralph@honeymooners.org

The statement returned a table composed of rows where the column ice_cream contained 'marble fudge'. You use the 'WHERE' statement to specify matching criteria. It returned both the names and emails because we specified 'name,email'.

SELECT * FROM cream WHERE ice_cream = 'vanilla' OR ice_cream = 'cherry';

John Kawakami johnk@cyberjava.com vanilla
Theda Bara vamp@cyberjava.com cherry

This statement uses 'SELECT *' to return all the columns. It also uses the 'OR' keyword to match the two different flavors of ice cream. (There's also an AND statement as well as a NOT.) 
SELECT * FROM cream WHERE email LIKE '%cyberjava.com';

John Kawakami johnk@cyberjava.com vanilla
Theda Bara vamp@cyberjava.com cherry

This coincidentally returned the same table as the last statement. This time, though, we used the 'WHERE email LIKE' statement. The LIKE statement lets you specify partial matches. '%cyberjava.com' matches everything that ends in 'cyberjava.com'. The % works like the '*' in DOS. 
SELECT name FROM cream WHERE name LIKE '%Ã?K%';

John Kawakami
Ralph Kramden

This one's similar to the last, except is picks out the pattern '% K%', which, in this case, matches to everyone whose last name begins with a capital K. (Yes, you can use two %s.)



That's all for now. SQL is really a lot more powerful than this. You can use it to change data, as well as summarize it. With more complicated statements, you can write statements that selectively update or create records based on arbitrary criteria. You don't need to write programs to make these things happen.

Shredding Leaves for Compost or Leaf Mold

On numerous articles it's recommended that dried leaves be shredded to compost them more rapidly. The argument made is that it increases the surface area of the leaf.

That doesn't make sense. Most of the leaf's surface is flat, and chopping leaves only increases the surface area along the edges of the cuts.

If you stacked the pieces of a crumbled leaf into a column, the total surface area along the edge, if compressed, would still be only a fraction of the total surface area. Granted, it's still a lot more edge-surface than an unbroken leaf, which would have nearly no edge-surface compared to total surface.

I suspect that chopping leaves works for two reasons. One is that cutting a leaf exposes the cross-section of the leaf's capillary system. Water contacting the capillary system is more likely to enter the leaf.

Second is that when the leaf is chopped, water can more easily flow down through the compost pile. The flow of water washes bacterial or fungi from one area to another, spreading the organism into areas yet untouched.

Combine the capillary action with the spread of bacteria or fungi, and I tend to think that a dry leaf edge will actually draw in a little bit of the composting organism along with the water. The organism can then digest the bit of leaf "from within", protected from the open air.

Soapmaking

Soapmaking's been popular with the gourmet soap folks, but I was totally unaware. I learned about soapmaking from a Red Devil lye bottle back in the 80s, and always wanted to do it, but never did.

Today, Red Devil no longer makes pure lye, but the brand "Rooto" does. I got mine from Vermont Outlet, a True Value franchise. It was about $5 for a pound.

The soap recipes on the web used a lot of fat for 16 oz of lye, so I decided to use only half the jar - 8 oz - and scale recipes to fit. I figured I'd have the required fat for that. So I marked halfway down the bottle; you have to open it up and see where the top of the lye is, then go down halfway and mark it.

I made a mistake in scaling recipes, however. I converted ounces of fat to liters of fat. You can't do that -- fat weighs less than water, so volume conversions will not work. You end up with too much fat.

So I had a recipe that said to use (according to my bad calculations) 1.8 L of fat. I took my fat and simmered it a few seconds with water a bit to let the heavy stuff fall into the water. Then I strained it into a jar. I used the cut-off top of a 2-liter bottle as a funnel, and used coffee filters in it.

(At this point, most articles go into what fats to use. Things like "shea butter" and olive oil are popular. Being me, however, I used fat collected from cooking, so it was a mix of vegetable oil, chicken fat, bacon grease, maybe even beef fat. It was all pretty disgustingly rancid as well, because it was saved up in jars for months. The washing helps a little bit. Some articles said rancid fat would make acceptable, if smelly, soap.)

Cleaning fat is pretty easy. You ladle the warm fat into the filtered funnel, and wait. As you get to the bottom of the fat, and the top of the water, it'll get harder to keep the water out of the ladle (and the fat will be dirtier). To make it easier to separate, you can pour this blend into a glass cup. The fat will form a thicker layer, and you can pour most of the fat into your ladle, and transfer it to the funnel.

This picture shows the fat is a thick top layer. My oil got a little messed up because I put baking soda into the oil to clean it. I read a web page that said to use baking soda, and it didn't seem to help.

Be careful about temperatures. Don't let it get so hot you can't handle the cup or the pot.

This is a photo of the fat - almost 2 liters, but not quite.

The graduations on the side of the bucket were added by measuring water into the bucket, and marking the level. I did the same with this glass pitcher.

Next, I had to make the lye water. The recipe indicated around 0.8 liters of water, so I poured that much into the pitcher. The recipes generally call for distilled water, but I just used tap. Maybe that's a problem.

Then, I measured out a plate with 8oz (half the jar) of lye. I just kept pouring a little out until the level was where I marked it 8oz on the bottle. Both the lye plate and water jug were taken out to the porch, for mixing. The recipes call for good ventilation, and outdoors is great ventilation.

(Some soapmakers are real uptight about having a set of bowls and pitchers for soapmaking. I don't understand why they do this. Everything is non-porous and you can neutralize the lye with vinegar. Lye is sodium hydroxide - and we all eat sodium, hydrogen, and oxygen. Lye's used to make food, too. So why the paranoia?)

I poured a little bit of the lye in slowly, and mixed it with four disposable chopsticks held together like a whisk. The water got hot pretty quickly, so I let it cool down before adding a little more lye. This process took around 30 minutes, but the water never got too hot.

(Then, I took the plate to the kitchen and rinsed off the remaining lye bits. To neutralize any remaining lye, I poured vinegar over the plate.)

The hot pitcher lye water had to sit nearly an hour before it was cool enough to handle. I let it get to around 120 degrees F, and put it next to the fat bucket so it would transfer some heat. 120 F is almost "too hot to handle". It's too hot for bathing, which should be at around 105 F.

When the temperatures were pretty close, I slowly poured the lye-water into the fat, stirring it together.

This is the mixture after the lye-water's been mixed in. It's like cream-colored oil.

The instructions say to stir 15 minutes to 40 minutes, but I had to stir a lot longer than that to get to a "light trace". (I stirred with those same chopsticks.)

At this point, the stench of rancid fat was getting to be too much, so I added some cologne and a bit of ground sage. It had some effect, but not much.

It didn't seem to be the same as "trace" in other videos. So, I eventually heated up some water, and then put the bucket into the warm water and kept mixing until it thickened up a little more. When it got some more body, I figured it could be wrapped up. The bucket was wrapped with a sweatshirt, and left to sit for an hour or so.

It worked. Here's the real trace:

The heat and insulation are necessary to carry out the saponification process - where the lye reacts with the fat molecules. The reaction generates heat - and requires heat to continue the process. So some insulation helps the reaction along.

I added more cologne (Carolina Herrerra for men), and mixed it in. Now it finally smelled like something other than rancid fat. It smelled like rancid fat getting ready for a hot date.

I hope I didn't have too much oil and the soap will not leak excess oil.


[Updated on May 22]

The soap was wrapped up, in the bucket, for a day, and the chemical reaction continued to generate heat, sending the soap into a "gel" phase. Also, some stuff floated to the top - I suspect it's the stuff mixed with baking soda.

That's a picture of the gel - it's the dark stuff below the white stuff. There's also some nasty brown liquid that's seeped out of the soap. I'm not sure what that is, but it could be lye water.

Once it has hit the gel phase, soapers remove the insulation and let it cool down. This causes the translucent gel to harden and crystalize into a lighter colored, solid substance. It took one day for this to happen.

By the third day, the soap seemed solid, like tofu or a soft cheese, so I tried to pop it out. That didn't work, but squeezing the sides to loosen up the soap mass, and then flipping it over onto newspapers, eventually worked. You just let it sit, and the soap will fall out of the bucket.

The cylinder of soap was sliced into layers. You can do this with a length of dental floss wrapped around the mass, like you're tying a ribbon around the soap, and then pulling the string together. The string will slice evenly.

The big discs were too large, so they got cut into wedges of different size.

These wedges are now drying. Their color is even lighter than the slices you see in the photo above. The drying is supposed to take a month, so these should be ready in late June. - ------------------ So I've dried the soap for a month, and it's hardened up a lot. The problem is that it smells funky, and when I scrub with it, my hands get a little sticky. This is probably due to rancid fat, which might be left over and un-reacted. It's not harsh on the hands, though, so that's why I suspect unreacted fats. When I grated some to use as washing machine soap, the core part of the bar was still not yet dried. So it might take more drying. Also, the clothes came out smelling like fried food, so there's definitely a problem with this batch. I may "mill" it - that just means grating it, melting it, and then adding a little lye water to finish up the reaction.


After drying for a month, it was clear that the soap had a lot of extra fat that hadn't reacted. So I grated the soap and reheated it, then put it in a pot, and heated, added a little water, and then added lye. This was producing a very smelly hot process soap that I was hoping would be a little bit caustic. My goal at this point wasn't to make a hand-soap, but a soap to clean the floor. The hot soap was put into buckets and pans, and hardened quickly. They were broken into chunks and I tested one. It washed a lot "cleaner" than the original soap, but still had some funk to it. So, I didn't use it for a few months, but eventually found a situation where the soap worked. I had a lump of soap soaking in water, and it turned into a thick gel. This gel, when spread over grease spattered on the stove, softened the grease well. Rubbing the soft soap into the grease seemed to remove most of the grease. The remainder, I scraped with a plastic scrubber.

AttachmentSize
bucket.jpg55.44 KB
fat.jpg43.49 KB
gel.jpg41.73 KB
last-of-the-fat.jpg51.78 KB
lye.jpg57.16 KB
lye-water.jpg72.47 KB
soapslices.jpg53.4 KB
strainer.jpg63.94 KB
water.jpg71.12 KB
wedge.jpg57.69 KB

Solar, Green, and Cheap Power Websites

One of my fave YouTube channels is Green Power Science. There are a lot of guys doing this stuff (yeah, it's mostly guys) and there are even some real scientists doing this at Lawrence Livermore Natl. Labs, and they've done some interesting presentations at UC Berkeley for years. Here are some links to more grassroots resources. Lots of interesting DIY experiences.

Knowledge Publications
Green Power Science
Green Home Building
Mother Earth News

Soldering (How to Solder Electronics)

Sometimes, you'll find that a plug's come a little loose, or it operates right only when the plug's being pushed in one direction. Flexing the cable doesn't change anything, but moving the plug seems to always fix it (or break it).

Odds are, it's a broken solder joint, or a broken trace on the motherboard. Either way, you can fix it with some soldering.

There are a lot of online tutorials about soldering, but if you're just starting out, keep reading a bit more. Links are at the bottom.

First things first - there are only two irons to get. One is the Radio Shack low-voltage (18 W I think) lower temp iron, which has a conical tip. That's my favorite one - it doesn't get things too hot. Second is a 30 W "cheapie" iron with a longer tip that ends in a cone. This works hotter, and is better for heating stranded wire.

For now, stick with the first iron. It's a little rare, but you can get it at radio shack.

Second, get some solder. I like the thin lead+tin solder. It stays soft longer, so it's easier to work. The lead-free, safer one, is harder to use. The type of solder to get depends on the existing solder. You shouldn't mix the leaded with the unleaded.

Lead-free is a lot harder to work with. Read up on it.

Third, get a desoldering braid. This is a copper braid that you put on an existing joint, and heat up. The solder joint will melt, and most of the solder will be sucked up into the braid. Then, you can remove components, or start a new, clean joint.

Fourth, get a cellulose sponge. You can find big yellow ones at a home improvement shop. Cut it into smaller sponges the size of a bar of soap. Soak in water and wring out. When you're soldering, you can clean your iron on this damp sponge. You just jam the tip into the sponge, or rub it on the sponge. The roughness and water will cause the flux (the brown crud) to wipe off. You can then apply solder to the tip to "tin" it. (That's why you need cellulose, which is wood fiber. A plastic sponge would melt.)

You can also use a damp paper towel for cleaning. It's just not as good.

Clean off the workspace, and if possible, lay a plank of cleaned-off plywood on the table, and solder on that instead of burning your table.

One last thing to get is a multimeter. Digital or analog doesn't matter, but make sure it has a "continuity" setting that will make noise when it senses a short-circuit. You'll use that feature a lot, to test if you soldered things right.

Here's a good tutorial for followup.

http://www.instructables.com/id/How-to-solder/

Now, back to the fixing. You can usually spot a broken solder joint where the connector's pins meet the motherboard. The fix is often just to resolder the broken pin, fixing the connection.

If that's not the problem, look for any cracks along the wire traces or anywhere else. You can bridge the breaks with short bits of wire, stranded copper or sometimes solid copper.

If that's not the issue, then you have to find the broken component. Sometimes, it's a capacitor that's blown up.

That's a bit harder fix, because you have to find the right size and type of cap, or concoct a solution. That's beyond the scope of this beginner article.

[more notes - need to edit these in]

Flux

Flux is made from tree sap or something, and the kind you want is rosin flux. To use it, you swab some onto the metal surface, and it helps clean the surface as it heats up. The flux will cause the solder to flow right onto the metal.

In the old days of soldering big wires and thru-hole parts, flux wasn't that important, but nowadays, with all these surface mount parts, I think flux is necessary because you have a lot less room for error, and you need the solder to stick quickly.

After soldering, you need to use some warm water and alcohol to clean off the flux.

See Flux at Wikipedia.

Sony CRX0811 Windows2000 CD-ROMs Dissapear Due to Bad Driver

The eXpress software that comes with the Sony Spressa CRX0811 doesn't work with Windows 2000. The symptom is that all your CD-ROM drives stop working, and show up in the device manager with little alert badges on their icons.

The version I had that failed was 1.1.

The fix is to update the software. The you can download the updater from Sony's website. It updates you to verion 2.0.

If you uninstalled the eXpress software while trying to get the CD-ROMs back, you will discover that the updater won't update your drivers, because the application was uninstalled. You won't be able to install it again because your CD-ROMs don't work. Doh!

So, you need to dig up a copy of eXpress.

I found a functioning version of eXpress, version 1.3, at DriverGuide.com. It works with Win2k.

Once this version is installed, you can use the updater to finish up.

Sony Vegas: Importing DVDs and VOB Files

Until I started doing more video work, I ran under the assumption that DVDs were a good way to transfer video. DVD should use only three encodings: MPEG2 for video, and AC3 or MP3 for audio.

Or so I thought. In fact, you can have other audio encodings, because some people or devices create DVDs with PCM (aka WAV) audio streams. But that should not be too much of an issue, should it?

It turns out there's another annoyance: video editing programs don't generally support VOB files (the files on DVDs). Dragging a VOB onto Sony Vegas fails. Same for Quicktime Pro and Windows Movie Maker (both old and new). I think VideoSpin won't read them either. (I suspect that Linux editors will handle them.) You have to reconstruct the videos as MPEG-2 files (mpg files). Even then, there's no guarantee that the files will import, or that there will be audio on it.

I used the following command to create an mpg file:

ffmpeg -i VTS_01_1.VOB -vcodec copy -acodec libmp3lame clip1.mpg

This copies the video stream over unchanged, and converts the audio to MP3. The audio was converted because the original audio was PCM.
The resulting file will play on VLC, but will import only the video into Vegas.

So I ran another command

ffmpeg i- VTS_01_1.VOB -vn -acodec libmp3lame clip1.mp3

That transcodes the audio stream into an MP3 stream. Vegas will import this!

So, with video and audio separated like this, you have to re-sync the video and audio tracks manually. It's do-able, but what a pain.

Sound Card Problems, Clicking

I had some major sound card problem with Ubuntu Linux, but, it turns out the solution was simple.

The symptom was a clicky noise when I was using sound. It was worse when there were more sounds being played. The card was a SoundBlaster Live.

The solution was to move the sound card to another PCI slot. The problem was that the sound card wasn't getting enough of the PCI bus's resources.

Followup

Ultimately, I ended up getting an inexpensive CMI-based sound card (an AOpen AW-840). This worked a lot better, and seemed to play better on the PCI bus.

State and Federal Income Taxes

This is a mini site about taxes. If you're not familiar with taxes, there's some basic information here. The articles at the top are essays, and the articles toward the bottom are a glossary of sorts. For the most part, this site is for residents of California.

I'm not a tax professional or an accountant, or even a bookkeeper. I just like to do my own taxes.

Important Links

Internal Revenue Service - the Federal government agency that collects income taxes.
CA Franchise Tax Board - the State of California's agency that collects income taxes.

Alternatives to Intuit TurboTax

(It's ok to click the links. These are not affiliate links.)

[2012 - I've been looking for Linux tax software, and found OpenTaxSolver! Everything else is going online, which is fine for most people... but last year I failed to file my 2010 taxes. I got an extension and paid, but for various reasons could not file. So I need to file old taxes, and you can't find that online. Fortunately, I bought downloadable software (H&R Block), and can finish that up. So it's good to purchase a downloadable for some cases. The problem is, downloadable softaware now seems to be a Windows-only product.]

First, see the IRS Free File Program that links to several websites that offer free tax prep software for simple returns. To use Free File, your adjusted gross income must be less than $57,000.

TaxACT - basic prep software to do the short and long forms as well as what seems to be all the common small business forms. The free version does ALL the forms, including Schedule C. The paid version offers advice. Online or Windows only.

H&R Block at Home - basic to advanced. Some versions do Schedule C and other business forms. Comparable to TurboTax. This used to be called TaxCut. Available for Mac and Windows.

In the past four or five years, I've used all these apps. TaxAct is simple and plain (and cheap). TaxCut (H&R Block) is like TurboTax, but with less help. TurboTax has the most help and advice, but is also gives you the most "maze like" experience.

If you're new to tax prep, H&R Block is a good way to learn. If you already know tax prep and basically have the same return as last year, TaxACT is probably easier than the other two, because you can deal with your taxes by filling forms rather than having Q&A interations with "wizards."

Also, if you have a micro business, rent property out, or lots of 1099 income, something to try is to purchase the more expensive software one year, and use all the wizards, and really learn the tax forms. Then, the next year, purchase TaxAct, and use your past return as a guide to preparing your next return. This will work if your income sources are similar year after year, and the business tax laws don't change significantly (and you regularly read a business magazine to keep on top of what deductions are available).

Also, some states have free online tax filing. California, for example, has two different online forms. One's called Ready Return, and is almost one-step filing. The other is called CalFile and is more like a traditional filing program, with multiple income sources, deductions, and other tax features.

Comparing a Tax Credit with a Tax Deduction

People get tax credits and tax deductions mixed up.

A tax credit is money the government gives to you.

A tax deduction is money that the government won't tax.

Tax credits are more valuable than tax deductions. Here's a fantasy example of how a tax credit works.

Once upon a time, in one year, you earned $1000. The IRS said they would take 1% or $10 of that in taxes. However, you purchased a tent to live in, and the government was giving a $1 tax credit for tent dwellers. (Assume the tent was really cheap, too.) That tax credit is applied to your taxes... and your final tax bill is $9! The $1 tax credit was given to you.

Here's a similar story about a tax deduction.

The next year, you earn $1000, and the tax is the same: 1%, which is $10. However, you just bought a skateboard for $100, and the government is allowing skateboarders to deduct the cost of a skateboard because it's basic transportation. So, you have a $100 deduction! A deduction is subtracted from your taxable income. That means your taxable income drops to $900. Taxes are 1%, so, your tax bill this year is $9. (Same as last year!)

Notice how in the first example, you spent almost nothing, and got at $1 tax credit, and your tax bill was $9.

In the second example, you spent $100, and got a deduction, and then your tax bill was $9.

The tax deduction was like a $1 off coupon on that skateboard. So, thanks to that deduction, your $100 board really only cost $99. Whoop-de-do.

It's much better to do things that get you tax credits, than to do things that get you tax deductions.

It's even worse

Yes, it's even worse than the little stories. To get some itemized deductions, your spending must exceed some threshold, and usually that threshold is several hundreds to a few thousand dollars.

Also, my examples were totally unrealistic. Taxes are a lot higher - in the range from 10% to 38% - and incomes are a lot higher. The numbers were chosen to make a point: that tax credits are $$$ in your pocket, while tax deductions are like discounts for spending money in specific ways.

An alternative calculation

Another way to look at the examples is to say that a $1 tax credit is equal to a $100 tax deduction.

If taxes were higher than the example it's not so drastic. At the 25% tax bracket, a $1 tax credit is equal to a $4 tax deduction. A $1,000 tax credit is like a $4,000 tax deduction.

The $8,000 homebuyer credit is equal to a $32,000 deduction. (Another way to say it is: if you buy a house, you're not going to pay much or any income tax.)

Also published at AC: Comparing a Tax Credit with a Tax Deduction.

NO to Turbo Tax

Turbo Tax maker Intuit, again, is mired in political turmoil: Intuit was upset that John Chiang, our State Controller, had been making electronic tax filing software free to people. Intuit wanted the State to use a different system that worked with Intuit's commercial software.

So, Intuit spent over a million dollars to run a candidate against Chiang.

That begs the question: shouldn't the state provide free software to file taxes? Chiang says it costs all of $125,000 a year to maintain the software. That's cheap!

If you're fed up with corporations that make millions off tax prep software and then use that money to try to destroy free, government supported alternatives, don't buy Intuit's TurboTax or Intuit's Quicken.

Also, if you do buy a competing tax prep program, don't buy the state version. Just use Ready Return.

CA Ready Return

Alternatives to Intuit TurboTax

Intuit's response to criticisms.

I found their essay long and full of smoke. They tried their best to include some scare stories, but they were vapor, in my opinion. The existence of Ready Return and CalFile doesn't preclude Intuit or anyone else from creating the State version of the filing software. All it does is compete with the commercial software. There's nothing wrong with a free "public option" that's available not only to low-income people, but to all people. Everyone paid for it, so everyone can use it. Enjoy.

depreciation

Depreciation is a way to deduct the cost of something over multiple years. If you purchase something for business or work, you can deduct the cost from your taxes, but not all at once. You must deduct the cost over several years - that is called "depreciation".

There are two categories of things you buy for business or work: expenses, and assets. Expenses are things that get used up quickly, like paper, ink, memberships, repairs, and rent. Assets are things that get used up slowly, like cars, houses, computers, copiers, and real estate. Sometimes, assets hold their value - for example, if you buy a nice camera and use it for work, you will be able to sell it in a couple years and recover more than half the purchase price.

Sometimes, it's hard to decide if something is an asset or an expense. Is a smartphone an asset? It's going to be obsolete in a couple years. Is a computer an asset or expense? The IRS says it's an asset... but they are so cheap that you can deduct it as an expense. So, you should read the rules about classifying things as assets or expenses. The link to MACRS below has that info, in the linked IRS publications.

The simplest form of depreciation is called "straight line", and it's just a simple formula where you divide the price by the lifespan, and take that amount as a depreciation each year. The problem with straight line is that it doesn't reflect reality - new things are more valuable (and reliable) than old, worn out things.

For example, if you were going to depreciate a $1000 computer over five years, you could deduct $200 per year.

To account for that, the IRS uses Modified Accelerated Cost Recovery System (MACRS). MACRS is a formula that gives you a big deduction the first year, and a declining amount each following year. At the end of the life, the deduction is tiny.

With MACRS, you take big deductions the first couple years, and after the third year you start to notice the deduction's pretty small... so you feel motivated to sell the computer and buy a new one. As long as the depreciation is greater than the decline in price, you're "ahead"... theoretically.

sales tax deduction

The IRS has a general sales tax deduction calculator. It helps you take the deduction even if you didn't keep receipts!

When you're calculating your adjusted gross income, you are allowed to deduct either state and local income taxes paid, or state and local sales taxes paid. Generally, if you save a lot and earn a middling wage (in California), your income tax paid will be higher than sales tax paid. However, if you have a big spending year, like you buy a car, and you earn less than $47,000 a year, your sales taxes may exceed your income taxes, because sales taxes in CA are high.

If you are pretty low-income, it may be worth it to take the deduction. For example, if you made $20,000 and bought $4,200 worth of taxable stuff, you'd save money by taking a sales tax deduction. (Unfortunately, low-income people generally don't file the 1040 long form because it's too complex. They also don't keep receipts. This is yet another nice deduction that won't go into the pockets of those who need it most.)

If you make $40,000, you'd need to spend over $16,000 - but that's possible if you are purchasing a car or have had a lot of house repairs, or some other high-price purchases. (Unfortunately, rents and mortgages don't count.)

See the attached spreadsheet in OpenOffice format for details.

AttachmentSize
Sales Tax or Income Tax deduction.ods12.2 KB
Sales Tax or Income Tax deduction.xls10 KB

1099 (Form 1099)

Form 1099 is an information form, submitted to the IRS, telling them that a company paid a contractor some money for services.

Often, a company will distinguish between employees and contractors by calling them W-2 or "1099".

Workers may talk of doing "1099" work, meaning working as a contractor instead of as an employee.

There are numerous different types of 1099 forms for different transactions that result in income to a person. Generally, the amounts on the 1099 forms are added to your income.

W2 (Form W2)

Tax form W-2 is a statement of earnings. Your employer will send you one in January, and you use it to fill out your taxes.

There are W-2 forms for different kinds of income, but the most common is for wages and salaries.

W-2 is often contrasted with Form 1099, the income information form.

adjusted gross income (AGI)

Your "gross income" is all the money you've earned in wages or salary, received as interest, gifts and prizes. Basically, anything you got in some form of cash. (It doesn't include things like increases in the value of property, or stock options.)

For tax purposes, you are allowed to deduct a standard amount of money for personal living expenses, some kinds of interest, and some other expenses. After subtracting these from your gross income, the result is your adjusted gross income or AGI.

You pay taxes on your adjusted gross income. This value is used to calculate how much you owe in taxes.

After calculating your AGI, you can take additional itemized deductions.

To qualify for Free File, your AGI must be less than some set amount (in 2009, it was $57,000). Because your AGI is calculated by subtracting some deductions, like mortgage interest, your gross income could be substantially higher than the maximum. If your gross income was less than $70,000, you are probably eligible to use Free File.

earned income tax credit (EITC)

The earned income tax credit (EITC) is a great deal for low-to-moderate income workers. For single workers, the credit is below $500, but for dual or single parent families with children, the EITC can help eliminate up to $5,600 of your taxes.

The IRS has a EITC Home Page where they tell you how much you can get, and how to get it.

The idea behind the EITC is to reward people who work. Specifically, they are trying the hardest to relieve taxes for someone who has to work a moderate-income job, and raise kids. If you make under $22 an hour, and have children, you may not have to pay taxes at all, because of the EITC.

The state of California requires that employers notify potentially eligible workers of this fact.

Low Income Taxpayer Clinics are an IRS service where people will help you fill your taxes. Click the link and find your nearest location.

Also, pay attention to community websites and civic news. The IRS has tax workshops for people learning how to do taxes. There are even events where the IRS shows you how to get the EITC.

Wikipedia has a good article describing why EITC works better than welfare when the goal is to get people working.

itemized deductions

Tax deductions fall into two broad categories: the ones taken before calculating your adjusted gross income (AGI), and those taken after.

The second kind are called itemized deductions.

Itemized deductions include things like: money spent for supplies for work that weren't reimbursed (like teachers buying school supplies); medical expenses; state and local taxes paid; mortgage interest; gambling losses; donations.

"Taking a deduction" doesn't mean that the government gives you back the money you spent. (That would be a tax credit.) A deduction subtracts from your AGI, so, you pay less taxes.

The one problem with taking deductions is that many deductions are only for expenses greater than some percentage of your AGI. Usually, the threshold's something like 2%.

Suppose you had an AGI of $20,000. 2% of that it $400. To take a deduction for a category of expenses, you must spend more than $400 on that category of expenses. So, if you wanted to deduct your driving for work, it has to exceed $400 (or around 200 miles). The first $400 of that expense comes right out of your pocket! (Lesson: get reimbursed.)

Now, if your AGI is $40,000 (aka, a solidly middle class income), that AGI threshold is now $800.

Also, note that the threshold applies to an entire category of expenses, not all your expenses in total. So, you can spend $100 on driving, $200 on gambling, $1,000 in medical expenses, and have $500 in stolen property, and still not hit the lower threshold.

There are also upper limits to deductions... but generally, most people have problems even deducting things in the first place.

Generally, deductions have value to middle-income to high-income wage earners. If you're earning less than the median, you probably can't take many deductions, mainly because you're not going to be spending so much money on deductible expenses.

If you're seriously looking at taking deductions on education or medical expenses, consider getting tax exempt savings accounts.

progressive and regressive taxes

The terms progressive tax and regressive tax describe taxes that affect different levels of income differently. They don't refer to political ideology.

A progressive tax is one that taxes high wage earners more than low wage earners.

A regressive tax is one that taxes low wage earners more than high wage earners.

A flat tax is one that taxes everyone equally.

In the following examples, I describe people as "poor" or "rich" to increase the contrast between the types of taxes.

Examples of progressive taxes:

Income taxes. The more you earn, the more your income is taxed. Right now, the tax rate ranges between 10% and 38%, with the highest paid people paying the 38% rate. Of course, they pay 38% only on a fraction of their earnings, which is normal for a progressive tax. See tax brackets for clarification.

Capital gains taxes. Though this is generally a flat tax, it's wealthy people who tend to have the most capital gains, because they own more assets.

Examples of regressive taxes:

Sales taxes: poor people buy things, and save almost nothing, thus most of their income is taxed. Rich people buy things, maybe more things, but save a lot of money (or invest it), and that saved money is not subject to sales tax. Poor people end up paying more of their income in taxes.

Parcel taxes: poor people who live on small parcels pay the same as rich people who live on large parcels.

The "flat tax"

It's actually difficult to create a flat tax. The sales tax is nominally a flat tax, but in reality, it operates in a regressive way.

The typical flat tax proposed by politicians usually includes a large exemption from taxes for income below a certain amount, like $20,000. So, it really starts out as a progressive tax.

Then, there's a range in there where the tax really is flat. As income rise, however, there are ways to avoid taking your pay as "income", usually through benefits and stock options. Since that tax is now dodged, the flat tax is no longer really flat.

It's progressive for the poor, and regressive for the rich.

reimbursements

self-employment tax

When someone works as an independent contractor or on odd jobs, they have to pay self-employment tax in addition to regular income tax.

The self-employment tax is basically Medicare and Social Security tax payments. It is currently 15.3% (in 2009).

Regular employees have their Medicare and Social Security paid by their employer. A self-employed person has to pay for these things on their own.

If you're self-employed, you need to always figure in the self-employment tax into your hourly rate.

tax brackets

The progressive income tax divides your income into ranges, called brackets.

Income within a bracket is taxed at one rate. Income past a certain amount is taxed in a higher bracket at a higher rate. There may be multiple brackets. Consider the following example of tax brackets:

brackettax rate
$1 - $10,00010%
$10,001 - $20,00020%
$20,001+30%

If you make $30,000, you are said to be in the highest tax bracket, paying 30% in taxes.

That doesn't mean you're paying 30% of your income (or $9,000) in taxes. Many people have that misunderstanding.

What it means is that the highest rate you're paying is 30%.

For your income from 10,001 to 20,000, you're paying 20%. For your income from 1 to 10,000, you're paying 10%. Let's do the actual math.

brackettax ratetax paid
$1 - $10,00010%$1,000
$10,001 - $20,00020%$2,000
$20,001 - $30,00030%$3,000

Add them up, and the total is $6,000. (Which works out to 20% in tax.)

Some people will say that "the first dollar you earn is taxed at the lowest rate" and "the last dollar you earn is taxed at the highest rate". This is factually true, but, tends to confuse beginners. So it's not much of a simplifcation.

Actual tax brackets

For actual tax brackets, see the Wikipedia article or the IRS.

The actual tax brackets are 10% all the way to 35%, and the 35% rate doesn't affect anyone earning less than $372,000 a year.

Most people are in the 25% bracket or below. The 25% bracket goes up into the $80,000 per year range.

tax credit

A tax credit is money that's given to you for spending your money in a specific way, or belonging to a specific category of taxpayer.

For example, renters in California get a "renter's tax credit", which is a small amount of money you get for being a renter.

Parents get a Child Tax Credit of $1,000.

Another well known tax credit is the "earned income tax credit" or EITC, where people who work, but don't earn very much money, are given some money. The less you earn, the larger your credit. (Click EITC to learn more.)

The largest popular credit today (in 2010) is the first time homebuyer credit, which pays you $8,000 for buying a new house, if you haven't lived in a house in the past three years.

A tax credit is not a tax deduction. It is much better, because a credit's money in your pocket.

For some math to explain this, see Comparing a Tax Credit with a Tax Deduction.

tax-exempt savings

A tax-exempt savings account is just like a savings account at a bank, except that any money put into it isn't taxed, and the money can be spent only for specific, eligible expenses.

Tax exemption is like an itemized deduction except better, because you get the tax savings immediately. Deductions, as noted in the linked article, generally can be taken only after the expenses exceed a specific amount. Tax-exempt savings take effect immediately.

Some negatives of tax-exempt savings are:

  • restrictions on how money is withdrawn
  • the need to have cash to save
  • the need to plan out savings and withdrawals
  • bureaucratic paperwork
  • some plans need to be provided by your employer
  • "use it or lose it" rules for some plans

There are many different types of savings plans, so they'll just be listed, not described:

Retirement savings: IRA, Roth IRA, SIMPLE IRA, 401(k), 403(b), 457
Medical savings: FSA, HSA
Education savings: 529, Coverdell ESA

Example

When you go to the drug store, you get a receipt with a little extra info about "Flexible Spending Account (FSA)" expenses, for specific items. You save these receipts, and total the FSA-eligible amounts, and find that you spend $300 a year on this stuff.

Your employer offers an FSA plan, so you sign up and start putting $20 per month into the account. You want to keep the amount below expected expenses, because FSAs have a "use it or lose it" rule, where you lose the money if you don't spend it.

So, during the year, you put in $240, and spend the whole $240. (You spend it by using an ATM card to pay for expenses at the drug store.) How much do you save?

It depends on your income tax bracket. Suppose you pay income taxes at the 20% rate. The question to ask is, "what would you have to earn to pay for $240 of expenses?".

The answer is $300.

So, instead of having to earn $300, you only had to earn $240. That's a $60 savings.

The savings changes drastically if you're in a higher tax bracket (wealthier people benefit more), and if you have a chronic illness.

If you have $4,000 of annual expenses, and are in the 25% tax bracket, your annual savings is around $1,300.

Politics

By and large, tax-exempt savings work if you're a middle income person (earning over $30,000) in a job with a fairly large employer. You'll have money to save, skills to deal with paperwork or access to someone who can help, and access to all the plans.

These plans are a big benefit to wealthy people, as well, because they can act like long-term insurance plans. You can save money for years, and spend it when you're old.

They really don't work out for poor people, because poor people generally lack savings, and need their savings to be flexible to deal with emergencies. They also tend to not have access to the plans, if they work in small businesses.

As you may have guessed, these savings plans are favored by Republicans. So if you're poor and a Republican, and voted that way in the past, consider this when you're voting next time. These savings plans end up costing the government tax revenue that could be used to pay for social services that everyone could use.

Styrofoam Coaster

This styrofoam coaster was made by cutting up a bit of packaging foam, and shaping it with a sharp blade. It works well at keeping the cold drink very cold, by preventing the transfer of heat from the desk to the cup.

AttachmentSize
styrofoam_coaster.jpg30.48 KB

Subversion Subtlety: A small error with redirects. (Error 301.)

(This isn't really DIY. It's more of a but report.)

I was getting consistent errors on one of my directories.

svn: Commit failed (details follow):
svn: OPTIONS request failed on '/images'
svn: OPTIONS of '/images': 301 Moved Permanently (http://svn.lolitics.org)

The problem was that the svn client was failing to honor the redirect request that sends requests for http://foo/bar to http://foo/bar/ with the trailing slash. I couldn't figure out why it was happening on this directory and not others.

After much research, I found only one reference to a similar problem: http://svn.haxx.se/users/archive-2005-09/0960.shtml

That thread, however, didn't provide the real solution.

The solution was found in the default httpd.conf file. Adding the following line to the httpd.conf of other apache configuration file will fix the problem:

BrowserMatch "^SVN.*" redirect-carefully

That will match the command-line SVN client.

HOWEVER, after searching for "BrowserMatch SVN", I found some discussion on this:
1, 2, 3

So, not unheard-of, but not rare either. Perhaps it is an interaction between a specific version of the client, and specific versions of the server(s). I'm using svn, version 1.4.4 (r25188).

Sun Serial Cable Workaround

If you come across an old Sun machine, you can boot it without a monitor and keyboard by hooking up a "console" to the serial port. The console can be a PC comm program (like Miniterm on Linux). Set the terminal to 9600 baud 8N1 or 7E1.

Important Tip My mobo, an Abit BP6 (see Review: Abit BP6 Dual Celeron) has a problem if I'm connected to the internet on COM2's modem and I try to boot the Sun on COM1. It just doesn't work. The solution seems to be to get off of the Net, boot the Sun, and continue. I don't know why this is, but that's what works. (I sometimes managed to get it going by using Xon/Xoff instead of Hardware flow control, so it's probably related to that.)

The only thing that's hard to find is the serial cable. I made a mistake and got a mac serial printer cable (din 8 to 9 pin D), assuming that a printer cable is a serial cable. That's not the case.

The correct cable is a hardware handshaking modem cable, with a null modem in between. The most common Mac modem cable is din 8 to male DB-25. You need a female 25 to female 9 null modem cable.

You can build your own null modem with a couple connectors and wires.

Here are the pins for the null modem (this one is for connecting the common 25 pin to the 9 pin serial port on your PC):

 9 pin    25 pin
 3 td      3 rd
 2 rd      2 td
 7 rts     5 cts
 8 cts     4 rts
 5 gnd     7 gnd

You should be able to find a 25-25 null modem, as well as a 9-9 null modem. The 25-9 null modem might be a little harder to find. 25-9 adapters are easy to find. The simplest solution with the longest term gain is to buy multi packs of D-type connectors (9 and 25 pins) and some crimp-on pins and holes. $20 will get you enough to build whatever you need (gender changers, null modems, loopback, etc.)

With these serial port issues, I often end up making my own stuff, because the packaged dealies often don't work out or are really expensive. Serial ports are usually only five wires, so it's so difficult to make cables.

I got the null modem information from: http://www.loop-back.com/null-mod.html

I also got other information from
http://www.stokely.com/unix.serial.port.resources/ and
http://www.geocities.com/TheTropics/Shores/2250/pinout.html and
http://www.national-tech.com/catalog/f_nullmodemcables.htm

And, finally, I found another serial port resource:

http://www.geocities.com/TheTropics/Shores/2250/pinout.html

System Slows Down After Drive Upgrade

After upgrading a disk, the system slowed down after a while. The disk would thrash over and over, but the system monitor showed that VM wasn't being used. It seemed OK, because there was enough memory, or so it said.

The problem turned out to be that the swap partition was on the old disk, and had been removed. The solution was to build a new swap and enable it.

Why did this work? Here's a part of the explanation, from Is swap space obsolete?:

File-backed pages can be flushed by writing them back to their file on disk. But anonymous mappings by definition don't have any backing file. Where can they be flushed to? Swap space, of course. Swap partitions or files on Linux hold pages that aren't backed by a file.

If you don't have swap space, then anonymous mappings can't be flushed. They have to stay in memory until they're deleted.

In short, VM lets the kernel keep memory defragmented, making it easier to allocate memory. If you don't have any swap space, the swap daemon isn't started, and VM isn't available. Performance suffers, and oddly enough, one side effect is that the disk thrashes because you can't map the disk to RAM - the system probably can't use the disk-to-memory mapping feature of VM, and has to actually read all the data in.

Terminal And Serial Port Tips

[This article is obsolete, but the serial cable is not, as it turned out. For more info, read about the Yost cable standard.]

Pretty soon, serial cable headaches will be a thing of the past (if USB finally takes over), and serial cables will once again be the province of patient admins poring over stacks of printouts and diagrams.

Back in the day, though, every hobbyist had to custom make thier own serial and parallel cables. (Hobbyists, flush with confidence having built cables would attempt soldered-in RAM upgrades, and burn out expensive 64K RAM chips.)

If you need to interface betweeen a modular serial port (usually in the wall at an older installation) and your computer, I like using 9 and 25 pin to modular adapters with the connectors you can swap into the proper holes. You can use a plain cat-5 cable to connect all the parts. (Cat 5 cable has weird crossovers, but the net effect is that it's wired straight through.)

Before proceeding, it's a good idea to search "Google" with a search phrase like "VT220 modular serial cable". Include the name of the terminal being used at the site.

These modular cables are great substitutes for serial cables - you buy a pair of modular ends, and wire with cheap cat 5 in between. The cables work out to just over $15 per interconnect, but are completely reconfigurable to work with just about any kind of cabling conundrum.

You can even build null modems with these ends.

Parts

I haven't used these guys, but this place has cheap parts http://www.cablesnmor.com/modular.html

References

Here's a page that defines a complete set of these cable ends. It's the above idea fully developed into a really useful product:

http://www.eskimo.com/~bob/serial-spec.txt

And here's an alternative method that's pretty darn clever:

http://www.beowulf.org/listarchives/beowulf/1998/11/0392.html

Terminal Title

You can use the Terminal window's title bar to display more information.

Terminal is a "terminal emulator", and one of the features is that a sequence of special characters (escape sequences) can be used to change the title bar.

The codes are
<esc>]2;<string><control-g>

In the zsh shell, you can modify your prompt so it changes the title bar to reflect the current directory:
prompt='%{^[]2;%~^G%}%m%# '

To type the esc and control-g, hit control-v first, then the key.

xterm FAQ
http://dickey.his.com/xterm/xterm.faq.html

Other VT100 Escape Codes
http://www.termsys.demon.co.uk/vtansi.htm

Three Failed Internet Services

I must have been on a tear with coding a couple years ago. Three old domains for three experimental web services are expiring. One was to deliver email on a Kindle, another was a URL shortener, and the last was a OpenID service. Three duds in a row.

The email thing was pretty cool, but I couldn't get into the Amazon developer program - probably because I told them I wanted to make an email service for the Kindle (just an IMAP gateway really). So that was a dud. The program worked by delivering email as an HTML "book" to your Kindle address. All I needed was to make a simple reader program, and then pull the data over the 3G. I suspect Amazon probably didn't want users pulling 200K of email every day, because searching for "amazon kindle email" doesn't turn up an app.

Besides, I eventually got a smartphone, and got email through that. In the end, though, aside from work email, I prefer to read email on a computer. It would be nice to be able to read specific emails on a Kindle, though.

Then there was the OpenID service. That was a quick fail, because I was just diddling with code, learning the spec, when all the big websites stared offering OpenID, and also worked up user interfaces that were better than the demo apps people were using. There might still be potential for a less corporate OpenID, but it would be tough, because some sites don't support generic OpenID. They only allow logins from the corporate services like Yahoo and AOL. Also, with the three way fight between OpenID, Facebook, and OAuth (twitter), it seems to me like OAuth 2 is more like what people want - they want control over what other sites can do with their (outsourced) identity. Facebook doesn't make it that easy to do, though.

(Another way to think of Facebook is as a giant LDAP database, or huge directory that also contains application permissions and some application configuration.)

Last was the URL shortener. It was anonymous, not logged, and basically the opposite of bit.ly. The amount of spam traffic was incredible. Bye bye site. The main thing I learned was that spammers use URL anonymizers to get around email spam filters. The other thing I learned is that a lot of people want URL click tracking - and don't know how to filter their server logs to get that info. Or they may have ISPs that don't give them raw server logs. Or they are affiliate marketers with referral links and they want to track the referral clicks. So this one was actually kind of useful and gained traffic without much effort, but dealing with spam consumed too much time.

Umeboshi

Recipe 1

Recipe 2

Umeboshi is a pickeld apricot that's popular in Japan and increasingly in America. Most people have seen a tiny red thing in their bento-box that's extremely salty. That's umeboshi. However, the kind you make for yourself is different. For one, there's no red food coloring, and it's larger and more fleshy and gooey.

I'm fortunate because my mother planted an ume tree in the 1970s, and it's bearing a lot of fruit annually. The trees apparently live for a century or more, so it'll outlast everyone. It's a beautiful tree, similar to a plum tree, with a mixture of old branches and new branches. At the market, you can get ume for around $3.50 a pound. There are different varieties, and the most common place to get them is at a Japanese or Korean market.

I started two separate batches, and I'll describe the picking for each first, then go on to drying, which is still in progress.

The first batch was all green ume. These were cleaned and washed, and stems removed. All blemished ones were discarded, and the remainder were put into a plastic bowl and covered with regular table salt "until it looked like it snowed on them." (Yuki futa mitai ni.) Then, a plate was put on top (eating side down), and a 5lb rock was placed on top of the plate. The rock was just from the garden, and washed well. BTW, everything was washed then sterilized in a sink by filling it with hot water and a capful of bleach, and then leaving the bowls and utensils in there for an hour.

The bowl was left out in the kitchen. The liquid came out and eventually covered the ume, more or less. After four days, the stuff was done. I put them out to dry. Unfortunately, the second day was overcast, so I had to bottle the plums. You basically need four days in a row of hot weather, and we just slipped into an early July cloudy season.

I took each plum out and put it into a plastic jar, then covered the plums with the liquid that oozed out. There wasn't enough to cover it all, so I put some filtered tap water in until it was almost covered. Then, I took a sandwich bag and filled it with water, and put that on top to weigh the plums down. This went into the fridge for around a month.

The second batch was started shortly after the first one was bottled. This time around, though, I didn't have green ume. It was mostly slightly yellow, or turning pink. They were already falling off the tree too. So they had some skin damage, but more than anything else, they were already getting soft and ripe. (Note that these are not sweet fruits. They are sour.) So I did the sterilization thing again, and did the salting as usual. Then these plums were covered with salt but I didn't put as much salt in. I wanted a "lower salt" version. A plate went on top, and a rock on top of that.

This time, I paid less attention to the plums. Since I didn't have room in the fridge for more plums, I just left them out, figuring that the brine would take care of bacteria. I was wrong, and the plums went moldy. I should have checked them daily. I probably should have used more salt. Also, the skins broke as the fruit ripened and got soft. So the pressure of the plate didn't just press out the water, but caused the skins to get a little damaged.

So this second batch went into the trash. No big deal. The existing batch was fine, and aging in the fridge. It was a 2-year supply for me, because I don't eat too much umeboshi. This was around 1 pound of ume. Maybe a little more.

I didn't have any shiso (red perilla) so I didn't add those. I think the perilla helps prevent mold, and also gives it the red color. Without shiso the umeboshi still get red, but not the same bright purple-red. It's more like an orange-red.

In 2011 the hot season started on August 15th. That's when you are getting hot days in excess of 85F or thereabouts. You need four hot days in a row to do the drying. I'm reading up on drying in the oven too.

To dry I use the sushi rolling mat and a woven basket that I got at the 99 cents store. You drain most of the liquid from the jar, into a cup for saving. The end of the liquid will contain some dirt and crystalized salt, so you should throw that away. Then you pull out the ume and put it onto the mat. Put it outside for a day. At night you bring it back in. Repeat for four days.

I failed to bring it in on the second night, and the bottom of the ume got white with something. i can't tell if it's mold or salt. It doesn't taste like anything, but it bothers me. We'll see what happens when it's put back in the brine.

Otherwise, the ume are looking good, and the flesh inside is sticky and salty. Once it's fully dried and back in the brine, it'll be good.

Umeboshi have around 700 mg of salt per plum, so a normal serving is around 1/4 to 1/2 a plum, diluted in rice or on another food. I usually keep the other half in a bowl and use it another day. The thing is preserved and lasts for years.

Unix Text File Database

Unix usually comes with a set of tools that help you manipulate tab delimited data files. Since I never really bothered to learn these, I figured I'd play with them and take notes.

cat - everyone knows this - concatenates files together. cat t1 t2 outputs t1 followed by t2.

paste - like cat, for columns. paste t1 t2 - if t1 and t2 both contain one column of data each, each row will have t1 and t1 data stuck together. Ex:

 bash-2.05$ cat > t1
 cat
 dog
 bird
 bash-2.05$ cat > t2
 meowmix
 purina
 seed
 bash-2.05$ paste t1 t2
 cat     meowmix
 dog     purina
 bird    seed

cut - the opposite of paste. Extracts specific columns from the input.

 bash-2.05$ cat > t3
 fish    food
 shoe    clothing
 hut     shelter
 bash-2.05$ cut -f 1 t3
 fish
 shoe
 hut

You can also specify characters, and ranges.

 bash-2.05$ cut -c 1-2 t3
 fi
 sh
 hu
 bash-2.05$ cut -f 1-2 t3
 fish    food 
 shoe    clothing
 hut     shelter

comm - report what lines are common between two files. Not sure how to use this yet.

join - like an SQL join. It's hard to explain, but, here's a good example.

 bash-2.05$ cat > users
 1       johnk
 2       tarok
 3       yurik
 bash-2.05$ cat > tasks
 1       sleep
 1       fix things
 2       sleep
 2       take bath
 3       sleep
 3       cook
 3       yell at taro 
 bash-2.05$ join users tasks
 1 johnk sleep
 1 johnk fix things
 2 tarok sleep
 2 tarok take bath
 3 yurik sleep
 3 yurik cook
 3 yurik yell at taro

tsort - topological sort. Not db specific, but can be used to analyze graph data. Could be useful for analyzing something. Added here because it's interesting.

 bash-2.05$ cat > graph
 a b
 b c
 c d
 e f
 f g
 g h
 h c
 d a
 bash-2.05$ tsort graph
 e
 f
 g
 h
 tsort: cycle in data
 tsort: a
 tsort: b
 tsort: c
 tsort: d
 d
 a
 b
 c

The other useful commands are: awk, grep, uniq, sort

Videos about Video and Film Editing

http://www.5min.com/Video/Film-Editing-Basics-and-Theory-145351806
http://www.slatev.com/video/how-judge-best-editing-oscar/
http://www.5min.com/Video/Edit-in-Camera-Exercise-201026266
http://www.5min.com/Video/Editing-Tips-from-Bill-Cammack-39306226
http://www.5min.com/Video/How-to-Create-Stop-Motion-Animation-14075444

http://www.5min.com/Video/How-to-Script-a-Documentary-254571161

Washing Machines: Costs and Saving Money

I've always been a huge proponent of washing machines as a way to save money. Unfortunately, many apartments don't have laundry rooms, so lower-income families have to wash at a laundromat. However, after doing some math, I think that my assumption might be wrong.

The cost to wash at a laundromat is $1.25 a load or so. Detergent is around 25 cents. You generally dry, too and it's 50 cents or so. I'm including drying because I find it too heavy to carry wet clothes. So the cost is $2.00 per load.

Compare to washing at home: 40 gallons of water costs around 6 or 7 cents, based on LA DWP rates. This is not a high efficiency washer. 30 minutes at 1kw, at 14 cents per kwh, costs around 4.5 cents. A drying rack is around $15 to $25, and lasts three years (conservatively), and that means around 15 cents a week (if we do only one load a week). When I wash at home, I tend to never use the dryer (and now don't get one). Air drying works in California.

So, one load a week costs, at most, 51 cents when you do it at home, and dry on a rack.

The flipside is the increase in rent due to having a washing machine area. I don't have the time to explore this, but it seems like having washer hookups costs more, but not much more - I'd guess around $50 more, which is in-line with local rents which are around 1.5/sqft. (My actual rent is lower, and it's a toss up whether the rents are higher due to a washing machine room.) The other thing is, more modern houses simply use less space for the washing room - it's integrated into the kitchen, or in the garage - so the rent increase is much smaller. The washing room is something of a remnant of the wash-tub days, when washing took a lot of time and a lot of splashing water.

There's also a one-time cost of between $80 to $1200 for a washer. I'd aim toward getting a used top loader washer, which is going to be the most generic, most reliable. They haven't changed much in 30 years. I had a front-loader and, while it saves water, it seems like it's not as sturdy and more complex.

How does this compare if you have 4 loads per week. Let's say that taking the bus is $1.50 per boarding, once a week.

Laundromat: $416 per year + $156 transportation costs. = $572.
Washing at home: $106.08 per year + $600 rent. = $706.

Egads! I'm wrong. It's cheaper not to have a washing machine.

These numbers apply, basically, to a single person. The numbers change if you have more loads to wash, because the marginal cost of washing at home is so small: if you have a spouse or kids, you're doing more than 4 loads a week. Also, you can alter the numbers by buying cheaper detergent.

If you do 8 loads, the numbers look like this:

Laundromat: $816 per year + $156 transportation costs = $972.
Home: $212 to wash + $600 rent = $812.

Finally, there is one other trick that people don't really consider. You can alter an outside water hose to supply cold water to the washer, use an extension cord to power it, and drain it into a sink or into a sewer. If you're in a little house or a cottage, or a back house, you can have your washing machine, and not have to suffer the rent to own it.

Water Filter Choices: What type to get?

There are basically five types of drinking water filters to get slightly cleaner tasting drinking water. The type to get, imnsho is an under-sink or countertop charcoal filter that uses generic 10-inch filters. These generally require a wrench (like an oil filter wrench or strap wrench) to open them up. I like these because they last forever, have few parts to wear out, and are cheap to use.

I'll go over the other options, and explain why they don't stack up:

Inline water filters - are the cheapest up-front, and probably the most green, but are the hardest to replace. After all, you need to remove and re-install a filter to two pieces of tubing, usually tucked away in a hidden corner. If there's anything that's going to leak, it's going to be the connections that attach to the filter.

Small faucet-mounted filters - are also cheap up-front, and extremely easy to install, but the filters need to be replaced every few months because they are so small. Also, the filter holders tend to break and develop leaks. The filters also cost upwards of $10 each, which is expensive.

Under-sink filters with easy screw-in cartridge filters - these are basically like the generic filters, but there's no canister that holds the filter. You replace the cartridges. My main gripes with these are that the cartridges are extremely expensive, and the filter holders, while sturdy, are complex and have more moving parts. I had a holder that needed new O-rings after several years. It was cheap to fix, but the cartridges were $100 a piece and wore out after a year. I'd say these are best for professional environments that go through a lot of water and require frequent filter changes.

Tabletop filter pitchers - inconvenient and the filters are expensive. I won't even count these.

Reverse osmosis systems - the water quality is probably higher, but the prices are insanely expensive, and the plumbing is complex. All the positive effects of this water are probably undone the first time you wear some cologne or eat a hot dog or drive on the freeway.

Kangen water, alkaline water - I consider this stuff quackery.

This brings me back to the generic style filter. They sell these at Ace hardware and Sears; online the brands are Watts, Purenex, and I think Culligan still sells one of these. They all have a canister that holds the filter. The filter itself is a cylinder with rubber gaskets on each end. Water enters the canister and pushes through the filter from the "outside", and exits through the center of the cylinder. This helps preserve the water pressure. Water exits to a small faucet with a little lever to open it.

The units cost between $35 and $80 for a canister. If a wrench is not included, spend another $5 to $10 for one. You might also need to buy mounting hardware, a tee to draw water from the inlet, and tubing. (The Sears kit is expensive, maybe overpriced, but includes it all.) Replacement filters cost $15 to $25, and last between 6 months and a year, depending on usage. Replacement faucets are around $20, and last around 5 years - nowadays they are all plastic, and the entire unit is replaced, for better or worse. There are multiple companies making each of these parts, so the prices are always pretty low.

Web Design Contracts

Here's some info about writing contracts. Most contracts are boilerplate, tweaked for a purpose. They should be reviewed by a lawyer, but, let's face it. Possesssion is 90% of the law. Invoice frequently, and get paid frequently, and there's less to contest, and less to negotiate.

On the consultant's side, it's critical to be able to make accurate estimates about how long things will take. That behooves us to record our timesheets accurately, and use them to quantify how long tasks take.

http://kagemedia.com/articles.asp?articleID=28

http://www.sitepoint.com/article/bulletproof-web-design-contract/2

Here's some advice about outsourcing, for consultants.

What Does DIY Mean?

The first time I heard that term, Do It Yourself, was in relation to hardware stores. There was a big marketing push to get people to fix things themselves. Perhaps it was related to the early 70s recession affecting what was a growing population of new, middle class homeowners. You can't hire someone to add features to the house - but you can "do it yourself." There was, at the time, a big crafts revival as well - a kind of offshoot of a back-to-the-land movement by hippies/boomers. I even had a set of "Do It Yourself" repair books, circa 1969.

DIY went away during the 80s, but re-emerged in the punk underground arts scene. There, DIY related primarily to making music, particularly recording music and releasing your own records without the intervention of a record company.

The band Black Flag, and it's label, SST, operated by Black Flag member Greg Ginn out of his Lynwood home, became the template for DIY. SST Records was a micro-label that didn't work with large-scale distributors. Black Flag booked their own tours, and went to any small city that would host them.

DIY was heavily imbued with "politics", though the politics were not that clear-cut to most. "Black Flag" was an explicit reference to anarchism -- but anarchism is a philosophy that mates opposition to capitalism with valorization of peasantry and opposition to large scale industrial production. (That's partly why anarchists fought alongside communists during the Russian Revolution... but found themselves at odds with Communist rule when farms were being nationalized.)

In the contemporary American context, DIY became more of a turning away from large-scale production to participate in small scale production. The politics of DIY became less about destorying capitalism, and more about taking a long-term vacation from mass produced culture, and "alienated work" (to use some Marxian lingo), by participating in all phases of production, and then selling the final product to a subcultural community. It was very middle class in its aspirations.

Punk DIY fed into DIY zine culture in the early 90s, which was a related but different development. That was a self-publishing movement enabled by the declining cost of small scale printing and desktop publishing. The originators of this medium were newsletters and science fiction and music fanzines.

The DIY spirit was in everything - art showings in warehouses, bind your own books, write your own books and publish them, operate a record company from your bedroom, have a poetry reading even if you lack writing or recitation skills, make your own screen printed t-shirts, and on and on. It was an explosion of amateurism.

Some time between 1990 and 2010, DIY stopped being "underground", and became a fashion style sold at Urban Outfitters. The underground stopped being underground too; the CMJ conference became South by Southwest, which became SXSW. The "default design" became mainstream. Generation X finally got some jobs that weren't totally shitty... but they're still shittier than Boomer jobs.

The common thread between that DIY and today's DIY is about using the available technology (Xeroxing, lower cost recording, improvised performance spaces) to create a community of small scale producers, and small scale consumption.

The "dream" of DIY, in the United States, is the dream of escaping the structure of modern business, to run a "small business". This kind of "small business" is a fantasy sold at Office Depot and Staples; it's very popular with middle class people.

What is a DSL Modem / Router, and Why Are They Good?

Presently, most DSL service providers give you a DSL modem. Why would you want to get a combination DSL Modem with Router and WiFi?

A DSL Modem converts signals sent over DSL into Internet Protocol packets. Typically DSL modems have two modes, "modem" and "gateway".

In modem mode, they operate like a "dumb pipe" and simply convert the data into Ethernet packets. A single computer can be attached to this modem via Ethernet, and get on the internet. Generally, this is discouraged, and you should use a firewall device in between you and the internet.

In gateway mode, the modem enables feature that will allow multiple computers to be connected to the modem. You just need to add a switch and some cables. The gateway will give each computer a different IP address, and manage the traffic between these computers and the internet, so that the entire network will use only one IP address. This is called Network Address Translation or NAT.

Gateway mode is safer than the modem mode, and it almost acts like a firewall. It acts like a firewall because no traffic from the outside can get in.

Gateway mode also works for a single computer connected to the modem. In fact, it works better, because most computers are configured to connect into a LAN - and that's what gateway mode provides: a tiny local area network. (LAN).

Most modems are shipped in gateway mode, for the above reasons.

However, few modems come with WiFi included. Nor do they come with the switch to connect multiple computers. When you add up the cost of a WiFi access point and a switch, it comes out more expensive than what's called a "residential router" or a Wifi+router+switch combination device that costs around $40 retail.

These residential routers are awesome. They are easy to set up, and will generally work perfectly when connected to the DSL modem (running in gateway mode).

The problem comes when the people start playing video games or making internet telephone calls. Things get complicated, because these are two-way communications that require you to publish your IP address and open

ports on the DSL modem. You want to tell the other computer "go to this address, and connect to port # whatever". But when there are two routers involved, it's difficult to find out this information from the DSL modem.

The solution is to put the modem into "modem" mode, and eliminate the second network. The only problem is that this requires you to learn both the modem and the router. This is actually quite difficult for most people - because IP networking, when it's not automated, is sometimes challenging. It's intermediate level IT work.

All-in-one DSL modem / WiFi / router / switch combination boxes help relieve some of the challenges related to making internet phone calls and online video games because they eliminate that second router. There's only one router, and it's also a firewall. If you want WiFi, you pay $20 more, and get that as well.

All-in-one DSL modem / router / switch / WiFi combo boxes usually have a "wizard" that will figure out the settings for the device, and get you online with minimal hassle.

See also: Quick Reviews of Several DSL Modem / Routers

Where to Get Used and Junk Computer Parts in Los Angeles

(I’m not an expert in this.)  Here’s some info about the computer junk universe.

Electronic Waste Recycling Act of 2003: Covered Electronic Waste Payment System (SB 20/SB 50) established the EWaste business.  It collects taxes on products, and distributes payments for collecting product for recycling.  The state’s friendly website with info is at eRecycle.org.

You can beg for parts at: Trash Nothing (directory of junk exchangers), LAReUseIt, LA Freecycle, Craigslist’s Free and Computer listings.

You can buy parts on Ebay or Craigslist, of course.

Other ways to find them are to poke around dumpsters and behind buildings.  People leave old computers out for scavengers.

For surplus parts and new parts check out Apex Electronics, All Electronics, ITC Electronics, Marvac, Frys, Pacific Radio, Electronic City.  These tend to be expensive.

(LA Dumpster Dive does free food… but maybe they’d have other things.)

Windows Event Log Filter to Get a List of Crashes Without Dr. Watson or BSOD

I am having a problem with crashing computers, and need to get a record of crashes. This filter finds all the "unexpected shudown" events. While this isn't a perfect record - it seems to be thrown every time the system reboots but there's no shutdown before it, and probably no crash log.

In Event Viewer, create a new Custom View.

Logged: Any time
Event Level: Error
By Log
Event logs: System
Event sources: eventlog
Include/Excludes Event IDs: 6008
(rest to defaults)

Name it "unexpected shutdowns".

No guarantees that these are only crashes. Hard resets can also do it. But I logged crashes for a while, and then compared to this filter's list, and for the half dozen I checked, it matched. Good enough for me right now.

Wireless Router as an Access Point

Access points are pretty expensive, but home routers are cheap. The paradox here is that the router does more "stuff" than an access point. The router contains an access point, a switch, and a small router between all three. The access point just has the access point.

You can take an old consumer internet router and have it behave like an access point with a switch. It's pretty easy. Give it an IP address on your LAN, and then turn off DHCP and UPnP. That should be all you need. Just remember to plug the ethernet cable into the "LAN" switch rather than the "Internet" uplink port. You don't want anything going into the uplink, because traffic is being routed from the antenna to the switch, which then talks to another router, which carries it toward the gateway.

X Windows Fonts on Windows

This article is sort of not finished. Several years ago, I found some .fon files with the classix "xterm" fonts. I mean the public domain bitmap fonts used with XWindows. They were great for programming, because the punctuation was distinct, but didn't look garish.

When I figure out how to do this again, with W2k or whatever, I'll post here.

http://cgm.cs.mcgill.ca/~luc/xsoftware.html - a page with links to many X Windows font resources.

ftp://ftp.hcl.com/pub/bbs/util/upcpx.exe - uncompresses the following...

ftp://ftp.hcl.com/pub/bbs/fontkbd/75dpi.cpx - a compressed file of .wff files. Not sure what use these are.

ftp://ftp.hcl.com/pub/bbs/fontkbd/6x13.fon - the 6x13 monospace font.

And another link to the popular 6x13 font - http://www.place.org/~nop/6x13.fon

http://dreamer.nitro.dk/linux/lfp - linux font project

http://dreamer.nitro.dk/linux/lfp/links.html - there's a link here to bdftofon, which supposedly converts BDF files to FON files. BDF is an old font format for X Windows.

http://www.fontlab.com/html/utilities.html - more links to tools

http://www.wotsit.org/search.asp?s=font - specs for font file formats.

This is a somewhat unrelated resource ; http://www.pollet.net/GLterm/ - an OS X terminal program that uses the XWindows BDF fonts.

dyne:bolic Video Recording with the Pinnacle DC10+ (Zoran)

This is a page in progresss. I'm setting up a computer to be a part-time video digitizer, using the dyne:bolic Linux CD.

System: Compaq SR1620NX (MSI mobo with ATI XPress 200 chipset)
Video card: Pinnacle DC10+ (formerly Miro), uses the Zoran chipset and driver.
OS: dyne:bolic live cd.

I'm using dyne because I was unable to find a copy of Pinnacle Studio 8 on the internet. Studio 8 is the package that has an XP-compatible driver for the DC10+. They were selling Studio 10. dyne:bolic looked like an alternative.

First, install the video card in the first free PCI slot. I've had problems with this card in later slots for some reason. Probably some IRQ conflicts.

To view some video use the xawtv tool.

If the video shows up gray, you may need to right click on the video window, and then switch the TV norm to NTSC.

You can also save this into your ~/.xawtv file as:


[ORB]
norm=ntsc

(You must have a dyne:bolic "nest" home directory to do this. If you're on another linux, don't worry about a nest.)

To record video, use the lavrec utility.

First cd /home/luther, the mount point for your nest. Don't work in /root, which is the nominal $HOME.

Try this command:
lavrec -a 0 -d 2 -g 640x480 -q 100 -i n test.avi

-a 0 means no audio recording. -d 2 means "decimation" of 2, meaning remove every other column or row of pixels, resulting in a 1/4 frame recording. (For some reason, I can't record at full size.) -g 640x480 is a default DC10+ size. -i n means record from NTSC Composite (the default).

Then, use the avidemux2 app to view the video (the file's in /home/luther).

You might want to close xawtv while you do this, because if you don't it'll flicker.

There's another app pia that can also preview the video, but it seems to squash the video when you use a decimation of 1.

This following command will record the whole frame. The quality may suffer a bit, with glitchyness.

lavrec -a 0 -d 1 -g 640x480 -q 90 -i n test.avi

Space

Because dyne:bolic doesn't give you real write access to the big hard disk, you'll need some kind of external storage for more space. It will have to be formatted as a VFAT disk, because nobody still trusts the NTFS driver's read-write performance.

I used an external drive box based around a USB/FireWire-ATA adapter by Prolific.

The problem crops up when you try to write to disk. USB2 doesn't seem to be fast enough to handle recording to disk. Lots of frames are lost. I tried the FireWire port. A little sleuthing in /proc revealed that the FireWire was being connected via USB2. I guess that's OK, but the overall latency seemed to kill things. (I'll try a FireWire card eventually.)

I tried, later, to enlarge the nest to 600 MB, hoping to record more frames. No such luck. The recordig froze after 1.2 seconds, and resumed several seconds later, losing several hundred frames.

A Second Hard Drive

I added a second hard drive, and now, recording to it works great. No dropped frames. The hard drive was formatted as FAT32, but with a 64K block instead of the default 4K block. Supposedly, a larger block results in less fragmentation and seeking on the drive. I tend to think it just forces longer writes, and less communication overhead. For every 64k of data, there's only one block dumped rather than sixteen.

The hard drive showed up at /mnt/hd2.

Note: I had to add the second disk because my main disk was a NTFS drive, and dyne won't write to NTFS. It might be possible to record to your main disk if it is FAT32.

Sound

Had a hard time adjusting the levels for the sound. The vid cam has a line level output, and you have to adjust your line level input to work right. Start up the dyne control panel, and fire up the Soundcard utility. This will put the ALSA system between you and your card. Then, fire up audacity and start recording from yoir source. Keep the levels low.

Then, quit audacity and use lavrec to make a video. The following line will record a "YouTube" size video with 8-bit sound:

lavrec -d 2 -a 8 -R l -U blas.avi

iBook Drive Upgrade

I went and did the famous iBook disk upgrade that's at these two websites. It went pretty much as advertised, and these notes are just an addendum to the good instructions already out there.

iBook Hard Drive Upgrade - http://caslis.com/mac/ibook/ibdrive.html

The tools I used were: a 5mm nut driver, a T9 torx wrench (Sears model 45732), a small philips screwdriver (Sears model 45726), a regular philips screwdriver, and a flat blade screwdriver.

To keep the screws straight, I used a piece of packing tape with sticky side up. That, or an ice cube tray are the way to go. I recommend labeling each screw, or at least sets of screws. Don't mix them, becase are few are longer than the rest.

When you pull the top panel off, you start at the back. You can pry a little with a screwdriver, but be careful or you'll scratch something. You can work the cover off counterclockwise, "peeling" it off like you'd peel the plastic lid off tupperware. When you put the top panel back on, start at the back, and then the front.

When you're removing the modem port, don't force it. It's all about the angle you're pulling at: just put a screw or pen in there and push straight upward (gently).

When reassembing, keep track of which screws go in when, because several holes need to remain empty until the end. I didn't do this, and had to undo a few screws.

Don't overtighten! If you have a wide handle on the nut driver, be extra gentle.

I did mess up one thing. The trackpad connector uses a plastic wedge to hold the edge connector in, and I broke the wedge when I tried to pry it out. It went back together enough to work, though.

Overall time for me was 2 hours to get the thing open and together again. Yes, it's 36 screws, but that's not much more than the typical PC. (They have around 20 to 30.) The top cover and screen are a pain, though.

OSX Installation

I had to partition the drive into two areas. (BTW, the drive was a 12G IBM Travelstar, $85. Yeah, kind of expensive.) In order to make it work, I had to partition and format both as HFS. Later, when I installed OSX, I reformatted the OSX partition as UFS.

Then, for some reason, the install took a long time, like over 1/2 an hour.

I just found http://www.osxgnu.org where they have many OS X packages for important applications. There, I got the latest packages for OpenSSL and OpenSSH.

Open Firmware

The other important thing to do is get the latest OpenFirmware? upgrade from http://www.info.apple.com/downloads/ (the trailing / matters). It went okay, once I figured out that you press Command-Power and HOLD IT DOWN until you hear a long beeeeeeeep. Then you let it up, and the firmware updates.

Two more OS installs!

I was not happy with the disk performance. In OS 9, it was okay (not great), but in OS X, the drive thrashed around, and everything took two or three times as long as I expected. Something was wrong.

My first guess was my disk partitioning. I figured that doing it in OS 9 was wrong. So I followed the booklet's directions and partitioned from the OS X install CD. This time, I made the UFS partition first, and the HFS one second. Upshot: no difference. Disk thrashed a lot.

My second guess was the drive. I thought it might be slow. But, the drive was sitting unused over a month and I could not return it. Groan... So, I guesstimated that, at worst, I'm looking at a 30% slowdown. That seemed not to be the culprit. So I thought some more, and guessed it was UFS, and perhaps the thrashing was the OS being inefficient.

They call it Fast File System, but that doesn't mean a specific implementation will be fast. (Besides, I'm used to ext2fs, which is pretty fast.)

So, I did another install, with all the disk formatted as HFS. That did the trick! I still think the disk is a little slow, but the overall performance feels like my prior installation.

So, until Apple implements a better UFS driver, don't use UFS for OS X unless you need the security.

With every upgrade, I feel just a little more compelled to turn this iBook into a Linux laptop.

iBook Power Saucer Cable Break

If you have an original iBook, you'll notice that there are two metal "horns" on the inside of the hings that connects the screen to the keyboard.

[picture missing]

If you put your power cord in there, the horns will conveniently squeeze it, causing a short, and a big white spark. All is not lost, and there's no need to go and buy a new power saucer (aka power yoyo).

Here's the step by step.

1. Cut away the damaged part.

2. Cut away around an inch of the outer insulation on both ends.

3. Pull away the braided outer cable, and lightly twist it into a cord around 1/3 to 1/2 inch long. Do this to both ends.

4. You will see the exposed inner wire. of this, cut away just 1/8 to 1/4 inch of insulation. Don't twist this stuff.

5. Push the inner wires against each other, and roll it with your fingers so the wires "weave" a little bit. Now, with a low wattage (15 watt) soldering iron, solder the two wires together.

6. Repeat with the outer cables. That's it. Make sure you use at least 1 inch of thin solder or 1/2 each of medium solder on each. (And make sure it's electrical rosin core solder, not the stuff for stained glass.)

7. Wrap the inner cable in a couple layers of electrical tape. That's the hot wire. Then, wrap the whole thing up in more electrical tape. (Regular tape will do in a pinch, but, electrical will last a lot longer.) Make sure that the tape covers the insulation on both pieces of wire, to help relieve the strain on the solder joints.

From now on, you'll have to be careful not to break these joints.

[hr]

After another year or so, the wire leading right into the proprietary power plug started to flake out on me, due to flexing of the wire, so I ended up buying another power supply, this time, from MCE. These replacement adapters are around $40, which is less expensive than the official Apple adapters, which retail for around $70.

Once I got the new adapter, I tried to repair the old plug. What this involved was using a razor to cut away most of the plastic around the back part of the plug, exposing the bare wire. The outer braided part was severely damaged, and green greasy corrosion indicated arcing that destroyed the wire.

The fix was to strip away the insulation, preserving as much wire as possible, and re-soldering the wires together.

[hr]

The MCE adapter flaked out on me after a year. I thought it was the power regulator in the unit dying, but, recently (2004) I tried to cannibalize the cable to fix up the power saucer, which had been re-enlisted into service after the MCE flaked. The MCE adapter's cable cause the OEM Apple adapter to flake out too.

Not only that, but the problem had a similar symptom: if I put my ear up to the adapter, I could hear a "clicking" noise. I couldn't place this symptom at first, but, when I saw that it migrated wherever the MCE's cord went... that seemed to pinpoint it.

The MCE cable is weird, because it has a built-in choke coil. This is that big lump on the cord. Still, I could not believe it was the choke. They're just iron rings with wires around them. They don't contact the wires.

So, I decided to cut the choke off, just for the helluvit, despite my suspicion that it wasn't involved. At worst, I'd have an regular power cable, just like Apple used. So I cut it off, and discovered that the wires between the choke and the power plug on the MCE were damaged. Both the outer braied wire, and the inner wire, were broken. When I pulled on them, they pulled right out of the insulation!

Despite these breaks, the cables had tested okay with the continuity tester. They were both hanging on with just a few strands, however.

Overall, these Apple power adapters suck. The MCE replacement adapter sucked even more, and lasted only one year! The sad thing is that it's not the electronics that are at fault, but the flimsy and brittle wiring. Because the plug at the ends are proprietary, they're going to be expensive to procure. These market-protection schemes really annoy!

If the companies would just settle on a generic power plug, life would be a lot easier and these laptops would be a lot cheaper to maintain.