Build Yourself An iPod Shuffle Charger

-- Note: Read all directions before beginning!

First, lay all the parts out on the table, and make sure that you have everything accessible.

Cut your usb cable in half and peel back the insulation so that you have all the wires out.

Strip the ends of the wires on the usb cable. Take the green, white, and black wires and twist them together.

Heat up the soldering iron and get it ready. Remember to always use saftey glasses when soldering!

Solder overview

The first solder you’re going to make is from the 9v battery clip to the voltage regulator. Solder the RED (+) wire to the INPUT on the voltage regulator. Check the back of the box to make sure, but this is usually the left-most pole.

Next, solder the white, black, and green usb twisted wires, AND the ground (-) from the 9v clip to the ground on the voltage regulator. This is probably the middle pole on the voltage regulator.

Finally, solder the (+) RED wire on the USB cable to the OUTPUT of the voltage regulator. This is probably the rightmost pole.

Solder overview

Next, double check your solder connections to make sure they are correct and there is no solder bleed-over.

Connector pinoutNow connect the + probe on your volt meter to pin 1 on the usb connector, and the - (black) probe to the other pins. On each pin the volt meter should read +5v. It is critical that you verify the output voltage for each pin. If you mess this up you could break your Shuffle!

If you are satisfied (and brave), connect the Shuffle to the usb connector. It should blink green, then yellow and green, and finally blink yellow steadily. If it does this, then your charger works. Congratulations! If not, check your solder joints and get your volt meter out again. And pray you didn’t fry your shuffle!

Case being packed

Finally, mount the parts inside the project case. I cut a notch on one end just wide enough for my usb connector, and filled the empty space with foam I had lying around from something I had shipped to myself. There’s no perfect way to do this. Just do what you think works. Heck you don’t have to mount it at all if you don’t want to!

Okay, now grab a beer and watch as your yellow light blinks on-off-on-off-on-off-on-off…

All connected

All connected

Geodesic Distance Function in PHP

I was working on some code to process some GPS track logs and I wanted to be able to accurately calculate the distance between 2 points in the log. I did some searches, but there were no obvious solutions written in PHP. However, I did run across Chris Veness’ version in javascript. I worked through his function and mashed it up as PHP. The result seems to work, but for me with slightly less accuracy than the javascript version. At this point the problems seems to be the limit on the number of significant digits that PHP is using vs. JavaScript. If anyone finds any other problems, definitely let me know.

Why is this so great? Not only is this distance based on a curved surface, but you can vary the ellipsoid model being used (see vars $a, $b, and $f) to get a result with even greater accuracy. Just to clarify, the HowFar function does require the points to be in radians, not degrees, so be sure to use the deg2rad function to convert your lat/long into a usable format.

https://gist.github.com/jeffmcfadden/a6c789424cd02ef3ad4a

How My Wallet Destroyed 4 Hard Drives

(And how yours could too)

Hard disk drives are a marvel of modern technology. With the ability to store the data of millions of books on a single hard drive, we’ve never been able to store more data at a lower price than we are now, and storage capacity is only going up while prices are only going down.

Even more amazing is the sheer complexity at work in a modern drive. The electrical, chemical, mechanical, computer, and magnetic engineering that must take place to develop a drive boggles the mind. A hard disk drive is truly a monument to modern technological achievement, and at only a couple hundred dollars a piece, most people have at least a handful in the various electrical devices around the house. From the TiVo to the family laptop to a camcorder to an iPod, hard drives are in more and more of devices we own.

With access to such cheap and powerful storage, it’s easy to overlook the fragility of modern disk storage — a lesson I learned the hard way.

In April of 2007 I received my first MacBook Pro from Apple. I was upgrading from a Powerbook G4 I had owned for 2 years, which had served me with only a couple of part failures (a bad battery and a hard drive that failed after a year). I took the new laptop home and started copying my data over. After two days I had it all setup. It was working wonderfully.

The Story

About 7 days after I brought it home I was checking my email with the computer on my lap when I heard a loud PING! cry out from behind the case. It certainly didn’t sound like a good noise, and the grinding that followed was even worse. My programs started to lock up and my computer would not restart. Dejected, I took the laptop to the Apple store, where a new hard drive was installed. Two days later I took the laptop back home and spent days reinstalling software. I was partially surprised that there was a failure so soon in the life of the laptop, but hard drives do die, and some die quickly.

Back up and running things were going well until 4 days later when it happened again. I was opening up the laptop when PING! went the computer. The repair kept me computerless for 5 days.

With the second failure I was skeptical that this computer would ever work right, and my doubts were validated when the THIRD drive failed after only another 10 days. Same as the first two, pinging, clicking, and grinding signaled the death of my laptop.

This time the technicians at the Apple store heard my cries and replaced the unit. I walked home with a brand new sealed in box laptop, glad that my hard drive problems were over.

At least for 5 days anyway.

That’s when it happened for the FOURTH time, on a completely new computer. I was surfing the web on a Saturday when I heard the ping of death. My heart stopped and I wondered if I was cursed.

When I took the laptop in they interrogated me for a while and eventually I left with a third brand new laptop (thank you Apple). As I was walking out of the store one of the questions a tech asked me rang again in my mind: ‘Did you expose the laptop to any strange magnetic fields?’ Of course my answer was ‘No.’ I couldn’t think of one. But then as I was leaving it occurred to me that my money clip wallet, which sits in my front pocket, does have a magnet. ‘But surely the laptop is shielded enough that couldn’t matter, could it?’ I wondered.

As I pondered more and more it seemed plausible. Every failure followed a session using the notebook on my lap. And as I read up on hard drive operation it seemed evident that if you could get a magnetic field to reach into the drive, you could definitely destroy it.

That’s when I realized that we had to do an experiment. What we discovered is terrifying: modern hard drives are much more fragile than we often consider, and exposure to even weak magnetic fields from close range could render a working drive absolutely useless.

The Experiment

While it was suggested to me to purchase a notebook hard drive, expose it to a magnetic field, and see if we could break it, then return it to the store of purchase, I thought that a bit risky, unethical, and potentially pricey. Instead, I opted to do some simple testing under the premise that if we can get a magnetic field into the drive operating area, then we can conclude that it is plausible that said magnetic field could ruin the drive. In other words, if the magnet can affect the drive at all, consider the drive dead.

Enter my old Hitachi 2.5′ notebook drive. It failed after one year of service, and I opened it up to see how it looked inside. Since the drive was already dead, it seemed like the best test subject.

Here is the plan:
1. Place iron filings onto disk surface.
2. Expose disk to magnets from varying distances.
3. Look for fluctuations in filings when exposed to fields.

First, we get some filings (filed from a piece of steel lying around) and dump them onto the drive. Now, we get out the money clip. First we’ll test with the magnet that I think might have killed my computers, then we’ll test with other sources if that yields no results.

The first test is startling. Not only does the field easily penetrate the bottom of the drive, it’s incredibly strong at the point of the top of the platter.

Moving the magnet away continues to yield disturbing results. We were able to make the pieces dance from a range of upwards of 5cm away!

And lest anyone ask, the top of the case has no obvious shielding properties.

Test Video

So What?

In plain english, any moderate magnetic field, from a speaker to a fridge magnet, could potentially disrupt the magnetic field of a hard drive, rendering it unreadable. Keeping all magnets of any kind far away from drives is vital.

The Conclusion

Hard disk drives are remarkable pieces of electronics. They incorporate a variety of technologies to store the valuable information that we create each day. But for all their amazing qualities, we find them to be startlingly fragile. If ever you were looking for evidence to reinforce the need to spread data around as you back it up, look no further than the above.

As for my laptops, most likely the money clip’s magnet interfered with the operation of my hard drives (all four of them), causing the destructive effects that I witnessed. While perhaps not perfectly confirmed, this myth is definitely plausible.

Appendix: Obvious Questions

Since undoubtedly someone will ask these questions, or argue that this test is unreasonable, here are my thoughts on the most likely rebuttals.

1. You didn’t prove the drive would actually die. You just moved metal filings.

True. But if a magnetic field can get into the platter region it can interfere with the fields already in place, and since both movement and data storage/retrieval rely on magnetic actuation, it is perfectly reasonable to conclude that the drive would be damaged in some way.

2. You didn’t take the laptop case into account.

Also true. However, in the case of my powerbook, the aluminum case provides little to zero effective shielding. The hard drive is located on the bottom of the case, in the front left corner. The effective distance in a real world scenario would be approximately 1cm. We were able to move filings at least 5cm away from the magnet.

3. Not all laptops have the drive in a similar location.

Also true. And that does matter. Had the drives been on the other side of the case they probably never would have been affected by the magnet in my pocket. But since the magnet could easily penetrate an entire plastic case from bottom to top, no modern unshielded laptop seems secure.

Additional Information

Flickr Photo Set
The Flickr set with all the photos taken for the experiment.

How To Get Free Topo Maps

I really like a good map. A GPS + Laptop is great, but nothing works like a piece of paper when the batteries go dead or your laptop falls into the lake. Unfortunately, finding high quality topo maps for free is a chore.

When I first started searching for topo maps all I was able to find were those provided by Jared Benedict over at redjar.org. Then he started the map ransom project, which finally freed the maps. Now you can download any of the US Quads you want over at libre map. The drawback here is that the topos are all 100dpi scans (for most of the quads). Depending on how you print them, it can be difficult to make out some of the details.

Well, after some more searching I was directed to the USDA Forest Service geospatial data clearinghouse. Here you can download high quality (300dpi mostly) raster TIFs of the same quads, produced by the NFS. One great thing about the NFS maps is that the forest roads are all numbered.

The downside is that some of the NFS maps don’t have roads the USGS topos have, and vice versa. In practice it’s definitely best to have as many maps as you can of an area if you want to have the best coverage of an area.

Pseudo Patriotism

I am so frustrated lately by this pseudo-patriotism that serves merely as a whitewash to cover a deep and growing arrogance.

Let me explain myself.

As I've grown up I've been somewhat infatuated with my country and the values that it was founded upon. Freedom. Freedom from oppression. Freedom of speech. Freedom to criticize. Freedom to protest. Freedom to choose your own governmental representatives. Opportunity. Opportunity to work. Opportunity to serve. Opportunity to protect our liberties. For those values I have been, I am, and I always will be willing to lay down my life. Those are values I hold dear. They are blessings and should be viewed as such.

Yet as time has passed America has become infatuated not with the truths she was founded on, but infatuated with herself. A deep arrogance has begun to blossom. We are a conceited people, who demand vengence for the wrongs done to us not so much because they were horrible deeds, but because they were done to us, Great and Mighty America. Who art thou to challenge our greatness? Who are you to pick on us? We have become the self-concious bully on the playground, seeking to get revenge for the sand thrown in our eyes. I do not consider the events of Septemer 11, 2001 as insignificant. Thousands were murdered that day, and I consider that the most abhorrent of evils. I cannot articulate the sorrow and anger that wells up inside of me in response to the horrors committed. Yet also I find that I am deeply incensed at this conceit that wells up out of the general population. It is as if with one voice all are crying out, "How can you harm us!? As Americans we have a right not to be attacked! How dare you hurt might America!?" But who is standing and declaring the injustice that was done, and in turn crying out not for vengence, but for justice? On the surface it may seem insignificant. In either case, in fact, the response may be the same. But the underlying attutudes and motivations deviate wholly from that which this nation was established on. For when we seek not justice but vengence, we are becoming like the very evildoers who delivered that vile evil against us. Do we seek revenge or justice? An eye for an eye or the rod of discipline? Our we motivated by hatred or righteous anger? Are we filled with integrity or a blood lust?

If patriotism now means that I must declare my own existence more important that the existence of someone else on this earth, then I shall have no part in it. But if I can be part of a patriotism that declares that all men truly are created equal, that justice must be upheld, that freedom and libery are great blessings to be held onto with joy, that these blessings are only considered "rights" when those who are given them are blessed with a government who acknowledges these truths, and that we have no place to be arrogant because we ourselves are but stewards of these great values, then show me the way, for I will spill my blood first to defend this form of patriotism -- a patriotism upon which that "Great America" was built.

AT&T and My 8260

ATT Wireless is great. The Nokia 8260 is not.

Back in January I dumped SprintPCS for ATT and purchased a brand new Nokia 8260. At first the service was great. ATT was much more reliable than Sprint, and their customer service was so far beyond Sprint it isn't describable (though Sprint is so atrocious I'm not sure it would really take much). Then everyone started to sign up with ATT. And I mean everyone. Half my friends and several fellow employees at work jumped on the ATT bandwagon as they lowered their prices. With all these new customers ATT should be doing well right?

Apparently there have been so many new customers that ATT is struggling to keep up with all the new signups. Their infrastructure is being pushed to the limits, and as a result they've had to cut back on the bandwidth they allot to each user per call. Now for most users this really doesn't make too much of a difference. A few more pops and crackles here and there maybe, but that's pretty much it. But not for an 8260 user.

The Nokia 8260 is a sexy little phone that I had wanted for quite some time before I purchased it. Small and light, I was excited to get my new phone. The problem, however, is that the 8260 has an equally small antenna (internal no less) to go with its small case. This normally isn't a problem, but when ATT started to cut back on their bandwidth the 8260 just couldn't keep up. So for the last 4 months I've been having lots of problems. This week they became unbearable.

When I first started having problems with my phone (lots of dropped calls, missed calls, fast busy) I called ATT and complained. After thoroughly explaining my situation and going through a lot of tests they sent me a new 8260. This seemed like a good deal to me; at the time I still thought maybe I just had a defective phone. Then I started talking to others and found out that the 8260 is quite notorious for horrible reception, especially in the conditions I've been using it in. One friend has gone through over 5 8260s. Thus I wasn't very surprised when my new phone didn't operate any differently than my old one.

So today I called ATT up and made my case. They sold me an 8260 that was supposed to work on their network. I bought it in their store, and didn't even get a substantial discount on it when I purchased it. Now the phone I bought from them doesn't work on their network like it is supposed to. John at ATT looked back through the list of previous calls I had made to ATT explaining how my phone sucked and suggested that we try to find me a new phone. I heartily agreed. He offered me the 3360 for 29.99 after rebate. I explained that I already bought a new phone and I didn't want to buy one again. This was their fault the phone didn't work (indirectly) and paying for a new phone was not what I wanted. John agreed and credited my bill the 29.99. The phone will be FedExed overnight. So in another day or so I will have a new phone that should work and I won't have had to pay for it. This is why I am a big fan of ATT. They go out of their way to help the customer, and are willing to do things like send me a new phone for free to keep me as a customer.

Sprint, on the other hand, keeps sending me bills for $0.00 every month. Apparently they aren't willing to stop billing me. These bills are annoying, but part of me is very satisfied when they spend money every month to send me a bill for $0.00. I can't tell you how refreshing it is to deal with a company who's policy is, "solve all problems in one call," rather than, "Make sure the customer knows they are lucky we are letting them be our customer."

Fireplace

The soft footsteps echoed throughout the hall with a rhythm that indicated a relaxed pace, with a hint of eager purpose. As the echoes grew louder, the pace became very slightly brisker. Louder and louder the steps came, closer and closer, faster and faster. Suddenly they stopped. The echoes died slowly and reluctantly, fading into the unseen walls.

Slowly the knob on the heavy oak door slid to an inverted position. The door slid sliently on its huge brass hinges, opening half way.

His stature was surprising, his footsteps having betrayed his small frame. Yet, as he entered the small room it was as if the entire room bowed in deep respect. He quietly closed the door behind him; the deep brown of the oak came into contact with the cold concrete, briefly awakening the echoes in the hall. He then turned away from the door and sighed a deep, heavy sigh, emptying himself of all the pressures and stresses life had placed on him.

Cautiously he crossed the room, as if to maintain composure and thus keep the respect of the room. With each step the soft carpet bowed its thick fibers to his feet, cradling them as one would a small child.

Across the room he bent down and took up a small stick with a hint of white on one end. Dragging the thin peice of wood across the concrete he brought to life a brilliant point of light that showered the room in brilliant white. Leaning forward a bit he placed the small flame in the fireplace. Like an energetic child the flame excitedly grew and soon a brilliant fire was crackling and popping and hissing to an unknown tune.

Satisfied, he walked the small distance to the only peice of furniture in the room, a small, black leather chair. For a moment he admired the chair. Crafted by the finest leather craftsman in the region, the care taken to ensure quality showed. Each stitch was exquisitly and perfectly made. The dark stain of the cherry wood reflected the crimson carpet to produce a deep maroon that danced on the wall with the flicker of the fire.

Having completed the necessary appreciation of his chair, he turned slowly around and sat down as carefully as possible, as though he was not certain it would hold him. Softly he sank into the rich leather, creating a small swooof as he did so. The leather held him up with the care one uses when handling an infant. Placing his head back in the chair he closed his eyes and sighed another sigh, from deep within him. He opened his eyes again to watch his cares float gently into the fire and disappear up the chimney.

Content with his new state of mind, he turned his gaze to the window. He was stunned at what he saw. He had sat in this chair many nights before, but never had he seen anything like this. As he stared out the window he saw millions of thin white saphires falling from the dark night sky, reflecting the deep gray of the moon upon the snow covered hills below. As the saphires fell before the window they danced with delight at the flickering fireplace, brightening the snow outside the window with trillions of swirling, flowing sparks that appeared for hardly a moment before disappearing again into the gray from which they came.

Beyond the small hills lay the deep forest, now a blanket of silver in the distance. From behind the cover of the brush one was likely to catch the glimpse of glittering eyes as they peered out from the depths toward the sparks in the distance. In front of the forest hopped a small snow rabbit in search of shelter. He stopped momentarily to gaze at the gala of light before continuing on his way. A young doe walked slowly across the hill, returning to her home deep within the depths of the silver blanket.

Suddenly two eyes appeared right before the man. Startled he jumped to his feet and readied himself for the threat before him. Startled himself, the masked creature squealed and skittered across the silver hills toward the forest, writing his path in the snow as he went.

The man sighed and sat back into his chair, not quite as carefully as before. Considering the event that just took place he smiled to himself and chuckled. Soon his chuckle turned into a deep full laugh that enveloped the entire room and leaked out onto the hills outside the window. Still laughing, the man reached beneath his chair and removed his book, opened it to the page that was marked, and he began to read.

Web Hosting Nightmare

A little over a year ago (February 2000) I registered my own domain - whoark.org. Whoark is a magical word, and if you want you can read all about it. Having the liberty of running several linux boxen at work, I thought it would be cool to run the site on my own box. I could handle all the details and make any changes I would want without having to ask a tech for help or permission. The only problem I was worried about was how to handle the DNS. Then I found out that register.com provided me with the option of controlling my DNS info on their DNS servers. Excited, I quickly set up my site on my box at work. My friend, Kirk, ran the main site on a box of his, while my subdomain and mail was handled on my box. Everything worked, and everything was fun for a year...

Then on April 4, 2001 I was visited from two guys from IT letting me know that it was against policy to host any outside domain on the network. Truth is I sorta (okay, not sorta) knew this, but I had (and still have) about 0 traffic, so I figured it wouldn't be a big deal. They informed me I needed to immediately remove my domain from the network. So I went to register.com and pointed my site to my friend's box. Of course, the domain didn't work, but it didn't generate a not found error and it wasn't pointed to my box at work, so I wasn't violating policy. Immediately that afternoon I started looking for hosting places.

The first I stumbled upon was Liquid Web Hosting. LiquidWeb seemed to provide me with everything I needed (subdomains, lots 'o space, mail accounts, ftp, ssh, etc.) The only thing they didn't offer was IMAP mail, but I knew I could always forward to my box at work without violating any policy. So I signed up right away and waited eagerly for my account to be setup. By Sunday afternoon my account still wasn't setup and I was getting pretty anxious. So I filed a trouble ticket and was informed my account would be set up asap on Monday. I figured no big deal, and waited until Monday. Monday came and my account was activated, just like I was told. I happily and quickly updated register.com to point to my new dns servers and uploaded my site. I setup my subdomain and mail and got ready to have fun. SSH worked fine, and I was very happy. Then I think it was tuesday night, ssh stopped working. I could no longer access my site. I filed a trouble ticket and they said they were working on it. I didn't mind too much, but I was annoyed. So I went to make my site updates via blogger, the greatest web log utility in the world. I made the setting changes I needed to and went to publish my updates. "Generating files...transfering files...transfering files...transfering files... error getting input/output stream" Hmm. I couldn't for the life of me figure out what the problem was. I could connect to the box via every ftp client I could find, and I could use blogger to publish to other sites, so I couldn't figure out what was going on. Turns out I never did figure it out. But that wasn't the last straw...

SSH finally came back (at least that's what they told me). Turns out they updated to OpenSSH. Turns out for some reason my client (the official client) wouldn't work. Their response? "Try another client." Try another client! If you can't support the official client, what the freaking heck are you doing?!! Suffice it to say I prompty started looking for new service.

Finding another site proved difficult. I searched everywhere I could think. I hit google and slashdot each about a million times. But I couldn't find anything! Then finally I was reading a post at /. and I found a reference to Hurricane Electric. I went to their site to check them out, and they seemed very professional. The price was right, but I couldn't verify whether they offered subdomains or not. So I emailed their support and asked. They wrote back and said they did offer it as an additional $10 a subdomain, but there was a workaround if you didn't want to pay. Well, I figured right there that if they were willing to give me a workaround I was definitely interesting in being a customer! So I signed up, changed the DNS again, and followed their instructions for setting up my subdomain. After waiting a couple days for the DNS to change over, I found that my subdomain wasn't working. Everything but my subdomain worked fine. So I tried different configurations. Actually about 8 different configurations. The problem was that it took quite a wait to test each one because I could only make a change once a day. It took waiting until the system-wide update each day at 5am. After a week I just had to give up. I would like to say that HE was a great place, very professional, very helpful, very secure, and very knowledgable. Also, they're in the same building as MAE-WEST!!!! I was sad to have to leave, but my site wouldn't work. So I started searching yet again.

Finally this week I found Interserver. I found them by accident actually, but PTL I found them! They claimed to offer everything I needed (except IMAP of course, but I just don't care anymore and forwarding works fine). I signed up and check to see if I could SSH and Blogger in. And they worked! DNS took quite a while to change over (almost 60 hours) and my work was cacheing the old ip forever, but finally just before I left this afternoon it worked! So now, 21 days after the nightmare began, my site is up again. At this point I have no desire to ever change hosting companies again and I'm very frustrated at the hosting industry in general. But my site works, so I'm pleased with that. And kudos to Interserver! They're working great. Keep up the great work please! I don't have much hair left to lose after this fiasco!