Sunday, March 24, 2013

Open Source - Saving Puppies

Slight exaggeration... okay, so it's a massive exaggeration.  The 'pup' is just shy of being a full-grown dog, and the veterinary surgeon is the one who saved her, well, her ability to walk.  But Hackerspace, the Fab Lab, and Open Source software and hardware all played their part.

Just to give you an idea of Open Source's power and awesomeness: our Fab Lab was recently contacted by a Veterinary Surgeon who had a tricky surgery to perform. He wondered if it was possible to print a copy of the dog's bones so he could prepare better.

Turns out it was not just possible, but relatively simple (once we found the youtube video) and I did it using all open source software and an open source printer (the Huxley).  Even the CT Scan Data format (dicom, or DCM) is open. I ♥ Open Source.  No really.  Marry me?

*ahem*

As many of you know Fab Labs aren't really set up for medical use - but I was intrigued.  It would be pretty awesome if we could do this.  So I sat down with the Vetinary Surgeon and discussed the possibility, while searching up a storm on the interwebs. There were a few posts about it, many involving expensive software, but also many about doing it open source.  Enough to make me think I might have a chance.

A year or so I would not even have thought of trying.  But the skills I've learnt at Hackerspace, and seeing just what's possible with open source, gave me the confidence to give it a go.  I got some tips (thanks Pix), and just started manipulating data - learning as I went, and a couple of days later I was able to present  the doc with a 3D printed model of the bones.

The feedback from our Vet Surgeon was positive.  The 3D printed model of our pup's bones was, indeed, helpful in preparing for last Wednesday's successful operation  ("it was the best") - woot!  The surgeon could plan where to cut, and pre-contour the plate (bend it correctly).  Though our pup isn't out of the Woods yet.  So cross your fingers with me, and wish her and her owner luck.

Update:  The Pup's first check-up has gone well.  Let's keep our fingers crossed.

Tuesday, March 5, 2013

This Linux biz is awesome, can I put it on my other computers?

Why, yes, you can I'm glad you asked.

Sorry about the delayed updates.  I haven't really been using my Raspberry Pi lately, but I did manage to trash the Windows install on my Laptop.  It was entirely my own fault.  If there's anything more dangerous than a total noob, it's a noob who knows just enough to get herself into trouble when trying to 'fix' things *sigh.*

I've been meaning to dual-boot1 my laptop for a while now, and get back into using Linux. I figured I'd take the opportunity to get Linux up and running. Here I am nearly 3 months later and I haven't even bothered to reinstall Windows. Not even for gaming (but that's a post of its own). As with the Raspberry Pi, the first step is to decide which Distribution2 to use.

 Most of the Linux Distros I've used have been based on Debian. Most recently Raspbian, but before that Antix and Ubuntu. So I figured, since I loved all the Distros based on Debian, then Debian would be even better - right? Well, no, not for my purposes. The 'problem' with Debian (for a nooby user like me, and perhaps you if you're reading this) is that most of the nuts and bolts programs that work behind the scenes are so out of date. An example is libc6 - the program that runs C languge programs. A lot of programs use libc6.  Thus a lot of the games and programs I wanted to install, well, wouldn't. I could have compiled the programs for my computer (and version of libc6), but that's a lot of work, so instead I switched to Ubuntu. I highly recommend this distro. It's beautiful, modern, and easy to use. Its compatibility to Windows Games (through Play Linux Online) means the RPGs I'm into (every one I've tried so far) all work in an easy plug and play fashion. In fact many of them run better under Ubuntu than they did in Windows 7. Especially older games in *shudders* compatibility mode.

There are a lot of reasons to choose a distro based on Debian. Its massive repos3 for starters. Sure, there are other ways of installing software, but this is by far the easiest. Ubuntu is not quite as stable as Debian, and if you don't want to install newer software then Debian is a fine choice, but I feel Ubuntu has the best of both worlds. It's still pretty stable, but modern enough to game on. Linux Mint is another option (also based on Debian) that's gaining in popularity. I haven't tried it yet, but it seems like it might be more Noob friendly than Ubuntu. Give it a try if you want, a lot of my posts will apply equally well to Mint as to Ubuntu. If you want to do more research on which is the best Distribution for you DistroWatch is a great place to start, and will give you the lowdown on all the things.

So now we (I) have chosen a distro, next is to choose a Windows Manager. Sorry, I know. Just when you think you're getting a handle on it there's another layer. First you have the Operating System (Linux) and on top of that layer is the Distribution, or Distro (Ubuntu), now this? Another layer? What are we making, an Adriano Zumbo Cake? Well, no, this is the last layer I swear. But, arguably, one of the most important. The Windows Manager will determine how you interact with your computer. It is the very top layer between you and your machine. Because of my laptop's tendency to overheat I decided against installing Unity (the default Ubuntu WM) which is graphics intensive. If you have a flash new computer, then it's fine. It is highly configurable and reasonably intuitive.

For my old beast I went with XFCE4 (also called XFWM). It's a solid Windows Manager. This is easier on your hardware than Unity, and is simple to use - especially for Windows peeps, who will feel a bit of deja vu at how it is set out.  It is not as pretty out of the box (by a long shot) as Unity, though you can change some things and there are themes available.  I'll be doing a few how-tos on making it prettier in the weeks ahead.



The easiest and best way to install Ubuntu with XFCE as your windows manager is to download Xubuntu. It comes with XFCE instead of Unity, so saves a little bit of room on your download and HDD when installed. Installing Unity when you don't need it is a massive waste of hard drive.

If you want to Dual boot with Windows there are a few headaches, which I managed to avoid by avoiding Windows.  If you really need Windows though, here's a neat how-to:
https://sites.google.com/site/easylinuxtipsproject/installation Sorry guys. I'd like to help, but I'd rather not put myself through a Windows install if I don't have to.  =)  Have fun!

Burn the disk image (ISO) file you've downloaded to disk using your fave software for this kind of thing. Right clicking on it should give you some options.  Plug in the power if you're installing to a laptop (pretty important for a Desktop too I guess =p).  If you can plug into a router using ethernet it's helpful, but not vital, so if you don't have a net connection don't worry.  Start the Install, and go and make a coffee.  It won't take much longer than that.  The 'good old days' of hours long installs are, thankfully, done.  At least for us Linux users.  Welcome to the club.  :)





DualBoot - Dual Booting means running more than one operating system on your computer. So, for example, on you Raspberry Pi you might like to run Raspbian for normal use, and XBMC for media use. Dual booting allows you to pick which one when you start your computer, rather than have to have separate SD cards (or Hard Disk Drives for larger computers). The most common configuration is Windows and one of the Linux Distro2, though you can dual boot anything. Windows XP and Windows 8, MacOS and Linux, or even MacOS and Windows (crazy kids).

Distro - The Distribution, or Distro, is the specific Linux you are using, which is packed with various other applications. Some examples are Ubuntu, Red Hat, Mandriva, Debian, Linux Mint, Raspbian, Xbian, etc.

Repos - 'The Repos' or Repositories are where the software that your Distribution live. Debian has the largest selection of software in its repositories. Software based on Debian, like Ubuntu, has access to these repos as well as its own.

Thursday, January 31, 2013

Nvidia and Debian Squeeze

So, using the Raspberry Pi as my Linux machine has spoiled me.  Because every RPi is the same there aren't the Driver issues that Linux often has.  If you have the drivers for one Raspberry Pi, you have them all (though the problem sometimes rears it's head with peripherals like wifi and bluetooth cards, you can avoid it by going to the Verified Peripherals page and selecting one known to work.

But blaming Linux for the lack of driver support is unfair.  It's not Linux fault that most parts manufacturers don't support Linux or won't even give the devs the info they need to support it.  It's amazing we have the support that we do have, and full credit to those masked men and women who spend hours trying (and mostly succeeding) to backwards engineer drivers for us.  Thank-you.  We've come a long way in the last 20 years.  However the sad truth is that drivers still cause issues, more often with laptops where you can't swap out video, wireless, or bluetooth cards that don't work (the main offenders).

Modern video cards are especially tricky to write drivers for, because they're just so complex.  In Nvidia's defence, they do release some closed source drivers for Linux (they got it half right), but it's not very high on their list of priorities, and support often breaks when the kernel is updated.  I'd tried all the methods on the official Debian wiki to try and get them working on Debian Squeeze (the stable, safe version of Debian)1.  No joy.  I googled for tutorials, followed them, still no joy.  As soon as they were installed I lost my graphical user interface.  If this happens to you the following command is your friend.  It will stop the computer using the (non-working) nvidia drivers by renaming the xorg.conf file.

cd /etc/X11/
mv xorg.conf xorg.conf.nvidia

Though I recommend making a copy of the original xorg.conf file before you start messing around with the image drivers, and then you can just (as root in recovery mode) move it back into the cd /etc/X11/ directory if something goes wrong.

cd into the folder where you saved the copy (with a sensibile name like xorg.conf.backup).  The ls command is helpful here, as it lists the contents of your current folder (the names of other folders will be in blue).  cd .. will make you go up a level.  When you're in the folder where you saved the backup type:


mv xorg.conf.backup /etc/X11/xorg.conf


Though even with the above knowledge this can be a risky business, and I recommend backing up everything before trying installing any new drivers.  Actually, I am assuming you know you have and nvidia card before coming here, you can check by typing:

lspci

My video card results look like this:


02:00.0 VGA compatible controller: nVidia Corporation GT216 [GeForce GT 320M] (rev a2)

If you don't have an nVidia card you will need to look somewhere else.  I recommend a google using the linux distribution you are using (in this case Debian Squeeze) and the name of the card (in my case GeForce 320M).  Good-luck.  For those of you who do have an nVidia card, let's continue :).


Firstly you will need to add the following repositories (where the software comes from) to your sources:
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
deb-src http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
deb http://ftp.debian.org/debian/ squeeze main contrib non-free


sudo gedit /etc/apt/sources.list

Then copy and paste the green writing into gedit, and save the file.

Install the following programs, and follow the instructions (click yes when asked a question)

apt-get install -t squeeze-backports dkms nvidia-kernel-dkms

Then you will need to run them with:

dpkg-reconfigure nvidia-kernal-dkms

Nearly there.  The next step is to update the xorg.conf file so that it says to use the new drivers.


sudo gedit /etc/X11/xorg.conf

You may need to change the Device Section so that it reads:

Section "Device"
    Identifier     "Video Card"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"

Finally you will need to add a Module Section just before it:

Section "Module"
    Load        "glx"
EndSection

The final step is to reboot.  If you come come up with the black screen, then it means to nVidia driver install didn't work.  Just press CTRL+ALT+DEL and when you reboot choose the recovery version.  Enter you root password (you'll need to be root to make changes to the /etc/X11 folder) and follow the instructions for saving your xorg.conf.backup file as xorg.conf.  Hopefully, though, you get that interesting nVidia eye looking at you.  Good-luck!

1    Debian squeeze is the big brother of Raspbian, and so familiar to my fellow Raspberry Pi users.  This is why I chose it, though to be honest Xubuntu (a child of Debian) would be just as good a choice, and even runs the same Desktop (XFCE) and so may be a better choice for my fellow noobs.  This tutorial should work in Ubuntu as well.

Friday, December 28, 2012

'Tis the Season for Pi(e)

So it's been a while.  Sorry about that, I've been lacking the excess energy blogging requires, but from here on in I'll endevour to do better.  I'll even make it a New Year's Resolution.

I haven't had time to do much new stuff with the Raspberry Pi, but I have found a new image that I now use as my base.  It has XBMC already installed, and though I haven't played with it much, it plays all my videos and music out of the box, so I'm pretty happy.  I used the instructions to install the precompiled version, as I've managed to break my original SD card (the physical card, not the install, which is new for me).  Though he's since created his own archive so you can 'apt-get install' XBMC from there:
http://michael.gorven.za.net/content/xbmc-raspberry-pi

If you're really geeky and keen you can try and build it yourself, but it takes about 12 hours on the pi, and is kind of tricky (I am not really up to trying it myself, but would love to hear from you if you have).

I've done a little playing with Arduino since we spoke last.  I love the Arduino microcontroller, so noob friendly.  Most of my code is stolen, which is not just allowed on the Arduino, but encouraged.  They have massive libraries of code for use with almost any sensor / servo / thingy / or doodad you can think of.  Most of my 'coding' has involved stealing code for the whatsits I'm using and mashing them together, and then asking our resident guru (Pix again) why it doesn't quite work.  I've just discovered the 'mapping' function (thanks Simon) which involves reading the input from a sensor, and mapping it to some kind of output device (so far I've used a speaker and a servo).

I'll post some more info soon, but to tide you over here's a picture of my claw which maps the distance you are away from the sonar to the how far apart the fingers of the claw are:
I highly recommend Arduino if you are looking for a brain for your next project.  The language is 'c-like' - whatever that means (coders know).  But it's relatively simple, even for non-programmers, once you've looked at a few examples.  In future I'll be posting more Arduino, as well as more Pi stuff, and hopefully getting them to play together nicely in the not too distant future.

Sunday, November 4, 2012

Gaaaaaaaaaaaaaaaames!


Now for the pretty pictures.  Well, a little less pretty now we're used to high definition gaming, but what they lack in pixels they make up for in gameplay.  Plus they're fun.  I like the dry wit present in many of these games.  Tasty.

ScummVM

Also relatively painless to install:
apt-get install scummvm

Sound
But sound can be an issue if you're using HDMI.  If I haven't mentioned it before (sorry) you should force your Pi to use HDMI for sound if you can (ie aren't using a composite screen / analogue sound out).  To do so open the config.txt file located in the boot folder.  You will need to be a super user to save it, and so the easiest way is to open it in terminal:
sudo leafpad /boot/config.txt
or, if you've shelled in like I taught you a couple of posts back you will (for now) need to use a command-line text editor:
sudo nano /boot/config.txt
And 'uncomment' the line:
#hdmi_drive=2
Easy, peasy, just remove the hash - #.
hdmi_drive=2
Then save the file and reboot.  Sound sorted.  Remember to change it back if you want to go back to using the sound out port.

Now you are ready to open up ScummVM (in your Games folder in the Programs menu - press the Windows Key, or click the square in the bottom left corner, go up to the Games folder, and go from there).  You should see the bright yellow ScummVM screen.  Click the 'Options' button and tick the checkbox for fullscreen mode.

Now to add the games (ScummVM, like Gargoyle, is just the engine used to open and play games).  If you've used ScummVM before then you're set.  This is the same no matter whether you're using Windows, Linux, Mac, or some unholy hybrid.  If you already own the game you can just copy the files across from your CD or floppy to your hard disk. Click 'Add Game,' from within ScummVM, select the game file, and add it and you're ready to go.    Detailed instructions on buying the games legally can be found on the official ScummVM website.  You can grab Beneath a Steel Sky free from the repositories:
apt-get install beneath-a-steel-sky
And it will either open directly, or you can add it to ScummVM.  It is in "/usr/games/sky".

 Now for the final step - stay up all night reliving (or creating) awesome childhood memories.   And remember...
 



Now What - Old School Gaming

The Raspberry Pi is good for so much more than watching the movies and tv shows you've recorded though. I love being able to use my computer from my couch, and here are some of the things I've been up to.

Games

Old school style. No, that doesn't mean Doom - Before that, a long way before. I was born in 1978, so grew up with text adventures (though not as many as I'd like) and point-and-click adventure games (ditto). Actually, though I played them at school occasionally, and was totally obsessed with a couple of Infocom games my mother bought me, it wasn't until I 'rediscovered' them as a teenager (in the bargain bin in game shops) that I really got into these games.  Coming back to them yet again, in my 30s, they still hold up remarkably well.

Text Adventures / Interactive Fiction

Gargoyle was easy. Just type:
sudo apt-get install gargoyle-free
into the command line. After that you will need to run it (gargoyle from the command line, or there will be a link in your your programs bar, under 'Games').

Gargoyle is a front end for text adventure formats (just like XArchiver is a front end Archiving tools). It plays:
  • TADS games (a newer format for amateur writers,
  • Z formats z3 - z8 (Infocom, also popular with the new IF (interactive fiction) breed),
  • SAGA (Scott Adams Grand Adventure)
  • Level 9
  • Magnetic Scrolls
  • A heap of others.
Chances are, though, if I haven't piqued your interest by now you should just jump down to the adventure games section (or skip this post altogether if, immersive, story based gameplay isn't your thing) :p.

There was a bit of chatter on the forums about Zork.  Yes, gargoyle will play it (it's in the z-code formate).  Now that it's been released into the wild it's easy to source too:
http://ifdb.tads.org/search?searchfor=zork&searchgo=Search+Games
Just download the files from the Interactive Fiction archive.  Make sure you grab the z-machine files.  When you can either click on the name of the game you want to play, and choose to open it in Gargoyle.  I recommend ticking checkbox to always open those kinds of files in Gargoyle, so that in future all you need to do is double click on the game file.  Though opening a game from within Gargoyle is also easy.

The IF database is a good place to go for games.  You won't be able to find copies of other old favourites from the commercial realms because, while they're not still in 'print' (more's the pity) they are still covered by copyright and haven't been released by their makers.  You may be lucky like me and be able to grab a few from ebay, or source them elsewhere.  You can read details about the game on the archive, but you can't download it.

What the archive does well, though, is make the great output of 'amateur' IF writers available to play.  Though many of these writers are only 'amateur' in that they never got paid.  The four and five star games are at least as high in content, quality, and polish as the games of yore, and many of the 3 star games are also great fun (if a little lacking in polish).  Look through the lists, or do a more detailed search if you're looking for a certain type of game.  Heck, you can even start your own list, or get recommendations based on other games you like - just look down the bottom of the game description.

If you're new to all this (good on you for stretching your horizons) or it's been a while I highly recommend a play through of The Dreamhold by Andrew Plotkin.  It's an engaging game, lots of fun, and it has an 'adaptive' tutorial (ie the tutorial can read the info about how you've played the game so far and give you hints based on that.  Feel free to type 'help' at any time to get more info though.

Hopefully that's enough (too much???) to get you started.  Now, on to the pretty pictures.

I've decided to split these posts up, as I may have waffled on a little too much to include them both in the one update.