Thursday, December 1, 2011

Using Rsync to Backup Windows

I don't normally write about Windows and I don't think I would consider today's post to be any different. That said, I am going to post about something related to Windows. I recently made the switch from Red Hat Enterprise Linux 6.1 back to Windows 7 for day to day work on my office workstation. The reason behind this was mainly just software compatibility. I found most of my work was being done on my secondary Windows workstation anyway and decided that the few advantages Linux had over Windows, for my purposes in a 70% Windows corporate environment, were just not worth the hassle of maintaining two workstations. As of yesterday I'm now running off of my HP Elitebook with Windows 7 Enterprise edition. With this switch has come several challenges, not the least of which was how to make sure I had regular, local, backups of my data.

My laptop has a 120GB SSD in it and, while they are getting better, I still don't trust the reliability of MLC SSDs. In the past, under Linux, I had just been running rsync as a cron job ever few hours while I was in the office. This had been working very well for me for some time and I wanted to find a way to accomplish the same thing under Windows. Enter a project named Cygwin. Cygwin allows you to run Linux applications inside of your Windows environment; setup is easy and you can easily expand the selection of available tools by re-running the installer. I opted to give this a try by installing a few simple utilties, bash, openssh, openssl, git and rsync.

Since this provides you a full bash shell you are able to create bash scripts just like you would in a real Linux environment so I set off creating myself a quick backup.sh script that would use rsync to back up C:\Users\my_username. I've posted the results of my work below, feel free to copy this and use it on your own windows system for backups. Feel free to post any comments or questions in the comments section below as well.

Note: Don't forget to change the variables I've noted in the comments in the script.


#!/bin/bash
#
# Will backup /cygdrive/c/Users/$username to /cygdrive/$drv/$hostname/Users/$username
#
## Change these values to match your computer
#
hostname="MY_COMPUTER" #Name of your computer
drv="g" #Drive to back up to
username="YOUR_USER" #Your username
## You might need to change "c" on the next line if your users folder is elsewhere
bkpfrm="/cygdrive/c/Users/$username"

## Nothing below here should need to be changed

# Check that drive letter entered is present, else prompt
while [ ! -d /cygdrive/$drv/ ]; do
read -p "$drv:\ does not appear to be a valid drive letter, please enter the correct drive letter: " drv1
if [ ! -z $drv1 ]; then #Change drive to new value if one is entered
drv="$drv1"
fi
done
rsync -au --delete $bkpfrm /cygdrive/$drv/$hostname/Users/$username

Monday, November 21, 2011

Android Hacking on the Kindle Fire

I've been working recently on making the new Amazon Kindle Fire do everything that Amazon doesn't want it to do. Among other things, after a few days of tinkering and hacking away on the Android Developer Bridge (ADB) I now have a fully rooted Kindle Fire. In addition I've also been working to get all of the Google Android apps working and here is the progress so far.

1. Rooted the Kindle Fire using the well publicized "SuperOneClick" method.
2. Loaded the Google account manager (required step for the applications to follow).
3. Loaded Gmail, Google+, Android Market and several other applications.

At this point with those three steps I've managed to convert what was intended to be a simple ebook reader into a fully featured Android tablet (now we just need an Android 4 rom). If you have a Kindle Fire and wish to do the same as I've done to yours head over to xda-developers.com and take a peek at kindle forums.

Speaking of Android 4, ICS, I have started playing around with compiling my own Android 4.0 ROM. So far I've not made a lot of progress but I'll definitely update in a post here once I've successfully booted my first ROM.

Saturday, November 19, 2011

The Eee is dead and a mini MAME system is born

I must apologize to those of you who follow me. I've been absent recently and I would like to take a moment and try to explain why.

For those of you who know where I work, I don't need to explain too much, you know it's been a busy month at the office. In addition, as the title of the post states, my brand new laptop has sadly processed it's last bit, at least for now. For those who don't know, the laptop took a tumble last month while I was getting into my car on my way into the office. I was in the middle of writing a review on the performance of Ubuntu 11.10 on the Eee 1215B when this occurred. After the fateful tumble the touchpad frequently malfunctioned, requiring me to shutdown and pull the battery out to reset it. I tried for several days to repair it and call Asus about acquiring a replacement wrist rest. I was unsuccessful in my repair attempts and was told my Asus technical support that a replacement was not available. This effectively brought a halt to my review and the search for a replacement test machine is still ongoing. As unfortunate as this was I do not believe this will be the EOL for this machine.

I was fortunate enough to attend SkyDogCon earlier this month. At the conference I began talking with one of the members of Unallocated space, a hacker space in Maryland, who had brought with him a device called a "MAME box". For those who are unfamiliar with MAME (Multi Arcade Machine Emulator), it is a cross-platform application designed to play classic arcade and video games. A few days later I came across the Nanocade and decided that I could give the Eee new life as a desktop arcade machine. If you go to my Google+ page you can check out the first prototype design I made in Sketchup for the housing. The system is undoubtedly going to run some incarnation of Linux, likely Debian or Arch. Subscribe to the blog to stay up to date on my progress as I move forward with the project.

Thursday, September 15, 2011

Further thoughts on the Eee 1215B

So, I'm a few more weeks into using my Asus Eee 1215B netbook. I'm still very happy with it. It's nice and light and the battery life is wonderful. I've been having a lot of issues with it and Linux compatibility, however. I had to run Ubuntu 11.10 Beta-1 in order to resolve a suspend/resume issue I was having. Overall 11.10 is pretty stable but I did run into a few instances here and there where an application would crash, normally a background application though. In addition, I found another particularly annoying bug with the Fn-F9 key. This key combination disables the touchpad, which can actually be kind of useful if I'm typing a lot, and while the first time you press the button it works as it's supposed to (IE turns off the touchpad) I have yet to find a way to turn it back on short of re-creating my home directory. After doing this several times yesterday to fix my accidental button presses (the volume button is right next to the trackpad button) I decided to try something else. I checked out the top picks on the Distrowatch page. There I found a few candidates to try out.

The first candidate was Bodhi linux. I had heard good things about it it and I wanted to give it a shot. Bodhi is an Ubuntu based distribution that uses the Enlightenment E17 window manager. I've always wanted to try that windows manager out. I was sorely disappointed, however, to find that the installer would get stuck at a snowy looking still image at boot and would not move forward. Both the normal and "failsafe" install methods exhibited this same behavior.

The second candidate was Lubuntu 11.04. This is an Ubuntu derivative which uses the LXDE desktop environment. I was again disappointed, though not terribly surprised, that Lubuntu 11.04 had the same suspend/resume issue that Ubuntu 11.04 did.

The third candidate, Crunchbang 10 "statler", is a distro I use on my older Pentium III laptop. It's extremely light weight and based off of the Debian/GNU Linux operating system. I was more successful with Crunchbang than I had been so far with the others. It booted up fine (and quick) but sadly to a 1024x768 resolution. The 1215B has a widescreen monitor so this didn't look quite right. Upon further investigation, this appears to be a known issue with the Radeon HD6250 video cards and is only a problem in the live environment. I will likely return to Crunchbang if Lubuntu 11.10 Beta-1 does not prove any better.

This brings me to the distro I'm currently trying out, Lubuntu 11.10 Beta-1. Again, based off of the Ubuntu 11.10 Beta-1 I was using previously, I expect it to have some of the same bugs, most notably the touchpad issue mentioned early.

I'll add a quick follow up after I settle on a distribution to report on what I ended up with. Though I have a feeling it's going to be Crunchbang 10 from the looks of it.

Saturday, September 10, 2011

Ubuntu 11.10 Beta 1 on an Asus eee 1215B

I purchased an Asus eee 1215B netbook recently with the intent of replacing my IBM T61 for day to day mobile computing. The computer, from the factory comes with a dual core 1Ghz AMD Fusion C-50 APU. It's also equipped with 1GB of DDR3 RAM and a 250GB HDD. I was able to get the laptop for a very reasonable price so I was able to treat it to a 4GB kit of DDR3 and a 60GB OCZ Agility3 SSD. For an operating system I chose Ubuntu 11.04 (before you say I made a typo, keep reading). My first impression with this combination of hardware and software was impressive. I had believed that the 1Ghz processor would hamper performance and that the integrated graphics chip would cause Unity to be sluggish. I was happy to find that I was very wrong. The performance of this little computer couldn't really be any better. You do notice a little lag here and there, but overall, it's very usable. I did find one small annoyance, however. The Radeon drivers included with Ubuntu 11.04 have a bug that prevents the laptop from resuming from suspend successfully. After a bit of digging on the Ubuntu forums, I discovered I was (thankfully) not the only person experiencing this issue and that some had had success upgrading to 11.10 Beta 1. I gave it a shot and got off to a bit of rough start. I had tried installing the proprietary (full 3D acceleration support) Radeon drivers and noticed visual artifacts after resuming from suspend. After removing the proprietary drivers the video never returned to normal so I re-installed. After I re-installed, I avoided installing the proprietary drivers (the default open source ones seem to work just fine) and worked, and is currently working, just fine.

I've been using the laptop for about a week now and I'm very very happy with it's performance. It boots up in just a few seconds and the battery lasts for about 8 hours. I replaced the hard drive with the SSD to increase the battery life and it appears to have had the desired affect as several reviews about the laptop claimed the battery lasted only about 6 hours. There is a little bit of graphical lag from time to time while under heavy processor load, but this was expected given the low end processor. Firefox, however, as well as some of the other commonly used applications open just moments after clicking them open and are just as snappy as my desktop once open.

One of my only complaints about this laptop is that you have to take the whole machine apart and void your warranty to replace the hard drive. Doing this is not particularly difficult but there are several tabs around the edges of the plastic pieces which break very easily while disassembly. I've noticed that the corners of the laptop do not sit flush any more since replacing the hard drive, now, due to some broken plastic clips. I believe Asus could have done a better job of taking a queue from other IBM's T series laptops and skip the clips all together (or just make the laptop more easily removed). Another small annoyance is that the keyboard is held secure underneath by small strips of adhesive padding. once you remove the keyboard once, however, it never quite sticks right anymore and gives the keyboard a slightly loose, almost cheap, feel. This was just yet another disappointment about the build quality of the machine.

All told the laptop is reasonable. While the build quality leaves a bit more to desire. The fact that it came with a price tag of just around $250 ($400 with all upgrades) and was able to replace my T61 for every day mobile computing. It's good for the price and I would recommend it to anyone looking for a highly mobile computer. If you need a smaller footprint Asus also offers a 10" model as well.

Thursday, September 8, 2011

Diaspora, Coming Soon?

I'll cut to the chase. For those who have not heard of Diaspora, it's a new way of thinking about social networks. While that might be partly (or mostly) my own personal opinion, it's at least partly true. Diaspora is going to allow users to do something that's never been done before in the social network arena, manage their own data. The idea behind Diaspora is that users run their own servers and manage their own data. Think of it like the limewire of social networks (ok maybe a bad analogy). Enough of my idle chit-chat and hyping, check out the project for yourself here at The Diaspora Alpha sign up page.

My reason for bringing this up now is that I just got an email from the development team informing me that I have been chosen to join the beta and would be receiving my invite within the next month or possibly even sooner. Now, not that it's required or anything but I think I may finally jump on the opportunity to also try out one of those Plug Computers based on the ARM processor and running Debian 6 (or Ubuntu if possible).

So, that's all for now. I just wanted to jump in and shout out to the Diaspora team for keeping on top of the project and not letting the incredible amount of work required for this project to keep them from their goals. I also wanted to let those who had not heard of it before or who had forgotten about the project know that they should sign up for the Alpha if they want to try it out, and I think everyone should as it has potentially huge implications in the future of how the world uses social networks.

Friday, August 19, 2011

Creative Commons Listening

The Creative Commons Listening posts will contain music recommendations. All of the music recommended in these posts will be licensed under creative commons and I will provide links to the music or musicians websites. As always, I recommend you donate to the artists whatever you feel their music is worth after giving it a listen so that they can continue producing more of what you like.

Today I downloaded some music for my office playlist by the artist MoShang. The album is "Asian Variations". The recommendation came from Thomas Gideon, the host of The Command Line podcast. If you're interested in taking a listen check them out at http://asianvariations.com/. The music is under a Creative Commons license and while there are several download mirrors.

Thursday, August 18, 2011

Rescuing Old Laptops

It's recently become a hobby of mine to surf Craigslist for people trying to get rid of old laptops. I generally search in the < $50 range when looking for a new project as it's likely that the machine will be donated, either to a friend or otherwise if I don't need a new laptop for anything. I recently found a lady selling an IBM T40 that she claimed did not work during one such search a few weeks ago. I picked it up for $25 and quickly found that it definitely had some issues. A few days later a coworker, after seeing my post on G+ regarding the previously mentioned laptop, informed me that there were two T42s in his garage which he believed were also broken and asked me if I could try to get them working for him. I got the laptops from him and both of them were completely dead as well. The interesting thing about the IBM laptops, however, is that a lot of parts were shared among the model families. Since all three laptops I now had were T4x series laptops I was finally able to, after several hours of trouble shooting and testing out each part, able to piece together a working T40/42 hybrid laptop utilizing the screen from one of the T42s and the body and keyboard from the T40. I've since installed Slackware 13.37 and ordered a new battery and charger on Amazon for it (oh how I love you Amazon Prime) and am using it on a regular basis as my new primary laptop. A few minor issues with Slackware aside and I would say I'm really pretty happy with it too. I do wish it had a slightly higher resolution but I can certainly live with 1024x768 for $25.

Random OpenWRT Musing

This evening I was logging in to blogger to try and think about something to post. When I opened Firefox, somehow I ended up pulling my personal domain up in the location bar. It took me to the LuCI control panel for my router... I could have sworn I had a firewall rule in my router that forwarded this to the machine running my Apache server, but then why was the domain redirecting me to my router management page. As it turns out, and I still have not confirmed this, I think I only set up the firewall rule to apply to connections inbound from the WAN port on my router. I can't really test it from inside my network but I plan on testing it out tomorrow at the office. I could have sworn that the last time I tried hitting my domain from the outside it went to a 404 page since my website isn't fully up yet.