Thursday, November 24, 2011

Download any Flash video you can view, using Linux.

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.

http://www.collegehumor.com/video/6653193/occupy-wall-street-vs-the-iphone-line

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:

npviewer. 12550 loughkb 11u REG 8,1 22889528 13631698 /tmp/FlashXXdNKpIi (deleted)

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:

lrwx------ 1 loughkb loughkb 64 2011-11-24 20:10 11 -> /tmp/FlashXXdNKpIi (deleted)

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.


Isn't Linux great!



Thursday, November 17, 2011

Unexpected uses of a knoppix thumbdrive system.

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

I may stick with Ubuntu after all.

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

Ubuntu, the end is near....

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.