Sunday, April 27, 2008

Find the System Uptime of your Windows/Linux Box

Ever wanted to find how long your Windows/Linux Box has been running?

For Windows

The Microsoft site suggests the following methods:

use the net statistics server command. Which can be re-written as net stats srv | Find "Statistics since" so we just get the info we are concerned about.

Or use a UpTime tool which does just that.

And my personal favorite method:

systeminfo | Find "Up Time"

Again, extracting only the information relevant to us.
For Linux

For the Linux environment we have the Uptime command:

uptime gives a one line display of the following information. The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.

Saturday, April 26, 2008

Halotography - Photo realistic Halo

Taken off the destructoid website.

Joshua used a combination of Halo 3 and Photoshop CS to give some of these images a more photorealistic look, with some impressive results. "I think this gives a much needed breath of fresh air to Halo," he writes to us. Anyone agree?

Check out his Filcker Page. The attention to detail is just super!

Useful XSLT / XML tools

I've worked on a XSLT based ad-hoc reporting solution a few months back. I don't think could have made much progress without the following tools at my side. Just thought I'd give them an honorable mention.


You guys got any favourite XML tools?

Sunday, April 20, 2008

Karateka and the IBM 8086

Karateka was the first game I ever played. I think I started playing this when I was like 5. Produced and Published by Brøderbund Software, Inc. this game would be the stepping stone for them to later create the famed Prince of Persia.
Sadly I was never really able to finish the game or rescue the princess. I used to get stuck at this position of the game (shown below), not crash or freeze, my character would literary just stand there not responding. Where the "evil-ninja" would then proceed to kick my ass.



I'll blame this on a hardware limitation or some software glitch or maybe it was just a shareware version I had. I used to play the same level over and over until I got bored. What else can a 5 year old to do?

And speaking of hardware, this is the beast I used to run it off:


The great IBM 8086. Oh man! I have so many fond memories around this machine. I guess my love(addiction :) ) for programming and computers as whole started out from here.

And just so you know here are the specs of this beast!
The first IBM PC ran on a 4.77 MHz Intel 8088 microprocessor. The PC came equipped with 16 kilobytes of memory, expandable to 256k. The PC came with one or two 160k floppy disk drives and an optional color monitor. The price tag started at $1,565, which would be nearly $4,000 today.

Saturday, April 19, 2008

Direct Download YouTube Video

So why download a YouTube video when you can just stream it?
Sri Lanka is not best known for it's blazing internet speed (especially the "home" packages). I for one just got tired of looking at choppy video.

Works great if you want to use your videos with your own home brew player/organizer.


Why don't you just go to keepvid.com or use a browser plug-in?

What? Where's the fun in that?
Think command line, think quick launchers, think batch process. Exactly!

Screen scraping
101

This is what I needs to be done to get the download url:
http://www.walkernews.net/2008/02/25/youtube-video-direct-download-link/

This is how we go about doing it in C#:
Download Watch Video page


Parse it for the download Url (this is where the magic happens)

Parse it for the page title (more magic!)


Construct your final URL and That's It!

Download the source and try it out for yourself.

Look forward to a powershell version in the future.