Saturday, January 17, 2009

Bad Memory HowTo

So.. Memtest tells you have bad ram! Here are your easy options:
  1. Buy new ram
  2. Turn off everything after the bad memory* (mem=###M option)
  3. Turn off just the memory around the bad memory* (memmap=#M$###M option)
*May require moving RAM around in the computer for best results.

Testing The Memory
Tool 1: Memtest
There is the classic Memtest which is on every Ubuntu LiveCD and most other Free operating system CDs. It tests memory and gives you back fun technical numbers and also what sectors are bad in the easier form of 797M or 84M. It's the easier number we want. So try to write down the range (if applicable) of bad results.

Tool 2: Memtester
Memtester (click here to install) is like memtest only it runs from a command line once Ubuntu has loaded. It can't test your whole ram so you should make sure that it would be testing the area that memtest has detected being bad.
You absolutely need to run it with sudo/root.

WARNING: Don' try to test your whole RAM, just say 100M over where the error is. Doing really close to your actual total ram will make your computer unresponsive (unless you are following this with nothing but a shell, then you might be fine).

Ex. Let's say you have 150M taken up by your OS, the badram is at 797M (from memtest) and you have 1024M total memory.

This command would work:
sudo memtester 750M
Option 1 - Buy New Ram

Simple. Easy. Safest. Might be cheap if your computer supports new ram. Wastes hardware that we could likely get to work. Some people say that once RAM starts to go, it will just keep getting worse, I personally don't believe them.
I will not be liable for you losing data by using bad RAM. Use YOUR own judgment.

Option 2 - Turn off everything after the bad memory (mem=###M option)
This is simple take the lowest number from memtest, subtract let's say 3 from it for a bit of safety. Then add it to your kernel command line for bootup.
Ex. So for bad memory at 797M we would add to the default kernel options:
mem=795M
Option 3 - Turn off just the memory around the bad memory (memmap=#M$###M option)
WARNING: This is much less tested than Option 2. There may be bugs lurking about.
This isn't much more difficult. Instead of just stopping at 795M, we are going to stop at 795M but then only ignore the next 10M. If there are multiple places try to make a range that includes them both.

Ex. So for bad memory at 804M and 806M we could use:
memmap=10M$800M
But for this option I will fell better if you use memtester afterwards to make sure you actually got the right memory spot. (And maybe do it before too, too make sure you actually were testing the right spots in the test)

HowTo Kernel Default Options
Edit the file /boot/grub/menu.lst with sudo/root
(ex. sudo nano /boot/grub/menu.lst)\

Navigate to here
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=f0906667-bcde-4b64-86bc-5a47320d5517 ro
Edit the line (DO NOT GET RID OF THE #):
# kopt=root=UUID=f0906667-bcde-4b64-86bc-5a47320d5517 ro (add mem stuff here)
Then run:
sudo update-grub

Then reboot.

Thanks for following my HowTo. Many happy PCs and memory modules saved from landfills.

Wednesday, January 14, 2009

Open Maps; customizable in so many ways

OpenStreetMap.org
OpenStreetMap is best described as the Wiki of Maps. It is a Free (both libre and gratis) source of maps and map data. Having free access to the data means you can download it to your own GPS device and have a much more detailed map than most come with. From their Wiki you can find out how to download whole states, countries, or the entire world. Most of the US is already on the map thanks to US Goverment data, but there are plenty of input errors that you could help fix. Just get an account on the site and click the Edit button, (play around first), and then edit for real.
OpenStreetMap unfortunately doesn't let you plan routes, although others take the data and let you do that and you can of course do it yourself.

OpenLayers is the javascript graphical interface used by OpenStreetMap and many online maps which let's you customize how the data is displayed, display overlays, and customize how it is controlled and much more.

I made a simple map using OpenLayers which shows the range of four Digital TV stations in the NJ area.
Note: I made up the range to be 30 miles, it is actually longer (or shorter) and has many other issues I didn't consider (antenna, obstacles).

I've been thinking of ways I could build on to this idea, perhaps in conjunction with my every other month or so check of what channels OTA DTV is providing my area. Would anyone else want to collect that kind of data on an every other month basis? I think we could store the data in OpenStreetMap (you can make your own tags) and then use OpenLayers to generate a map based on that data.