Creating a mobile development environment in Ubuntu
This article was written specifically for a development environment on Ubuntu using MySQL.
I can work from home whenever I want, though it's usually better for me to limit myself to working at home after hours. This creates a problem with keeping my work in sync. I've always assumed the best way to handle this was to carry a laptop around. However, this keeps me from taking advantage of our kickass development machines at work that have two screens.
Just the other day I decided to ask the boss for a new laptop. He said we could talk about it soon, and I was satisfied. Then I had an idea. I could just get an external hard drive and keep my work on it, so I could then just carry it back and forth between work and home. Much cheaper than a new laptop, and I could develop on my home machine or one of the well-equipped machines at work. So I jumped on NewEgg and started looking at my options.
My requirements were an external hard drive, one that is small, runs on USB power, and is manufactured by a reliable company such as Western Digital. I found the Western Digital My Passport external hard drive to be perfect. Doing a quick check on Best Buy's site revealed their price was the same as NewEgg's, so I went to Best Buy and bought it.
Now, if you are working with sensitive data, you'll probably want to encrypt your drive. I found this to be easiest using TrueCrypt. It's easy to set up on Windows and Linux, and the performance is good with the external hard drive I bought, under certain configurations. Let me explain what I mean by "certain configurations."
You'll want to encrypt the entire device and NOT set up an encrypted file container. If you insist on having some space you can access from Windows, you can set up two partitions and encrypt one of them. The reason for encrypting the device or a partition is performance. I tried both ways and noticed a large difference in performance, especially when working with smaller files (like in a large Subversion repo).
Don't try to get fancy with TrueCrypt. Use the AES algorithm, a password and a keyfile. You should probably e-mail to yourself the keyfile so you never lose it. You do use GMail, right?
Make sure you choose 'None' as your filesystem when you encrypt your device or partition, because you don't want to use FAT. Then you can mount the TrueCrypt device without trying to mount the filesystem (since you dont have one yet). There's an option for it in the mount dialog. After mounting the device you'll want to create a ReiserFS filesystem on the corresponding TrueCrypt device (usually /dev/mapper/truecrypt1, you can right-click the mount entry in TrueCrypt to find out).
You might want to check out my article on changing the data directory in MySQL and read about ReiserFS in my article about tweaks for Ubuntu (in progress). I'm not going to go into further excruciating detail filling in the blanks to create this setup. If you can't figure it out, then that precludes you from being a software developer.
So far this setup has been working very well. I just shut down MySQL, unmount the TrueCrypt volume, unplug the drive, and go on my merry way. When I arrive at my destination computer, I plug in the drive, mount it with TrueCrypt, make sure MySQL is configured to point its data directory to the drive, and start MySQL.
I'm interested if anyone has tried doing something like this and what their experience was. I will add more information to this article if I get a lot of comments about something in particular.
0 comments:
Post a Comment