Linux Blog

Hey, The Linux Blog has Moved Servers!

Filed under: The Linux Blog News — TheLinuxBlog.com at 6:03 am on Monday, April 13, 2009

Host GatorJust a quick update to let everyone know that The Linux Blog has moved servers. The hosting company I moved to is Hostgator. I was skeptical to move, since I was hosting it off of a shared dedicated server set up with cpanel/WHM reseller accounts, but I think that this will be better in the long run. For example: the price is right, it is faster and I do not have to worry so much about the system administration and hardware upgrades / failures. I get just about as much bandwidth with all the features I got before and a few extra that I couldn’t afford thrown in. All for about the cost of licensing cpanel and whm on their own. The only down side is the little amount of disk space, but if you decide not to be a reseller, you will be fine since they do an unlimited account (just check the fine print as I did on this one.) The really nice thing about the move is the hardware it runs off of (this is from cpanel and verified via ssh)

Processor #1 Vendor: GenuineIntelProcessor #1 Name: Intel(R) Xeon(R) CPU           E5405  @ 2.00GHz

Processor #1 speed: 1994.900 MHz

Processor #1 cache size: 6144 KB

So, Dual Xeon Quad cores that you see above, which equates to quite an amount of CPU power, roughly 16GHz with all cores combined. It has I believe 8GB’s of ram and a ton of disk space which happens to be provided by scsi disks. Hostgator have servers in each of ThePlanet.com’s data centers, I could go on about them all day but if I were you I’d check their website, its all under the “Company” link at the bottom of the page. You might see some banners up around here from now on and you’re probably smart enough to figure out the rest.

If you’re reading this that means you’re reading it off of the new server. Hopefully all went well and it loaded a little quicker. I’m hoping that there wasn’t any disruption of services, there wasn’t for me except for e-mail services but I think that has something to do with the DNS on the server I was sending the mail from (the old one.) Anyhow I hope you enjoy and if you’re in the market for a new web host use my Hostgator links!

Simplify Media: How’d they do that?

Filed under: General Linux — TheLinuxBlog.com at 4:39 am on Tuesday, August 19, 2008

By now every bodies probably heard about the SimplifyMedia.com service which just released an application for the iPhone / iTouch that basically lets you stream your, or your friends music though your phone. Its integrated with iTunes, Winamp and RhythmBox on Linux which is pretty cool. I think this is a neat idea and started thinking: “How’d they do that?”

It seems like it would be pretty difficult to achieve something like this, but in fact the concept is quite simple.

iTunes has a DAAP server built in for multimedia streaming media. What Simplify Media does is connect the stream to their server and then when another client (iPhone app / friend) logs in, if the Simplify Media application is running (on your PC) it lets you know and lets you start streaming it.

I have not analyzed to find out the EXACT method of how it works quite yet but I assume that it either uses Simplify Media’s bandwidth to stream (over https) or creates a reverse connection some how. If any one knows the details I’d be interested to know.

My other thoughts / questions on this are:

Will there be a free DAAP client available for the iPhone / iTouch?
Wouldn’t it be cool if you could record the streams?
How long before Apple pulls this application?
Will AT&T or Simplify Media kick you off, throttle, or even worse charge you for using this service?
If they are using Simplify Media’s bandwidth how are they making money?
How long will it be or will there ever be an open implementation of this?

I can’t really answer any of these questions so, if any one wants to take a stab at answering them go for it!

PHP Script To Log Into cPanel

Filed under: Shell Script Sundays — TheLinuxBlog.com at 3:47 am on Sunday, February 24, 2008

Earlier this week I made a script that logs into cPanel to check statistics. Basically if you have a webhost that runs cPanel and you wish to log into cPanel for some reason then this script is for you. Once you are logged in you can basically do anything you would want to do. For example my specific use was to log into my cPanel nightly and parse some data provided by AWStats. But with some modification this script could automate anything you can do by hand.

Since this is more of a web project for me I decided to write my cPanel login script in PHP. I found a PHP class to login here. curl is used to fetch the URL’s and I parse the data using PCRE regular expressions. The statistics code is still very basic but I thought I would post it for those interested and what better place then The Linux Blog’s Shell Script Sundays column?

Onto the script.

It consists of three scripts each with their own purpose in run time. They are as follows:

cPanel.php – This script does all of the dirty work in connecting to cPanel and fetching the pages. I modified this from the original a little
class.mysql.php – Just a generic data base handler. MySQL configuration information is stored in here.
login.php – This is the script that starts off the process. I named it login.php instead of index.php so that I do not have it run as the default page in my web browser. login.php also does all of the parsing of the data and is where the data gets inserted into the database.

To run the script edit login.php and then you can either put it in your PHP powered web server directory or run it from the command line by doing:

php login.php

The output should be as follows:

Num: 0 Date: 2454521 uniques: X visits: X visits per visitor: (Xvisits/visitor) pages: X pages per visitor: (XPages/Visit) hits: X hits per visitor: (XHits/Visit) bandwidth: X GB bandwidth per visitor: (XMB/Visit)

Feel free to modify this as you wish. If any questions can be answered I’d be happy to do so. I’d like to hear what people are using this for too, so drop a comment!

Download the PHP cPanel Login Script