Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Weekend (tech) Project: Building CM11

I finally decided to dive into the deep end and compile Android from source!

This is not a complete how-to post. I'm writing this first to help you troubleshoot your own build and show where you might run into trouble. Primarily, though it's my notes for the next time I build.


Building:



First off, I'm building this in Ubuntu. Also, this is going to use some hard disk space. Make sure that at least 37 (more safely 40) GB is available. I didn't have quite this much available on my linux partition, so I plugged in my external HDD. You have to make sure that you have read-write-execute permissions to the mounted drive. The easiest way I found to do this is to use;
  • sudo umount /media/madscientist/MyExternalHDDsudo mount -t ntfs-3g /dev/sd** /media/madscientist
You need to fill in the **. This can be found be finding where the device is located in /dev. You can do this with the command;
  • sudo fdisk -l
From here on out, I'm following the instructions at;
http://wiki.cyanogenmod.org/w/Build_for_encore
with backup from this thread;
http://forum.xda-developers.com/showthread.php?t=1370873

Before you run envsetup and breakfast, you need to add a file, here's the description:
Have you set up your local manifest file to use the NookieDevs repo? If not, here is one that will work. This goes in the file [source directory]/.repo/local_manifests/roomservice.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="NookieDevs/android_device_bn_encore" path="device/bn/encore" remote="github" revision="cm-11.0" />
<project name="CyanogenMod/android_kernel_bn_encore" path="kernel/bn/encore" remote="github" revision="encore-omap3-3.0.y" />
</manifest>
After this, you may need to re-run repo sync.

Okay, now my nook isn’t showing up on usb. Trying to find adb_usb.ini to edit as per;
http://wiki.cyanogenmod.org/w/Doc:_adb_intro#.22Device_not_found.22_errors
Finally, I found the file in; ~/.android/adb_usb.ini and could add the code: 0x2080

With this done, I restarted the adb server (adb kill-server, adb start-server).
You'll have to answer a dialog on the nook to confirm that the computer is allowed to run usb debugging. With this done I was able to attach to the debugger.
(Another useful site for nook usb info is here; http://nookdevs.com/NookColor_USB_ADB)

This allowed me to run;
  • ~/Build/android/system/device/bn/encore$ ./extract-files.sh
Which requires that you already have cm 10.2 or later installed on the nook. This pulls some hardware information from the nook for building.

Then you can run the build as normal. From here on out I didn't have a problem building.

Installing:


Before you install, you ABSOLUTELY MUST back up your existing ROM. This makes it so very much easier to get back to a working state if something goes wrong. Like having an out-of-date recovery image....



When installing the build I encountered a “Build failed status 7” as per this thread
http://forum.xda-developers.com/showpost.php?p=47672324&postcount=353

This was because the recovery image was out of date. To install the latest recovery image, I followed the directions from http://nookdevs.com/CWR_Manual_Installation in which you’ll need to mount and copy some files over via adb. Here's the dump of my command line history:
  • adb shell mount -o rw,remount /
  • adb shell mkdir /boot
  • adb shell mount /dev/block/mmcblk0p1 /boot
  • adb shell mv /boot/uRecImg /boot/uRecImg.stock
  • adb shell mv /boot/uRecRam /boot/uRecRam.stock
  • adb push /buildpath/android/system/out/target/product/encore/kernel /boot/uRecImg
  • adb push /buildpath/android/system/out/target/product/encore/ramdisk-recovery.ub /boot/uRecRam
This brought me to CWM-based recovery v6.0.4.6, which looks promising as google seems to associate this with CM11.

This worked - CM11 was up and running!

Grab the latest gapps from CM’s website (http://wiki.cyanogenmod.org/w/Google_Apps) and you're done!



Lenovo T430s Review

Disclaimer: This is not a particularly serious or comprehensive review. Rather, it is a collection of my usage notes than anything else. Also, I'm not being paid by Lenovo to say any of this.

A little background and perspective on where I'm coming from.
My last laptop was a Lenovo T60 bought circa 2007, and manufactured around 2006 (I purchased it refurbished). It came with Windows XP, and I drove it into the ground. About a year ago, XP finally gave up the ghost, and instead of doing a clean XP re-install I loaded it with Ubuntu. It functioned fine for a few months and then the power inverter to the display gave out. This seems to be a common problem. While I'll probably get around to fixing this (and yes, a post will be in order on that), the T60 is now serving as an office desktop, and I decided that it would be a good idea to upgrade to a new laptop.

After looking at the current models of Lenovo laptops, I settled on the T430s - good specs and lightweight. I ended up getting another refurbished model from their outlet. Here are the specs;

Windows 7 Home Premium
CPU: Intel Core i5-3210M @ 2.50GHz x64
RAM: 4.00 GB
HDD: 320 GB
Graphics (integrated): Intel HD 4000
Graphics (descrete): NVIDIA NVS 5200M
Display: 1366x768


I'm dual-booting Win7 and Ubuntu using the instructions at LinuxBSDos. Linux installed seamlessly, but be sure to make a windows recovery disk before you do this! I left my recovery partition well enough alone as well. Finally, I had some issues getting the Windows updates to apply (unrelated I think), and fixed it with these instructions.





Usage notes:
  • I was pretty skeptical about the keyboard - I've tried a couple of chicklet style keyboards and haven't been impressed (Apple and Asus - full disclosure, I'm not much of an Apple fan-boy, but neither do I have a bone to pick with them). The reviews were pretty positive about this one (although less so on the e-series, so be warned), so I thought I would give it a chance. The keys have enough travel, are well separated, and the mechanism behind each key is solid. I thought the curved shape to the top was mainly bogus, but my hand does feel much more centered on the home row than with the flat Apple keys. I ocassonally use the home/end/pgup/pgdown group, but am not bothered by their separation on the keyboard. After getting used to ViM, I really want to use this keyboard for complete computer navigation. It lives up to the hype.

  • I'm less positive about the widescreen (although it's rare to get a laptop without this anymore). Personally, I feel as though it makes me hunch over more, since the center of mass of the screen is lower. It's not noticable when it's on your lap, but rather when you're using it on a desk.
  • Also, I'm not much of a fan of the trackpad. The T60's trackpad was perfect - I could use it for days without  having my hand hurt. The 430s... well, after using it for most of today, I feel like I'm developing claw-hand. It has some nice two finger scrolling and three finger tap / swipe actions that work well. I'm not entirely sure what the problem I have with them is. I've noticed this with my wife's Lenovo V600 too. At first I thought it had to do with how recessed the trackpad was, however, now I'm thinking that it has to do with how large it is. I usually have my thumb resting on the left mouse button, and in order to keep the other fingers from registering, I have to arc my index finger far away from them, or constantly hold up my middle finger. The trackpoint (red pointer in the keyboard) feels much better, but I can't keep myself away from the trackpad long enough to give it enough time to form an opinion. I'm thinking I'll have to get an external mouse with this one.
    Added: So I've this for about a week now, but wanted to leave my initial impressions up. It still hurts my hand to use the mouse for extended periods of time, but not quite as much. I've gotten much better at the multiple finger gestures and really enjoy using them. I would still recommend an external mouse for the long haul. Also, I've encountered the first, and hopefully only, problem I've had with this refurbished machine - the right trackpad mouse button has died. This isn't that much of a big deal, I can just jump up and use the trackpoint's rmb, but it's not an ideal situation either.
I think the size of the trackpad may be responsible for my 'claw' feelings.
At last, that combined with my propensity to use the left side of the trackpad
(you can make out where my fingers have been on the T60).

  • The battery life seems good. I got about 4.75-5 hrs of word processing with the internet up, and 1.5 hrs of graphics-heavy Mass Effect 3. This brings up a good point - you do have to make sure the power plug is fully seated into the machine - that's how I have the numbers for ME3 - I didn't fully seat the power cable :p.
  • Sounds are great, the speakers are now next to the keyboards and pointing up. They sound rich enough for me, but that's not saying much, I'm not exactly an audiophile.
  • Graphics-wise it does what I've asked of it so far, which is to say the occasional Starcraft II and Mass Effect 3 :p. And runs pretty cool while doing that.
  • Other notes: I would not pick it up from the right (CD tray side) while burning a CD. The tray is a bit thin and it killed a burn I had going from the little bit of case-flex it does have. These are magnesium cases and are supposed to be quite strong, though. Judging from the number of times I've dropped the T60 that sounds about right.
Here are some more comparison photos:

Top view, and front view, the T430s is slimmer in the front
but builds towards the back to about the same thickness.

Thankfully, it has the same matte screen that prevents reflections.



All in all, it seems to be a solid laptop, and I'm really quite looking forward to using it.

Does anyone else have problems with the new Lenovo trackpads? I'd like to know what your solutions are, two handed? Middle finger navigation? Finger exercises? A hack that lets you use the webcam as a mouse?

Ubuntu on the T60

    I've had a Lenovo T60 laptop that's been running Windows XP for the last few years, and it's slowly gone downhill. I finally decided to do a clean linux install when I found the \Windows folder in the recycle bin with no way of removing it (I had previously messed up the PATH environment variable, and have had constant empty message boxes popping up from "Lenovo Recovery"). So this posts will chronicle the task of bringing my laptop up to speed as a working machine with Linux (specifically Ubuntu).

1) Install Ubuntu
    This step one would think would be easy, but unfortunately, the Radeon X1400 card I had in the laoptop doesn't play nice with the Ubuntu installer. Turns out you have to force it into a basic mode, and later you can install an open-source driver for it. Otherwise it leaves the computer with a black screen after you start the install, and ends up going nowhere. To get around this when installing, modify the install line before the "-" to look like;
... noquiet nosplash radeon.modeset=0 ...
The specific details are on this mailinglist.
    This also means that I had to install the open source Radeon drivers after boot. You can also install the fglx proprietary drivers from AMD, but that seemed to be more involved than this fix. To get the open source drivers couldn't be easier - just go to the Ubuntu Software center and search for "Radeon". The result that reads "ATI binary X.Org driver" is the one you want.

2) Prevent Overheating
    This required tweaks in a few different areas. The first is telling Ubuntu that it can use the power saving features of the motherboard. This is done by editing the grub startup file (note, if you motherboard / bios is too horribly old, it may not support this feature. Unlikely, but possible). I followed the instructions below this video, which also exist elsewhere (but I lost the link).
    Second, I installed a lightweight power manager (see here for instructions). This is similar to the power scheme manager that often comes OEM with laptops. Called Jupiter, it allows for different power settings - I found "Performance -> Power on demand" suited my needs well . It also enables me to turn on/off bluetooth/wifi/trackpad and the external display. Bluetooth can be a real power eater, and I find having the external display off really keeps the laptop cool.
    Finally... I cleaned out the fan. I didn't think I needed to, but I noticed that there wasn't much air blowing out of it. A few spurts of the compressed air can later the fan was going full-tilt and doing a nice job of keeping the laptop cool.

3) Dropbox & Office Install
    Despite their attempts to make life much easier for you, I found the dropbox installer to be one of the hariest parts of this entire process. It wouldn't install from the Ubuntu Software Center, nor would it install from the command line. Either route would end up with a 99% downloaded.... message until my patience ran out. The solution was to grab the .deb installer from their website. Install that with dpkg, and then once it started configuring, cancel out and install the dropbox daemon and restart. The specific commands can be found on post #8 here.
    Okay, so I'm not always a fan of Microsoft, but I do think the got Office 90% right. OpenOffice.org is a great alternative, but is ~60% of the way to being a great Word / PowerPoint replacement in my book, so I (unfortunately) had to install Office. Thankfully my school offers copies for school/work, so I was able to get one from them. Using Play on Linux (PoL) - which is a great wrapper program for Wine (a collection of windows libraries that allow windows programs to play on linux) - I downloaded the installer and ran the PoL install script. The only hang-up was that the windows installer was a .exe file, and the PoL install script wanted a CD. As it turns out, that installer wasn't actually a binary executable, but an archive renamed to a .exe. Archive manager was able to open it up, and after extracting it to a folder, PoL was quite happy to install it.
    My university offers a download of office for students. The only minor change I had to make was renaming the installer extension to either .iso or .exe (it was something else obscure), then the PoL installer was able to recognize it and install it for me.

4) Install other services
    No other programs gave me much trouble (ssh, svn, eclipse, matlab, etc.). Network printing with the ubuntu server was a breeze as well.

And there you have it, a snappy 'new' laptop.

How about you all? Brought an old machine back to life with a linux distribution? Which one did you choose? Have any trouble?

Home Server - Part IV - Networked Printing

  Okay, so the Unison file sync is taking longer than I expected, but I realized that I could network the printer, so as to have any computer in the house print through the wireless. There were a few hiccups, but it was mostly painless. Here's what I had to do.

Part I - Installing Linux
Part II - Setting up SSH
Part III - Setting up SVN
Part IV - Networked Printing

  First you'll want to install the samba print driver in Ubuntu, instead of using the command line to install this time, I went to the software center, searched for samba, and installed from there. I followed the steps from this Ubuntu community link, but had to make some modifications as I went. It was fairly fast, and I had to modify most every step, so here goes. First off all the setup is Ubuntu server with attached printer (HP Officejet 5500), two Windows 7 boxes, and a Win XP laptop that needed to print to the printer.

  I went to http://localhost:631 from a browser on the Ubuntu box, but this didn't have much information on sharing the printer beyond allowing me to confirm the name. Next up was to open the samba configuration file "sudo vi /etc/samba/smb.conf". Under [printers] (there is something like #printers above it - don't be fooled, keep scrolling), change / add the lines to;
    browsable = yes
    guest ok = yes
    use client driver = yes

The last one is for the XP machine. Now restart samba with;
    sudo restart smbd
    sudo restart nmbd

  For the the Windows client printers, add the network printer by going to; Start -> Printers and Faxes -> Add a printer -> Network printer -> Now enter the local IP address of the machine and then the exact printer name for instance "\\192.168.1.21\officejet-5500-series". It will then give you a warning about installing drivers from the network, but then it will fail to install the driver. Select one close to you model (if you can find the exact model go for it).
  At this point, the Windows 7 machines were printing fine. However the Windows XP box was not. I had to go back into printers and faxes, then right click on the Network Printer -> Properties -> Advanced. If you were not able to select the exact driver when you set up the printer (as I was) this may help. Previously I had already used the printer from the XP machine, and it had correctly installed the driver then. I was able to pull down the menu next to driver and find the correct one. After clicking Apply, Windows prompted me to install the driver again, but (again) they didn't have it, so I canceled out of that dialog, and hit OK to the printer's properties. With the correct driver associated, the printer was printing! As always questions and comments are welcome!

Home Server - Part III - SVN

  Now that we have our linux box running, and we can connect to it from inside and outside the network, let's get to the good stuff - keeping all of our files in sync, and our version tracking the code. This allows us to always roll back if we should make a goof-up.

Part I - Installing Linux
Part II - Setting up SSH
Part III - Setting up SVN

  Some reminders from the previous cases - our example server sits on internal network at 192.168.1.21, our DNS service forwards traffic from the example domain madscientistlair.blogspot.com, and our SSH is configured to use example port 1986. We've so far been able to use PuTTY to connect.

  First off, we want to create a directory the non-administrator users can access (since we're using them when we SSH in). As the computer administrator we're going to create some directories, and then a usergroup, and finally add the users to that group, and give the group access to the folder. Then we can restrict SSH logins to those users, but they can still access all the files we want to access anyway.

  I chose to make a new high level directory /share with the command "mkdir /share". Within that I have /share/music, /share/photos, and /share/repos. This last one is where our subversion repositories will sit. The repository is where subversion maintains all of the files and file history that it uses. We will actually add the repositories first, and then do our group permissions to make sure that the permissions take on the repository files.

  I followed the quick start guide at the end of the svnbook to get myself started. First, we tell svn we want to use to repos folder as our repository;
    svn create repos
Now we add files
    svn import /tmp/myproject file:///var/svn/repos/ProjectA -m "initial import" 

The argument goes svn import [folder holding your files] [repository you want to add the files to]. The -m tells it what comment to associate with this version. It's always good to add comments to your commits so you can figure where to roll back to.

  Now I promised user groups and access to that folder. Create the usergroup and add users with the commands;
    sudo addgroup sharegrp
    sudo adduser username sharegrp
  Obviously username needs to be changed to the actual user name you want to add.
  Now we need to change permissions on the folder we created.
    chgrp sharegrp -R /share
    sudo chmod -R 775 /share
  This sets the group associated with the share folder as sharegrp. The second command changes the folder permissions to read-write-execute for owner (root) and group (sharegrp) and read-execute for any other users. The -R flag tells it to recursively do this for all the folders and files in the folder. I still had some issues being able to read / write to the folder immediately after, but a simple log-out and log-in fixed this for me.


  Now we've established and populated the subversion repository, we can check it out on our remote computers. I was following this guide, but the basic steps are to install TortoiseSVN. TortoiseSVN integrates into the windows shell, so that when you right click on or in a folder, you should see some new options "SVN Checkout" and "TortoiseSVN" with an arrow for more options. First we need to tell T.SVN that we'll be using ssh. So right click anywhere and go to TortoiseSVN -> Settings -> Network. Browse for the TortoisePlink SSH client. Mine was located at "C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe". Now let's checkout the repository. Navigate where you want it, right click and hit "SVN Checkout". It will prompt us for the repository we wish to checkout. You want to end up with something like;
    svn+ssh://[username]@[PuTTY Saved session name]/share/repos/ProjectA
  Oh, I should mention; once PuTTY can connect to your server, re-enter the information, then give it a name on the main screen, and click save. This will save the session, and allow other programs, like plink or tortoiseplink (both command line interfaces to putty) to access this session. That's what I referred to above as the PuTTY saved session name. Also, it's useful to have Paegent running in the background during this, to run the authentication without prompting you for it. Click "Okay" and you should be on your way to checking out your repository!

  I also had to configure svn for my linux work machine. The command line interface is a tad bit different. First off, since we're using a non-standard port, we have to add a new ssh tunnel for subversion. Edit ~/.subversion/config under the [tunnels] heading add in myssh = ssh -p 422
Now when you go to checkout tell svn to use that tunnel with the command;
    svn checkout svn+myssh://[username]@[madscientistlair.blogspot.com]/share/repos/ProjectA

Now onto using subversion. The basic work cycle goes something like this;
    update -> resolve conflicts -> make changes -> commit changes
In TortoiseSVN click the folder you want to update and go "SVN Update". From the linux command line, either use svn update if you're in the folder, or svn update [path to folder] to update the specific repository. I've not yet had to resolve many conflicts, so I'm going to leave this blank for now. Once I have some more experience I'll link to a detailed discussion. When you're done commit the changes with svn commit -m "comment on the changes". Or use Tortoise, right click the folder and use SVN Commit. I have noticed that TortoiseSVN someitmes won't commit any changes, if you right click on the top level directory, and you have not checked out all the sub-directories.
  On this note, you may only want to check out part of a repository, here's how to do it. For instance, assume our project repository looks like;
  ProjectA
    |-Web
    |-Template
    |-Android
    `-Matlab
and you don't want the Web or Template folders checked out. When you initially check out the repository, select "Checkout Depth -> Immediate children including folders". This will make empty folders which you can then populate by right clicking and using SVN Update, but under options pull down "Fully Recursive" instead of "Working Copy".
  Again, when you're done making your changes, bring the server back up to date by right clicking and going SVN Commit.

  That's it. This is pretty cursory guide to getting SVN running on our server, but you should have a functional, if rudimentary, SVN system now.

Home Server - Part II - SSH

Now that we've gotten our Ubuntu server box up and running, it's time to install the tools that will allow us to connect, known as secure shell, or SSH.

Part I - Installing Linux
Part II - Setting up SSH

  First up is the install. Bring up a terminal, and use the command "sudo apt-get openssh-server" to install the SSH server. This is the command for Ubuntu, for Fedora, I think it's "yum openssh-server". You may also need to install the client. To check, first issue the command "man ssh" to bring up the manual page (use q to quit), if nothing comes up, then you don't have it installed, "sudo apt-get openssh-client" will do the trick.

  That's all for the installation, now let's test out the SSH capabilities. Behind the scenes, after you did the install Ubuntu starts up the ssh service. Later we'll make changes to the ssh files and will need to restart the service, so this will become more clear.
  My other computer is a Win XP box (good lord!), and I'm used to PuTTY to connect. We'll start on the local network. Grab the local ip off of the server with the terminal command "ifconfig". It returns a lot of other stuff, but somewhere in there should the be local ip address which looks like "192.168.#.##". Later I'll use the concrete example "192.168.1.21" as the host server. Load up a session of PuTTY and type in this address in the Host Name box, then click on Open. A command window opens that should be prompting you for your username and then password. You can use any of your accounts to test it out, after logging in it will drop you to the Ubuntu command line.

   With that working, let's make it a little more secure. Why do we want to make this secure? Here's a great article by the Fedora folks on security precautions and why you want to use them. I particularly liked the examples of the number of attempts to log in as root.
  The easiest things you should be able to do are 1) use a strong password on root, 2) change your port number to something non-standard, 3) use SSH 2, 4) deny root the ability to log in, and 5) use key authentication. I would recommend you implement all of Fedora's guidelines (if applicable), but I'll cover these four in more depth.

  Assuming you can take care of #1 on your own, here's how to handle number's 2-4. On the linux box, use the command "sudo vi etc/ssh/sshd_config". This opens up a text editor (called vi, see here for a list of commands) and shows the preferences file for the ssh server. Find and edit the text lines;

  Port 22 -> Port NNNN
  Protocol 2,1 -> Protocol 2
  PermitRootLogin yes -> PermitRootLogin no
  The right side of the arrow is what it should read when you're done. For port numbers, the most common are; 22 (SSH) 2222 (alternative SSH), 80 (webserver) 8080 (alternative webserver). So we'll pick an unused port say 1986. You can check it against this list, but it's not required that you pick something not on there, the max you can choose is 65535 (I think). Now if you try to use PuTTY to log-in again, you can't. We have to specify the port as well, the field directly right of the Host Name. With this you should be back to logging in just fine.

  Now we'll set up key authentication, replacing the user-id and password scheme. This makes you system less vulnerable to brute force attempts. Instead of trying a common name "root" and a bunch of passwords "", "password", etc. SSH will confirm you identity with a public/private key pair. This is actually how SSH transmits all it's data anyway, so your login will be as secure as the channel (or your computer). What happens in this scheme, is that you generate two "keys" one is called the private key - only you have the private key, and it identifies exactly who you are. The second is the public key, which you can give out to anyone! If you want someone to know that it is you at the other end, you encrypt a message (say "Hello world") with your private key. You send it to them, and they decrypt it with the public key you gave them, they see "Hello world" and know it's you. Why? Because if someone else had encrypted the message with her private key, gibberish would result on the output. Moreover, knowledge of the public key doesn't let someone know what your private key is. So as long as your private key is private, you can encrypt messages with it, and if they're decipherable, then the other party knows it is you at the other end. Of course there are drawbacks to this method - you could compute every possible private/public key pair, and then if someone knows your public key, they also have your private key. But if you make the keys longer, then it becomes much more difficult to compute every pair, and the system remains secure.

  I found this link extremely helpful in setting up key authentication using PuTTY and won't try to reproduce his work here; http://www.howtoforge.com/ssh_key_based_logins_putty_p2. Also be sure to encrypt (password protect) your private key, as if anyone gets their hands on your private key file they could impersonate you. Password protecting it gives you another layer of defense. For linux, you can use the command "ssh-keygen -t rsa" to generate the key pairs. Same steps apply for registering your public key with the server.
  Once you have key based logins on all of your computers, we can turn off username / password login. Open your config file again; "sudo vi etc/ssh/sshd_config", and change the following lines;
   ChallengeResponseAuthentication no
   PasswordAuthentication no
   UsePAM no


  So all this allows us to ssh into our server while on the same network, but what if we want to get to our files while on a different network, a friend's house or at work? Nowadays most IP addresses dynamically assigned and recycled, so we'll use Dynamic DNS (domain name system) to create a easy to remember web address for our server. I chose to use the FreeDNS service, although others exist, like OpenDNS and DynDNS is another popular one. For example, you sign up for a sub-domain, the "madscientistlair" part of "madscientistlair.blogspot.com". Then you use as the host name field in PuTTY, "madscientistlair.blogspot.com" and the DNS service says "Oh, you really want; 245.324.3.564", which is the current IP address your ISP has given your home. PuTTY connects to this instead, which goes to your router, which knows that requests for port 1986 should be sent to "192.168.1.21" and you connection to your server is made.
  The second part is installing a client to keep the Dynamic DNS servers updated. On my Ubuntu box, I used ddclient, installing with "sudo apt-get install ddclient". On setup, it prompts you for the service you're using. For more information check out the Ubuntu community page. Your router may support one of these services, go to your router web administration tools and then there's usually a Dynamic DNS tab.

  One other important step, and you may have noticed this above. How does the router know that you want to talk to the server computer? First it's useful to set a static IP for the server, this way the address "192.168.1.21" that we've been connecting to from home doesn't change in the middle of the night and we can no longer get to our server. The second is to set up port forwarding. There are usually tabs for both in the web administration tools for your router. Since these vary wildly, I can't give you any more advice other than on the port forwarding page, you want to have 1986 (or whatever SSH port number you specified in the sshd_config file) point to your server; 192.168.1.21. To check that it's working, go to http://canyouseeme.org/ and give it your port number. Below their ad, you'll see the result.

  There was one file issue I ran into. I could use "madscientistlair.blogspot.com" to talk to my server when I was outside of the house, but not when I was in the house! It turns out that some classes of routers don't allow you to do this. Essentially they prevent you from talking to a local machine through an outside connection. Kinda like using your cellphone to call you grandma in Florida so she can call the home phone. To get around this you'll have to have a batch script on your desktop that edits your windows "hosts" file when you switch locations. For example, you could have two scripts "set_when_home.bat" and "set_when_away.bat". You run set_when_home, when you're home, and this tells windows that when PuTTY asks to connect to "madscientistlair.blogspot.com" it really wants to connect to "192.168.3.564". When you're away, you run set_when_away, and it undoes this change. See here for a couple of example hosts files.

  Well that's it. We've installed SSH into our server, secured it, and allowed access from the outside. If you have any lingering questions, or can't get something to work, leave a comment and I'll try to help.

Home Server - Part I - Linux Server Box

  My goal in this was to start a personal fileserver over SSH using Unison (for static binary files - pictures, music, etc), and subversion (for revisioned text files; i.e. code, docx documents, etc). I was thinking about using git, and still might for personal use, but we have subversion installed in the work computers, and part of this was syncing my home files with the work files, so I stuck with subversion.


Part I - Installing Linux
Part II - Setting up SSH

  The easiest step I figured was getting Ubuntu on the laptop that I was going to have act as the server. HA! As if this project was going to be easy. Okay, so I started with Fedora 16 live, after that dropped me to the debug shell, I looked up some of the error messages I was getting, and there seemed to be no unified solution. Some suggested it was the bios (which I only wanted to update as a last resort), missing drivers, etc. I figured the easiest thing would be to switch distros and see if that help. One Ubuntu burn later... one linux mint burn later... one ubuntu server burn later... Okay, but now we're getting somewhere, since Ubuntu server doesn't have to launch into the live environment before giving me options (my Linux help buddy mentioned holding / tapping left shift to get the live CD's to display menus, but these processes lost out to my patience). So how did these options help us figure out what was wrong?
  Well at this point we figured it's likely to be the CD. Earlier we thought it might be graphics; Fedora was a bleeding edge distro, Ubuntu more conservative, Mint was a graphically more conservative yet, and Ubuntu Server is the most graphically paired down of them all. But since none of the CD's installed, including the server CD, which failed it's self error check (see step 3 below).
  Step 1 was to check the MD5 hash of the ISO (which you always should do before burning - and I did), I was burning in linux, so the command; "md5sum imagename.iso > file.txt" does the md5 checksum and sends the output to a text file, where you can paste in the offical hash on another line and quickly see if they compare. In Windows you can get the hash with an fciv tool provided by Microsoft.
   Step 2 is to compare the ISO against the burned CD. You can't really directly compare but the command;
"dd if=/dev/cdrom1 | head -c `stat --format=%s ubuntu-11.10-server-i386.iso` | md5sum" checks the size of the ISO and sees how many blocks this should take on the CD and if it fact does take up this space. You'll have to change the location of the CD drive and the file you're burning in the command. I don't know the equivalent command on Windows for this.
  Step 3 was the smoking gun. From within the server boot, there was an option to "Check integrity of install media" which failed every time we ran it, and not reliably in one spot either, sometimes right at the start, sometimes on other files. This was when I got really lucky - I was trying to install at work, and we had an external USB CD-RW drive lying around. Not only that, but the laptop's BIOS recognized it as a CD drive and put it in the boot order. So we got that to boot! Finally 8+ hours in, and a working install of Ubuntu.

  With Ubuntu working (is it just me, or is Unity trying to be OS X?), the first thing to do is to update. At this point it's also good to have a couple of other users who don't have administrator privliges. You can go into the "system settings -> users -> unlock -> +" to add more users from unity. Be sure to give reasonably strong passwords. We'll use these users as our primary remote log-in users. A few other words of advice; make sure that the root user has a strong password! And I only recommend this for home use - write it down somewhere safe - you won't be using it all that often after the initial setup and you don't want to loose this password. We'll be sure to deny remote user log-ins as root when we set up ssh, which is the next step.