Tuesday, August 14, 2012

Raspberry Pi in the Classroom

I posted this today on an ed tech listserv and figured it's worth getting out here, too.

The Raspberry Pi is ready for prime time in the sense that the one-per-order restriction has been lifted and you can now purchase as many as you want. I've been tinkering with one this summer and I keep coming back to the question of what will we do with them in our schools. I think it's an urgent question which I'll explain as I go (sorry for the tl;dr).
The Raspberry Pi is a $35 computer. $35! (The one with only 1 USB port and no Ethernet is $25!) It's the size of a bar of soap. It comes with no case (yet); you have to make one. No I/O devices, just a board and ports. That number still doesn't compute for me, but consider how many you could get for an iPad. But you might say well then you have to get a monitor, keyboard, and mouse, at least. Actually, all you really need are a power supply (mine runs on a Blackberry charger, even 4 AA batteries will work), an SD card (the only storage!), and a network connection-either Ethernet or several wireless adapters will work. Then what? It's Linux, so you can hook it up to a monitor and keyboard just to enable SSH and create a few accounts and tunnel in from any computer on your network. And besides, the educational value of an iPad lies in all the apps you have to purchase, not to mention the time and expense of setting up an infrastructure that makes collective use feasible.
But cost is somewhat beside the point. Well, though, certainly not for public schools or cash-strapped independent schools. The main point is that it is nothing like the experience of an iPad, in fact it's the antithesis, and a sorely needed one, which is really the point made by the Raspberry Pi Foundation. Where the iPad (sorry, I really mean all proprietary devices) should work out of the box, you must hack your world and the Raspi just to make it work (hmm, i have to buy a charger...do I have any 5v chargers around? How do I know if it's 5v? wait I don’t have enough USB ports for a mouse, keyboard, and wifi adapter…ok a non-powered USB hub won’t work but a powered one will, why is that? Oh, there’s some help here, http://elinux.org/RPi_VerifiedPeripherals#Working_USB_Hubs, …now, a monitor, what, no VGA? Wait, I can plug it right into my 64” TV?!? And it looks awesome! etc, etc). Where the iPad wants you to think you don’t need to know anything about computers to use it, the Raspi forces you to learn just to get it to do anything. I didn’t know anything about Linux before I got this and now Linux is blowing my mind. I’m realizing the power, control, and options you can have with a computer if it’s designed to let you have those. Combing Linux forums for basic information I’ve read so many answers to queries that start, “Well, here are 4 ways you could do that…”
So getting back to the question of what to do with this device I can see it doesn’t belong as a standard integrated device like the iPad is becoming or laptops have been. It’s all about getting back to the basics of computer science and even physical computing. It belongs as a standard device in these makerspaces we are talking about and developing. It can do anything you want it to, really (though running it as a media server at home was a bit more than it could handle with 256MB of memory on board). We need to be alongside interested students helping them think about what they want to do with it and then guiding them through the mind blowing experience of learning how to get Linux to do anything you want with the decades of crowdsourced information you can tap into out there. I can see coming up with some really creative applications and having people see it and say, “What, a computer can do that?!? Wait, that’s a computer?” It’s really akin to the Arduino, in fact people are figuring out how to get the two to work together (http://www.raspberrypi.org/archives/1171). Interesting side note, this link is to a post about some resentment on the part of some in the Arduino community and makes the point that the two are fundamentally different and in fact can work well together, and I realized in looking at the accompanying photo that that difference is represented in a striking way by looking at the USB ports, where one uses the host type A port and the other the target type B.
Anyway if you’ve read all this thank you and I would love to hear your thoughts. 

Friday, August 10, 2012

Hack Time Machine Backup with Linux

If you need to get your files out of a Time Machine backup but you don't have a Mac, look no further. Get a computer with Linux on it. I'm using Ubuntu 12.04 but mostly you will just need to use the standard Linux shell terminal. It will be a painful experience, but hopefully a few things I've learned will help ease the pain a bit.
I started with Carson Baker's very helpful blog post on this which draws the basic map very clearly and succinctly. I needed to do a little research to clarify what he meant by cd'ing to the /media/Time Machine/.HFS+ Private Directory Data folder because you can't just type that in the terminal and get anywhere. In his comments he explains the use of tab-completion, which is amazingly helpful to know about.
In my case I cd'ed to the root level of my external drive, then typed .H, hit tab, and the rest filled itself in. That's voila for you! You can see it does mess with the spacing on the terminal command line, overwriting itself. But you get used to it.
Following his directions to figure out the hard link codes I found my backed up Pictures folder, which contained a Shoebox folder, for the app I had been using to store photos. Inside that is a folder for each year I've been using it for photo storage.
Listing the folders I discovered a huge problem. The photos for 2012 were there but the other years were simply more hard links! I had to find their hidden directory codes and cd to their folders. One thing I did to make the task a little easier is to write those codes to a file: ls -ls > /home/usr/Desktop/dirs.txt.
Looking further into the sub-folders for each year, my next problem was some contained a mixture of actual folders and hard links, which I had to get codes for, etc.
The above was the result of listing the contents of 2011, the folders being the months. So I needed to write those to a file for reference.
What a mess. Now the intact folders could be copied directly over very easily:
cp -rv . /home/usr/Pictures/2011. The copied hard links had to be deleted: rm -v /home/usr/Pictures/2011/01, etc.
Now one more level down are the folders for each day there were pictures. Inside those are the actual image files. These were also mixed folders and hard links. Rather than going through these one by one, finding the code, copying each day's folder, I made a script to automate at least this part. It creates the directories in the target drive for each missing folder (represented by a hard link), cd's to the coded directory for each, and copies the pictures over. All of that data has to be hard coded so that's a pain, but here's what it looked like.
The folders for July, 2011 looked like the above. Only 2 folders could be copied straight over. I saved the long form data to a text file: ls -ls > /home/usr/Desktop/dirs.txt.
That revealed the codes for each missing folder. I used that to write the following script and run it from the terminal in the top level of the .HFS+ Private Directory Data folder.
When it's moving all those files it's a beautiful thing to see, but it sure is a pain to create.

Saturday, August 04, 2012

RasPi Wi-Fi

I looked on this list of working wifi adapters for one to try out and found the Linksys WUSB100 adapter worked out of the box. I just had to add my network details to a config file as described at the bottom of this blog post. Now the problem is I need a powered USB hub to get enough juice to my keyboard, mouse, and wifi adapter. I can only plug in two at a time for now so I tried out text browsing the Internet with the command line browser Lynx. It's a different experience, cool!