Author Archive
Testing RAM on a Macbook Pro
My Macbook Pro came with 4GB of RAM in 2 2GB modules. In December, I ordered 8 GB (2 4GB modules) of RAM from Crucial so I could max out the RAM in the machine, as I intend to keep it for a while.
Early in January I started to see applications crash. VMWare Fusion became almost unusable. I had never seen this behavior from my Mac before, so figured the new RAM had something to do with it, but wanted to verify my assumption before blindly blaming Crucial for bad RAM. At that point I had to learn how to best test RAM on a Mac.
On a PC, I would have booted a CD running memtest86, but none of my Internet research indicated that was possible for the Mac.
Instead, I had to install memtest and boot the machine into single user mode in order to run memtest with the least amount of interference from running programs. I wanted to document what I had done in a blog post so I could remember next time.
Note: This article involves configuring your Mac in a way that could make it difficult for you to boot it normally if you don’t know what you’re doing. If you don’t feel comfortable following these instructions, take your Mac to a technician who not only feels comfortable fixing your computer, but is also competent to do so.
To tell the Mac to boot into verbose 64-bit single user mode, go to Applications/Utilities/Terminal, and type:
sudo nvram boot-args="-s arch=x86_64 -v"
You may be asked for the password you type to make changes to the system, type the password and hit enter.
Reboot your Mac.
Your Mac will boot to a prompt. You may be surprised at all of the text that goes by. These are kernel messages that are normally hidden by the nifty Apple logo.
At the prompt type:
memtest all
This will attempt to test as much RAM as it can. Remember that some of your RAM is being taken up by minimal amount of software that booted your machine into single user mode (the kernel and bash), so you won’t be able to test everything, but if the flaw was in the RAM being used by the software running at this point, the machine would have failed to boot.
If your RAM is good, the test will take hours and you will see something like:
Memtest version 4.22 (64-bit) Copyright (C) 2004 Charles Cazabon Copyright (C) 2004-2008 Tony Scaminaci (Macintosh port) Licensed under the GNU General Public License version 2 only Mac OS X 10.6.6 (10J567) running in single user mode Memory Page Size: 4096 System has 2 Intel core(s) with SSE Requested memory: 7555MB (7922552832 bytes) Available memory: 7555MB (7922552832 bytes) NOTE: Memory request is too large, reducing to acceptable value... Allocated memory: 7343MB (7700721344 bytes) at local address 0x00000000101000000 Attempting memory lock... locked successfully Partitioning memory into 2 comparison buffers... Buffer A: 3671MB (3850360672 bytes) starts at local address 0x0000000101000000 Buffer B: 3671 MB (3850360672 bytes) starts at local address 0x00000001e67fd760 Running 1 test sequence... (CTRL-C to quit) Test sequence 1 of 1: Running tests on full 7343MB region... Stuck Address : ok Linear PRN : ok Running comparison tests using 3671MB buffer... Random Value : ok Compare XOR : ok Compare SUB : ok Compare MUL : ok Compare DIV : ok Compare OR : ok Compare AND : ok Sequential Increment:ok Solid Bits :ok Block Sequential :ok Checkerboard :ok Bit Spread :ok Bit Flip :ok Walking Ones :ok Walking Zeroes :ok All tests passed! Execution time: 7068 seconds.
If your RAM is bad, you will likely get a response really fast, and you will see something like:
*** Address Test Failed *** One or more DIMM address lines are non-functional.
or
FAILURE: possible bad address line at offset 0x06b3a4c8.
or
FAILURE: 0xbea1ce76 != 0xbea1ce7e at offset 0x06b3a4c8.
or
*** Memory Test Failed *** Please check transcript for details.
If you get a message like:
Attempting memory lock... ERROR: Memory lock failed - reason unknown. WARNING: Testing with unlocked memory may be slower and less reliable
hit CTRL-C and make sure you booted into 64-bit mode by typing the following:
uname -m
If the command doesn’t return x86_64 then you are not running in 64-bit mode and your Mac can’t reach the RAM above 4GB. Please reference the above command for booting your Mac into single user mode, as it includes the flags to set it to 64-bit mode, then reboot.
If the command above does return x86_64, then you are running in 64-bit mode and this message is probably a preview of test failures to come.
If you have more than one module of RAM, then take all of them out, and place one in the machine, boot, and run the test. After that one finishes test, note the results, turn the Mac off, take the RAM module out, and put the next one in. This way you can figure out which module is bad.
When done, make sure you have good RAM in the machine, boot it again, and type:
sudo nvram boot-args=""
This will give you your “normal” Apple logo screen on boot.
I hope you will find this article as useful as I will the next time we need to test RAM on a Mac.
Today, Crucial was nice enough to send me some new RAM after I sent them the bad module. So far, it appears to be passing memtest. Cross your fingers for me!
Copyright © is not enough
Tonight’s Digital Libraries class covered Copyrights, Patents, Copylefts, and other intellectual property concepts. This is especially important in the digital libraries world because the laws surrounding intellectual property make preservation challenging.
An important take-away from tonight’s lecture was that merely placing “© 2010 Shawn M. Jones” at the bottom of my pages is not merely enough to protect it legally. A notice must appear somewhere on the site for its content. Several years ago, Lawrence Lessig created the Creative Commons license to allow those on the Internet to share their work while retaining their copyright to said work.
To provide a license for this blog, I’ve filled out the form on the site and followed the directions on the web site for linking to the chosen license, like so:
the Little Projects of Shawn M. Jones by Shawn M. Jones is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
We’re quite lucky to live in an era where folks are willing to do the legal legwork necessary to make this happen. I’m happy that it’s even held up in court.
Finding a kernel on the web
One of the great agonies of a human being is searching for that little kernel of knowledge that actually answers their question. Within a traditional library, one would ask the reference librarian to lead them to the documents that, hopefully, answer their question. On the web, we use search engines as if they were reference librarians, and search engines are a poor substitute, but they are all we have for now.
Within a traditional library, the information about a book (metadata) is stored within some system (e.g. MARC), and this system is linked to some library classification (e.g. Dewey Decimal) for finding it on the shelf at a particular library. A whole profession exists for making this happen. Book metadata is chosen by professionals so that said book can be delivered to the person looking for the information within. These professionals (catalogers) are the gatekeepers of the whole system. Without them, the books might as well be strewn about.
On the web, there is no central authority. Every site is responsible for its own content. Search engines like Google use complex algorithms to try to find something that answers your question. Web site owners must take it upon themselves to not only ensure that their site stays consistent and correct, but also that it has metadata for these search engines to use to find them. Though Search Engine Optimization (SEO) is largely used to ensure potential customers find businesses, it is also important in helping users find the information they are looking for.
Now that I am aware of the importance of such metadata, I have installed a plugin for WordPress on my blog that generates Dublin Core metadata elements. These metadata elements are supposed to help others find articles like this one via search engines.
This plugin takes the existing metadata I was already supplying for each post, and places it in the header of the HTML at the top of the page, like so:
<meta name="DC.publisher" content="the Little Projects of Shawn M. Jones" /> <meta name="DC.publisher.url" content="http://www.littleprojects.org/blog/" /> <meta name="DC.title" content="Finding a kernel on the web" /> <meta name="DC.identifier" content="http://www.littleprojects.org/blog/?p=188" /> <meta name="DC.date.created" scheme="WTN8601" content="2011-01-19T23:52:11" /> <meta name="DC.created" scheme="WTN8601" content="2011-01-19T23:52:11" /> <meta name="DC.date" scheme="WTN8601" content="2011-01-19T23:52:11" /> <meta name="DC.creator.name" content="Shawn M. Jones" /> <meta name="DC.creator" content="Shawn M. Jones" /> <meta name="DC.rights.rightsHolder" content="Shawn M. Jones" /> <meta name="DC.language" content="en-US" scheme="rfc1766" />
I don’t really expect the search engine rankings to go up, but the real win here is that I’m helping others index my site in case I’ve actually provided exactly the information someone is looking for. In a way, this is a form of SEO, but it gets back to that cataloging spirit originally found in the library. There is no common list of tags or subjects for the web that we all must adhere to, but little steps like this bring us closer to finding the information we are looking for.
Take a look at the source for some of your favorite news sites, you’ll probably see the same metadata in their headers too.
For futher reading:
Lil’ bit: scp and echo statements in your login scripts
For years, I have used scp to transfer files between Unix/Linux machines. I noted quite a while ago that having an echo statement in my login script (in this case .bashrc) caused the file transfer to fail, so I removed all echo statements from login scripts, using them only for temporary debugging. Today, I believe I have found the way to have my cake (use scp to copy files) and eat it too (leave the echo statements in the login script).
If your .bashrc looks like this:
#!/bin/bash echo "Running the .bashrc file" # correct spelling mistakes shopt -s cdspell # save multiline commands in the command history shopt -s cmdhist # some useful aliases alias c='clear' alias ls='ls -p' alias vi='vim' echo "done with .bashrc file"
And you connect via SSH, you’ll see the following:
[me@otherhost]$ ssh myhost me@myhosts's password: Running the .bashrc file done with .bashrc file [me@myhost me]$
Which is fine for an SSH session. In fact, you might even ask questions of logging in users, or dump an entire warning banner to the screen to indemnify you for legal reasons. Many interactive possibilities exist.
Now say you wish to copy a file from one server to another:
[me@otherhost]$ scp myfile myhost:~/ Running the .bashrc file
Once this is done, you only see the output from the first echo. What’s worse, the copy never happens. Some claim this is a bug. The fact that the bug was reported in 2000 and still exists in scp indicates to me that the scp authors don’t consider it a problem.
The solution is in testing for the existence of a terminal:
#!/bin/bash if tty > /dev/null 2>&1; then echo "Running the .bashrc file" fi # correct spelling mistakes shopt -s cdspell # save multiline commands in the command history shopt -s cmdhist # some useful aliases alias c='clear' alias ls='ls -p' alias vi='vim' if tty > /dev/null 2>&1; then echo "done with .bashrc file" fi
Now scp will work without any output to the screen. More importantly, your files will be copied:
[me@otherhost]$ scp myfile myhost:~/ me@myhost's password: myfile 100% 1896KB 1.9MB/s 00:00
Thanks to the forums on Ars Technica for leading me to the answer to this issue. As that post existed in 2000, I now see why the openssh folks haven’t “fixed” scp.
This site is a blog
I’ve resolved that what I’m really looking for in a web site is a blog.
I wanted the site to do the following things:
- allow me to publish blog posts, which I was already doing with WordPress
- allow me to publish the occasional article, which I seem to have little time or inclination to do, so I ditched Drupal
- allow me to publish photos, for which I’m currently using Picasa Web Albums
I’m maintaining my own site on my own server for the following reasons:
- Blogger was too slow to load on many of the networks I experimented with
- WordPress has more features than Blogger.
- WordPress is open source, and I can learn about this nifty piece of software by running it myself.
- I had already moved my mail services off of Gmail and onto my rented server, and wanted to consolidate my web services there as well.
- I love messing with a Linux server in my spare time.
We’ll see how far this Intel Celeron 2.53 GHz machine with 1GB of RAM will get me.
