Wednesday, December 7, 2011

I am fortunate to work in a large company that uses macs for their workstations. All the shiny gui simplistic user facing stuff aside, under the hood it's BSD Unix, mostly. Sure, Apple has done their best to break Unix, and sometimes they succeed in even bringing down the kernel, but otherwise, it's good enough.

Being Unix, you have wonderful tools like rsync, ssh, and Gzip for easily moving data between machines with compression. You can build your own cron driven backup scheme if you really want to bang out the scripts, or you can run BackupPc. (link at end of post)

In my company, we need to maintain a backup of executive machines and some server data.

This is a task that could be quite expensive in most enterprise. A powerful server, running an expensive OS from M$. An equally expensive backup program, more money for licenses for the number of clients you'll be backing up.. An expensive DLT tape system or Optical based system. Maintenance heavy with downtime for M$ updates or (this always makes me chuckle) defragging the servers drive for performance..

In my case, a bit of ebay browsing netted a Dell PowerEdge 2950 server with 4gig of Ram, dual 2.3Ghz dual-core Xeons, and six SAS drive caddies, for only $400.00 Add six 1TB Western Digital green drives for not quite $800 and you're done with expense.

Now we build a RAID5 array with the drives and we're sitting on 4.5 TB of redundant storage. With compression, that's enough for over 100 client machines easy. (more on this in a moment)

Hardware acquired, lets look at software. I like Debian as an all around swiss army knife server OS. Everyone has their favorite, we're not going to debate who's OS can beat up who's here. Now, lets think about the discs. We want at least three partitions on our big RAID, one for the system, swap space, and our backup storage.

I set up about 40Gig for the root system, that's probably overkill by a long ways, but who knows about what might come down the road over the life of the machine? Swap space, I like to match my RAM size, so 4Gig there, and the rest as an ext3 partition mounted where BackupPC stores its backup data:

/var/lib/backuppc

After formatting the partitions, Debian took only two minutes to install. Two minutes? Yes, that's all. I used the textual installer, and only checked the components I needed, apache, ssh server, base system.. No Gui needed on a real server! That would just waste resources.

Configuring BackupPC takes editing a few perl scripts. That might sound daunting, but they are HEAVILY commented, and it's not very hard to understand them. The tricky part is the clients.

For BackupPC to work best, you want to let it use rsync as it's method to move data from the clients. For rsync to work best, you want to exchange RSA public keys between the server and the clients. Since my company uses Unix based Macs as workstations, this is simple to set up. Now BackupPC has root access to the clients and can use rsync to pull data efficiently.

Internally BackupPC does some nice tricks to save disk space. For each client it backs up, it will look at the files in the backup pool, and remove any duplicates, replacing them with hard links. This is a HUGE space saver in an enterprise where many machines have the same applications installed. Additionally, backup data can be compressed on the fly with gzip, further saving space.

In my example, I have 30+ full workstations backed up in less than 1TB of space. More impressive when you count that one of the machines in particular has an insane 780Gig of data on it. (I won't comment on the why, it's not under my control.) most of the machines count toward 20-40Gig of data being backed up. Keep a week of incremental backups and a couple of full backups and I get up to 1.4TB. Still not bad at all.

On this older Dell, the performance under linux is so good that the 30 clients get through an incremental backup in just a few hours at night.

BackupPC is driven by a web interface that makes it very easy to monitor it and so so very easy to restore from the backup.

If a user needs a file, folder, or even their entire home directory restored during disaster recovery, it's quick and easy. In the web interface, you browse through their backups to find the file, folder, etc., then simply check a box next to it and click a button to restore the files. BackupPC then uses rsync again and puts the file right back directly to the clients machine. In seconds.

Thursday, November 24, 2011

Some time ago, it was possible to grab any flash video you were watching under Linux very easily. The flash player buffers the data, we've all noticed the progress bar at the bottom of the video, filling in ahead of the marker or play head showing where we are in the time line. Where is this data stored?

Up until a year or so ago, that place was /tmp. The systems official temporary directory. While the video was playing, and the buffering indicator had reached the end, indicating the entire video had been downloaded, the Flash video file could simply be copied out of the /tmp folder to your desktop or other destination. This could even be done in the GUI, no need for the terminal.

Then something changed. I don't know if it was an addition to the Flash player, or just Flash developers getting smarter about hiding their temporary data to prevent anyone from obtaining a local copy of the video. Regardless, the simple fact remains that the /tmp folder no longer appears to contain the downloaded video while watching. The key word in that sentence is “appears”.

The file is actually still there, but a bit or flag is set, marking it as a deleted file! Even though the Flash player is actively using the file. Since it is marked 'deleted', the filesystem denies access to it and nothing can see it. Here's where we get tricky with Linux tools...

To illustrate this, I'll open my browser to a video file on CollegeHumor.com. If you want to follow along, here is the link.

Once the video starts, you can pause it or watch, that doesn't matter. What does is the grey filling in of the time line indicating the file is downloading. Once it has filled in completely, open a terminal and type:

lsof | grep Flash

lsof is a command that lists all open files on your system, including pipes. We're sending it's long output via the pipe symbol | into the grep command which will filter the output, only passing lines that meet our criteria. In this case, we only want to see lines that contain the text, “Flash”. The output I get is:

The first string is the name of the process that owns the file, the next number is important, it is the process ID number. Following is my username and then the fourth column contains the other important bit of info, in this case, “11U”. The number 11 will be the name of a link we will find shortly

Now, we'll CD down into the proc folder, a folder that contains live information about everything going on in your system. One could write a book about the contents of /proc, and someone probably has. Without getting technical, the process number we obtained above, will be represented as a directory within /proc. We'll cd down into that folder and a sub folder called “fd”.

cd /proc/12550/fd

Now, we'll pull a file listing with details.

ls -l

This gives us a file listing, and here we find our Flash video data within a long list of data. My example gives:

The lower case letter l at the beginning tells us this is a link to a file named 11 that is linked to FlashXXdNKpli in /tmp. You can see the file is flagged as deleted, even though the Flash player is currently using it.

All we need to do now is copy this linked file out somewhere to get a real copy of the file. I'll copy and rename it to a file on my desktop:

cp ./11 ~/Desktop/flashvid.flv

This copies the linked (deleted) file to my desktop as flashvid.flv. Now I have the Flash video file and I can watch it with vlc or any media viewer that plays flash. I can convert it to other formats with Winff, Open and edit it directly in OpenShot, etc.

Thursday, November 17, 2011

Knoppix is pretty cool. It's a linux live system on a USB stick, which by itself is not something too impressive anymore. This is something that's been done for years now, with other systems like Damn Small Linux, Puppy Linux, based off the original Knoppix I believe.

But the Knoppix guys really have a good setup. You can encrypt local storage on the stick so that someone else can't get to your data if you lose the drive. You can install applications that are persistent and available the next time you boot the stick. In essence, you have a portable computer that just borrows whatever hardware you boot it on.

I made it a habit to keep a knoppix thumbdrive in my pocket. You never know when you might need to kill a virus off some poor windows users system. But recently, I truly realized the utility of this system on a thumb drive..

I'd set up Chrome on it as the browser, with sync enabled so it always has my current bookmarks, and extensions. I love that feature of chrome. I can add a bookmark on my desktop, and when I'm on my netbook, my Commodore Vic Slim, or my knoppix system, I'll have the bookmark. Google should take syncing one step further and sync open tabs and the last page you were on before shutting Chrome down. Then I could finish reading that interesting article without having to find it again.

As an I.T. professional, I sometimes have to work from home. I have my desktop set up with openVPN to talk to work, and vnc in to my workstation to let me do almost anything I can do while actually at work. Well, why not set up similar on the Knoppix system? So I did.

Now, I have an emergency computer of sorts always in my pocket. Lets say that my desktop systems hard disk fails some night, you can't predict hardware failure, and the system drive dying late at night would put me out of commission if I had an urgent call from work.

How about when I'm visiting friends or my folks? They all have internet connections, I could pop in the knoppix stick and boot to my system to get to work within a couple of minutes.

It's really an ideal solution to always having something to rely on, conveniently bouncing away in my pocket. No need to drag along a netbook, just in case...

Check out Knoppix, it's one of the best portable live Linux distros out there.

Saturday, November 5, 2011

My last post detailed my disappointment with Canonocles direction toward a tabletesque user interface, and concerns with the 3.x kernel. There were many comments, surprisingly, but I'm sure due to the publication of my story by Lx'er, thanks guys! I found many of the comments interesting and some helpful.

My favorite computer for daily use right now is my Commodore Vic Slim. Presently it's hard disk contains Ubuntu 10.10, with an external drive for beta testing Commodores OS. I can't talk about the Commodore OS yet due to the NDA I'm under, but I will produce a few first look videos as soon as it's released. I have a video overview of the Vic already posted here:

http://www.youtube.com/watch?v=XVTQjG-n0TE

Lately I have been using the Xfce window manager, and like Linus himself decided, it may be my salvation for my collection of machines if I continue forward with Ubuntu. There's still the bugs with the new kernel, it won't suspend properly, the worrying reports of it killing the display on the model of netbook I own, etc. But Xfce looks to be a useful and fast GUI that still provides the functionality I prefer in a desktop.

I have Ubuntu 11.10 running in a VirtualBox VM and I'll be beating it up there for awhile, testing it's limitations and advantages. I already knew about the classic mode of gnome shell and had given it a go, but it still felt overly simplified and limited. That is the key problem I have with all of the tablet style interfaces that are emerging.

Sure, the simplified interfaces the big three are working out are easier for non-computer people to work with and make computers more accessible to the general consumer, and I recognize the advantage there for pushing tech into the public's hands. But I'm not those people, I'm an I.T. professional with twenty five years of experience in the computer field and the skills that come with it.

It's looking like Xfce will become my home for awhile, if or when I make the move to Ubuntu 11. Thanks for reading. And watch this space in the coming week or two for my first look at Commodores new OS.

Wednesday, November 2, 2011

I was a huge ubuntu fan. They got it *right* for a few years there, from 9.10 through 10.10 which I currently run on my netbook and desktops. My son's machine is still on 10.04, and now I have a problem.

It seems they just decided that 10.04 is reaching end of life and now I can't perform updates on his machine. Further, the option to easily upgrade to 10.10 is no longer available in the update manager, they want us all to move to 11.10.

No thank you. To be fair, I have given 11 a test drive, a long one over two weeks on my Commodore Vic Slim desktop machine. Simply put, I *HATE* unity. It is extremely unfriendly to the desktop user, getting in the way, buggy, too tabletesque if that's a word I can use.

Apples iPad is certainly a game changer in the consumer world of popular computing. Now the big three, Apple, Microsoft, and Canonocal are moving their desktop interface in the direction that makes them friendly to a tablet form factor. And there's really nothing wrong with that. I understand that the consumer world likes the convenience of the tablet for media consumption. But there needs to be a classic desktop mode available for those of us that still want to use desktop machines.

Gnome 3 is not quite stable yet, I may give it another spin and try harder to adapt and live with the bugs, but I still love Gnome2. It's stable and reliable. I like that my machines just work. I like having a few important bits of information available via panel applets. I like the classic desktop paradigm, it works for me and the way I use my computers.

There are still too many problems with the new interfaces and the new kernel. Frankly, I'm afraid to run the new kernel on my MT101T eeePC netbook, I've read about a few people who've had their MT101T bricked by the new kernel and had to send them in to Asus for repair.

Soon, Ubuntu 10.10 will reach end of life and lose it's repositories. Soon I will have to migrate to something else and go through the trouble of reloading my machines. Kind of a pain since linux is so stable, I'd hoped to be able to just use my machines until the hardware died.

Wouldn't that be nice? To have a system where I could just worry about work I want to accomplish on the computer and not have to worry about the OS and keeping things running? Isn't that supposed to be an advantage of going with Linux on the desktop? Build it and just use it day-to-day without things breaking? I know that's what I want.

But these days, software companies and organizations seem to be in a race, a race to introduce new features and out do each other on *new* stuff. Rather, they should be spending time on fixing and trimming and speeding up existing software.

Ubuntu 10.10 got many things exactly right and was nearly the perfect desktop for me. But soon, Canonocle will force me to change by dropping support of one of the best Linux desktops that ever came along. This leaves me sad, and very hesitant to recommend Ubuntu to others.

So now, the search begins for another desktop OS. And I'm left a little sad.