Wednesday, December 29, 2010

A lazy SysAdmin -- Convert Bytes to Kilobytes to Megabytes to Gigabytes to Terabytes

As a sysadmin, there are many repetitive tasks that one does during the day. I try to live by the sysadmin creed that if you have to do a task more than twice it is time to automate.

Recently, I have needed to convert Kilobytes into Megabytes. Now, I know the short cut is just divide by 1000. But, that is only just a short cut. Really the magic number is 1024. There are a lot of converters on the Internet. I use many of them. Because I have never been good at bookmarking or the bookmark is on another workstation, I have to continually search for that converter that I have used in the past.

With that, I borrowed the one that I found on the Internet here. I just wanted the javascript and I wanted add a reset button, so I cleaned it up a little and put it in a basic web page. What I came up with can be seen here. It is simple and does what I need.

Now I just need to put this page on an internal web server or on my local workstation and I can call it up when ever I need.