Wednesday, April 2, 2008

Zip Codes Database Table MySQL Export (2006 version with Latitude & Longitude)

As I had promised to myself and a few others. Here is a 2006 Zip Codes Database MySQL Export with latitude and longitude coordinates.

I had been looking for a zip radius solution for one of my projects and I ran into micah's zip code class online. The class is very nicely done; and I am very grateful for people like him who share their work with the world.

But I did notice that the database table for zip codes being used was a bit outdated; I tried to find a mysql export, or as I like to childishly snicker "dump", with the 2006 zip code public data I had found online. I could not find one readily, so I offered some time to transfer the data to a mysql friendly format that would work with micah's solution (If you would like examples on how I made a zip radius search with Micah's class just let me know!).

It is late and I still have much else to do. I have been able to transfer the data, but I do not have time to break it up into 5 mysql files. If you are kind enough to do so, please send me a zip and I will post it here. Thanks for reading. If you would like to support me, please link me, digg me, or perhaps click on one of the sponsors of which you find legitimate interest.

Without further ado, here is the zip code table export.
zip_codes_2006.zip

Labels: , , , , , , , , , ,

Saturday, January 12, 2008

server crash!!

So I run a few different websites with a few different companies. I have been buying up web domains or what I'd like to call virtual estate. But that is neither here nor there really... as I would like to be spending my time doing research on great domain names to buy up. Unfortunately at about 4:00 am I was going up to bed after a long night of watching bad movies and configuring domains. I noticed something was wrong with the server. I tried to login remotely and no dice... This is my personal server, where I do most of my development and host a few smaller sites. Luckily the financial impact is somewhat minimal at this point, but the frustration has taken it out of me.

As it turned out the server was toast, something happened to the boot sector and the OS, which had been suffering from another semi crash a few weeks ago, had decided to give way. It took me quite a long time to fix it as I was actually gullible enough to believe that I would be to able to repair the os properly. Well, I ended up re-installing SBS2k3... and now as I think back, I would recommend that if at all possible, go with Windows Server Standard Edition 2k3. Too much overhead with what I have deemed useless gadgets and services that are great for a small to midsize company, but not ideal if all you want to do is host a website and SQL Server. Why did I sign up for SBS then? It was a deal with the server.

So the quick lesson... code in php, use XAMP ;).

Just kidding - that's my preference, but I have a few clients that work with SQL Server/MSDE (and a few legacy systems I developed in classic ASP) - so that's not really a choice.

Anyhow, with all the frustration and and work to completely reinstall I came up with a few tips that might help - especially if you are trying to salvage your data:

- try to install a new os on a different partition. Do not create a new partition at this point. It is possible, but not likely you will succeed in creating a new partition AND save all your data. Didn't you make multiple partitions when you installed the system? Oh.. well, this is a good reason why you might want to do that.

- if you do not have a new partition to work on, or you really want to try to repair your system, try to the system repair with windows. Take out your cd-rom, insert it and boot with it. Do not press f2 on load up for the automated system restore... you will have to let the blue screen load until it prompts you if you want to (R)epair. You wan to try to repair your system (keep your eye on the screen).

This will overwrite all your major system files and try to restore your system from initial installation. If this is successful, you might get your system to boot, but you will then have to reapply pretty much all patches, service packs, and perhaps reinstall several applications.

I am no expert , more of a crazy mad scientist, so don't blame me if you mess your system up even further.

- upon finally loading the system, I was able to reinstall SQL server. If you know this trick, move on. But you can always go to databases, right click on databases- and choose the actino "attach database" file directly from enterprise manager. The system will prompt you for the location of hte data files. You can take the databases from your crashed os, and just attach them again. Although if you have sustained system damage, you might want to consider moving the files to a clean location.

- if you have mysql as well... also on the server... you can take the datafiles folder and copy and paste all those datafiles into your new mysql datafiles folder. Mysql Admin should recognize them the next time it checks the folder.

This saved me quite a bit of time as to how I was going to get the latest data from the databases since my db backups were not as current as they could have been.

- I was also able to reinstall FTPZilla Server to the same exact folder it was installed in previously, and this saved me from having to reconfigure.

- also had quite a bit of trouble getting php to work. I had it previously downloaded and tried to use the files I had previously. I took the latest version from Php.net and it worked fine. Normally, I like to archive versions I have worked with in the past for easy installation and recovery such as this case. Pros: For the installation of MySql, this was really handy. I tried searching online, and I am not sure what MySQL is doing, but they are making it seem harder and harder to find the open source free versions. After looking on my archive drive, I got it installed in 2 minutes. On the other hand, Sometimes trying to use older versions doesn't work in your favor to save time, as in the case of PHP.

- Now I'm running all sorts of checks, defrags, and drive analyses... but the server is back up and running. Hoping for a better Day tomorrow.

Labels: , , , , , , , , ,