<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>High Speed Web Blog &#187; Networking</title>
	<atom:link href="http://blog.highspeedweb.net/category/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.highspeedweb.net</link>
	<description>Where information gathers to be heard.</description>
	<lastBuildDate>Fri, 03 Sep 2010 17:48:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WHMCS Plugin &#8211; Cacti Statistics</title>
		<link>http://blog.highspeedweb.net/2009/10/15/whmcs-plugin-cacti-statistics/</link>
		<comments>http://blog.highspeedweb.net/2009/10/15/whmcs-plugin-cacti-statistics/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 14:25:29 +0000</pubDate>
		<dc:creator>Jay Ward</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[bandwidth monitor]]></category>
		<category><![CDATA[Cacti]]></category>
		<category><![CDATA[Cacti Stats]]></category>
		<category><![CDATA[Cactistats]]></category>
		<category><![CDATA[dedicated server billing]]></category>
		<category><![CDATA[HighSpeedWeb]]></category>
		<category><![CDATA[over use]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[switch control]]></category>
		<category><![CDATA[WHMCS]]></category>

		<guid isPermaLink="false">http://blog.highspeedweb.net/?p=383</guid>
		<description><![CDATA[Share this on del.icio.us Digg this! Share this on Facebook Email this to a friend? Stumble upon something good? Share it on StumbleUpon Tweet This!]]></description>
			<content:encoded><![CDATA[<p><img class="left" src="http://blog.highspeedweb.net/wp-content/themes/darkwater-11/images/jay.gif" alt="" width="50" height="50" /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/nu6AZbVaEiU&#038;hl=en&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/nu6AZbVaEiU&#038;hl=en&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><a href="https://accounting.highspeedweb.net/docs/"><img src="http://blog.highspeedweb.net/wp-content/uploads/2009/10/cactistatsreleasedblog.jpg" alt="CactiStats v1 Released!" title="cactistatsreleasedblog" width="450" height="50" class="size-full wp-image-394" /></a><br />
<span id="more-383"></span><br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/AuAjuiObp3A&#038;hl=en&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/AuAjuiObp3A&#038;hl=en&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><a href="https://accounting.highspeedweb.net/docs/"><img src="http://blog.highspeedweb.net/wp-content/uploads/2009/10/cactistatsreleasedblog.jpg" alt="CactiStats v1 Released!" title="cactistatsreleasedblog" width="450" height="50" class="size-full wp-image-394" /></a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.highspeedweb.net/2009/10/15/whmcs-plugin-cacti-statistics/&amp;title=WHMCS+Plugin+-+Cacti+Statistics" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.highspeedweb.net/2009/10/15/whmcs-plugin-cacti-statistics/&amp;title=WHMCS+Plugin+-+Cacti+Statistics" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.highspeedweb.net/2009/10/15/whmcs-plugin-cacti-statistics/&amp;t=WHMCS+Plugin+-+Cacti+Statistics" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22WHMCS%20Plugin%20-%20Cacti%20Statistics%22&amp;body=Link: http://blog.highspeedweb.net/2009/10/15/whmcs-plugin-cacti-statistics/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.highspeedweb.net/2009/10/15/whmcs-plugin-cacti-statistics/&amp;title=WHMCS+Plugin+-+Cacti+Statistics" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=WHMCS+Plugin+-+Cacti+Statistics+-+http://b2l.me/pgd29&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.highspeedweb.net/2009/10/15/whmcs-plugin-cacti-statistics/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Lexmark x9350 Network Printer Product Review.</title>
		<link>http://blog.highspeedweb.net/2009/07/23/lexmark-x9350-product-review/</link>
		<comments>http://blog.highspeedweb.net/2009/07/23/lexmark-x9350-product-review/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 17:56:34 +0000</pubDate>
		<dc:creator>BrettW</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Lexmark]]></category>
		<category><![CDATA[network printer]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[product review]]></category>
		<category><![CDATA[x9350]]></category>

		<guid isPermaLink="false">http://blog.highspeedweb.net/?p=371</guid>
		<description><![CDATA[Ok let me start this by saying at this time I&#8217;m awaiting the RMA to send my Lexmark x9350 back to our supplier.  We needed a network capable printer to allow us to be able to print from a satellite office to our main headquarters.  After doing some searches online we ran across a decent [...]]]></description>
			<content:encoded><![CDATA[<p><img class="left" title="brett" src="http://blog.highspeedweb.net/wp-content/uploads/2009/02/brett.gif" alt="brett" width="50" height="50" /> Ok let me start this by saying at this time I&#8217;m awaiting the RMA to send my Lexmark x9350 back to our supplier.  We needed a network capable printer to allow us to be able to print from a satellite office to our main headquarters.  After doing some searches online we ran across a decent deal on this x9350. It is capable of both wifi and Ethernet connections and offers the normal multi-function printer tools.  But after we received it and attempted to install it, the problems started cropping up.</p>
<p><span id="more-371"></span>Normally installing a network capable printer is a routine task. Install the drivers, select the port you want to use (tcp/ip), and for the most part go. Yes I&#8217;m over simplifying the process, but not by much.  Installing the x9350 though wasn&#8217;t even close to this procedure.  First of all I could not simply add the printer through add printers, even as the administrator. I was forced to use the Lexmark installer, which is a bit odd, but not immediately problematic.  However the installer would not see the printer on the network. I could install it just fine with the usb cable, but that defeats the purpose of having it as a network printer, unless I want to chain it to another print server of some form.</p>
<p>So I called Lexmark tech support, and yes, the techs are in India.  And while I have no doubt our Indian IT counterparts are more then qualified to handle support calls, it doesn&#8217;t make their accents any easier to understand. Nothing personal, and I don&#8217;t mean to knock their abilities, but when I&#8217;m already frustrated by an unusual and needlessly difficult printer install, it would certainly make things a bit easier if I could readily understand the person trying to help (Are you listening Lexmark????).  With that said, they were obviously having a hard time understanding me as well, because even after repeating it a number of times and to a number of tech&#8217;s, they kept insisting that I was trying to set this up as a wireless printer. I even asked them to remove any instances of wireless anything from my support ticket, though that proved to be about as futile as this printers ability to connect across the WAN.  Finally after stumping a couple of techs I was transferred to network support and got a tech who seemed to speak English as a first language.  She again guided me through the install from start to end, only to achieve the same results I did, no x9350 printer in windows printers.  She put me on hold to consult another IT staffer, who then told her that all network ink jet printers use MAC address as opposed to TCP\IP to simplify the installation and make it easier for the installer to find. MAC addresses are not however route capable and thus I will not be able to use this network printer on our network. Which leaves me at the point I stated at the beginning of this blog post, as I am currently waiting for my RMA to send this printer back to our supplier.</p>
<p>To sum things up, I never was able to use this printer because Lexmark decided to create a port / protocol that is incompatible with the standard tcp/ip port already present in EVERY Operating System. And Lexmark has needlessly hurt their own product by trying to simplify an already easy operation. And for the people who would have difficulties setting up a network printer, those people would have to call tech support anyway, which just makes their attempt at simplifying this process a completely mute point.  I will certainly think twice before purchasing a Lexmark printer in the future, and well given the same amount of time to read reviews etc prior to buying a new printer, I&#8217;ll just assume Lexmark does not make a product that will fit our business needs and start my search with their competitors. If I were to give them a score between 1 &#8211; 10, Lexmark would have to provide me the points to achieve a positive integer.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.highspeedweb.net/2009/07/23/lexmark-x9350-product-review/&amp;title=Lexmark+x9350+Network+Printer+Product+Review." rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.highspeedweb.net/2009/07/23/lexmark-x9350-product-review/&amp;title=Lexmark+x9350+Network+Printer+Product+Review." rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.highspeedweb.net/2009/07/23/lexmark-x9350-product-review/&amp;t=Lexmark+x9350+Network+Printer+Product+Review." rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Lexmark%20x9350%20Network%20Printer%20Product%20Review.%22&amp;body=Link: http://blog.highspeedweb.net/2009/07/23/lexmark-x9350-product-review/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %20Ok%20let%20me%20start%20this%20by%20saying%20at%20this%20time%20I%27m%20awaiting%20the%20RMA%20to%20send%20my%20Lexmark%20x9350%20back%20to%20our%20supplier.%C2%A0%20We%20needed%20a%20network%20capable%20printer%20to%20allow%20us%20to%20be%20able%20to%20print%20from%20a%20satellite%20office%20to%20our%20main%20headquarters.%C2%A0%20After%20doing%20some%20searches%20online%20we%20ran%20across%20a%20decent%20deal%20on%20t" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.highspeedweb.net/2009/07/23/lexmark-x9350-product-review/&amp;title=Lexmark+x9350+Network+Printer+Product+Review." rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Lexmark+x9350+Network+Printer+Product+Review.+-+http://b2l.me/pgd3j&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.highspeedweb.net/2009/07/23/lexmark-x9350-product-review/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Power of Perl &#8211; Controlling and expanding Cpanel/WHM through the Cpanel/WHM API</title>
		<link>http://blog.highspeedweb.net/2009/02/11/power-of-perl-controlling-and-expanding-cpanelwhm-through-the-cpanelwhm-api/</link>
		<comments>http://blog.highspeedweb.net/2009/02/11/power-of-perl-controlling-and-expanding-cpanelwhm-through-the-cpanelwhm-api/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 02:39:16 +0000</pubDate>
		<dc:creator>Jay Ward</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[cpanel tutorial]]></category>
		<category><![CDATA[if statement]]></category>
		<category><![CDATA[perl documentation]]></category>
		<category><![CDATA[references]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[scripting tutorials]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web developer]]></category>

		<guid isPermaLink="false">http://blog.highspeedweb.net/?p=248</guid>
		<description><![CDATA[When running a shared hosting environment, it is impossible to stay competitive without the use of some form of control panel. And in the world of linux shared web hosting, no control panel is as widely used as cPanel Inc&#8216;s cPanel/WHM combo. The Cpanel team has put a lot of time and effort into the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="left" src="http://blog.highspeedweb.net/wp-content/themes/darkwater-11/images/jay.gif" alt="" width="50" height="50" />When running a shared hosting environment, it is impossible to stay competitive without the use of some form of control panel. And in the world of linux shared web hosting, no control panel is as widely used as <a href="http://www.cpanel.net/company/index.htm">cPanel Inc</a>&#8216;s <a href="http://www.cpanel.net/products/cpwhm/cpanel11/index.html" >cPanel/WHM</a> combo. The Cpanel team has put a lot of time and effort into the remote administration of WHM, and through that Cpanel. With a little ingenuity and not much work, really, this API can be extended to include any functions you can imagine, up to and including the system administration of the machine itself. So lets look at the basics thereof.<br />
<span id="more-248"></span><br />
For this example I am going to use perl, for several very good reasons. The first is that 96% (roughly) of cPanel/WHM is programmed in perl and sits in uncompiled files that we can use for reference. Secondly, perl is inherently a system administration language and therefore gives us much more native system functionality, not to mention its powerful regular expression engine. And, lastly, I choose perl because the heart of this entire process is already done for us by cPanel themselves and available for download as a perl package <a href="http://cream.highspeedweb.net/Accounting.pm">here</a>.</p>
<p>If you look through the package, you will see that it already has quite a bit of functionality built in. In fact, it really has most everything you would need to automate the web hosting process. However that&#8217;s not enough for us, we want more! </p>
<p>The first thing we are going to want to edit is the new subroutine in the Accounting package. You can see it is stubbed out already:</p>
<pre>
sub new {
    my ($host);
    my ($user);
    my ($accesshash);
    my ($error);
    my ($usessl);
    my ($timeout) = 300;
    my $self = {};

    bless($self);

    return ($self);
}
</pre>
<p>This function is going to need to establish 4 things that we will use for the API calls. First, a host name. Simple enough. Second, a user. Generally, this is root, though it can be just about anyone with WHM access. Third, an accesshash. This can be found in the user we specified&#8217;s home directory in a text file called .accesshash. If one doesn&#8217;t exist, login to WHM through the web interface (https://yoursever:2087/ and goto the remote access hash link and it will generate and create said text document. Finally, we need to know whether or not to use SSL to communicate. There are very few times when you want that to be no.</p>
<p>My changed new subroutine looks something like this:</p>
<pre>
sub new {
    my $class = shift;
    my $name = shift;
    my $user = shift;
    my $accesshash = shift;
    my $usessl = shift;
    my $self = {
       host => $name,
       user => $user,
       accesshash => $accesshash,
       error => "",
       usessl => $usessl,
       timeout => 300
    };
    bless($self, $class);
    return ($self);
}
</pre>
<p>This is an overly simplified example of a possible solution. In my production code, I use a <a href="http://search.cpan.org/~tmtm/Class-DBI-0.96/lib/Class/DBI.pm">Class::DBI</a> based class to pull the info I need from a database and pass it into here where this subroutine extracts the information it needs. Pretty easy, isn&#8217;t it?</p>
<p>Next we create a stub program to use the package we just edited.</p>
<pre>
#! /usr/bin/perl -w

use lib "/usr/local/hsw/libs/";
use C::Accounting;
use Data::Dump;

my $name = shift @ARGV || "server1";
my $func = shift @ARGV || "listxmlapps";

open(AHASH, "/root/.accesshash");
my @access = <AHASH>;
close AHASH;
my $accesshash = join("\n", @access);

my $whm = C::Accounting($name.".mydomain.com", "root", $accesshash, 1);
print "Running ".$func." on ".$name." with ".join(" ", @ARGV)."\n";
my $t;
eval '$t = $whm->'.$func.'(@ARGV)'; # If you have a better way of doing
                                    # this, please let me know!
if($@) { print "ERROR : ".$@."\n"; }
if($s->{error} ne "") { print "ERROR : ".$s->{error}."\n"; }
Data::Dump->dump([[$t]]);
</pre>
<p>So here we take the first two arguments passed in on ARGV, and assign them to the host and a function for us to run on it. We get the access hash from root&#8217;s home directory then we create an Accounting object. I use eval to run the function that was passed in on Accounting object and pass it in what is left in ARGV, if anything. We do some error checking and display them if they exist, then I used Data::Dump to result to the screen. Simple, but it gives us what we need to see the API at work.</p>
<p>If we run this from the commandline, we get something like this:</p>
<pre>
-bash-3.2# ./testnsclient
Running listxmlapps on server1 with
(
  "C::Dump",
  [
    [
      {
        app => [
                 "adddns",
                 "addip",
                 "applist",
                 "delip",
                 "dumpzone",
                 "fetchsslinfo",
                 "gethostname",
                 "getlanglist",
                 "killdns",
                 "listacls",
                 "listcrts",
                 "listips",
                 "listzones",
                 "loadavg",
                 "lookupnsip",
                 "myprivs",
                 "nvget",
                 "nvset",
                 "passwd",
                 "reboot",
                 "restartservice",
                 "sethostname",
                 "setresolvers",
                 "version",
               ],
      },
    ],
  ],
)
</pre>
<p>By throwing in a few arguments, we run a different function:</p>
<pre>
-bash-3.2# ./testnsclient server1 loadavg
Running loadavg on server1 with
(
  "C::Dump",
  [[{ fifteen => "0.14", five => "0.18", one => "0.17" }]],
)
</pre>
<p>So awesome!  Now what if we want to expand on this to do something cPanel doesn&#8217;t natively do? Suppose we wanted more information than what the loadavg command just gave us? Well, we need to goto the cPanel server itself. We navigate to /usr/local/cpanel/whostmgr/docroot and create a directory in there for our functions. We could create files directly in the docroot, but we don&#8217;t want our stuff interfering with cPanel&#8217;s, nor vice versa. I called mine hsw. In there, let&#8217;s create a file called load.cgi and put this inside:</p>
<pre>
#! /usr/bin/perl -w

use strict;
use CGI;

my $q = new CGI;
print $q->header();
open(ME, "|-", "cat /proc/loadavg");
while(<ME>)
{
  print $_;
}
</pre>
<p>Chmod the file to be 755 and run it, it gives this:</p>
<pre>
-bash-3.2# ./load.cgi
Content-Type: text/html; charset=ISO-8859-1

0.28 0.18 0.15 2/96 12631
</pre>
<p>Great! So that works. Now we head back to our C::Accounting package and we add a function to handle this new functionality.</p>
<pre>
sub load
{
    my ($self) = @_;
    my (%PKGS);

    my (@PAGE) = $self->whmreq("/hsw/load.cgi");

    if ( $self->{error} ne "" ) { return (); }

    foreach $_ (@PAGE) {
        s/\n//g;
        my @contents = split(/\s/, $_);
        $PKGS{"1min"}    = $contents[0];
        $PKGS{"5min"}    = $contents[1];
        $PKGS{"15min"}   = $contents[2];
        my @procs = split(/\//, $contents[3]);
        $PKGS{"running"} = $procs[0];
        $PKGS{"total"}   = $procs[1];
        $PKGS{"lastPID"} = $contents[4];
    }
    return \%PKGS;
}
</pre>
<p>So we run the subroutine whmreq with the path to our script as an argument. We are given back an array of lines that were returned. We simply parse that out and assign the information to appropriate indexes in a hash table. We then pass the reference of the hash back. By running our stub-app, we get the following:</p>
<pre>
-bash-3.2# ./testnsclient server1 load
Running load on server1 with
(
  "C::Dump",
  [
    [
      {
        "15min" => "0.10",
        "1min"  => "0.07",
        "5min"  => "0.13",
        lastPID => 21897,
        running => 1,
        total   => 89,
      },
    ],
  ],
)
</pre>
<p>Well, that gives you the basics you need to expand the capability of cPanel/WHM&#8217;s API to include your own functionality and subroutines. Now you can get your cpanel/WHM boxes, even the DNS Only versions, to do anything that perl can do&#8230; remotely and programmatically. </p>
<p>This is a very powerful tool, use it wisely.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.highspeedweb.net/2009/02/11/power-of-perl-controlling-and-expanding-cpanelwhm-through-the-cpanelwhm-api/&amp;title=Power+of+Perl+-+Controlling+and+expanding+Cpanel%2FWHM+through+the+Cpanel%2FWHM+API" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.highspeedweb.net/2009/02/11/power-of-perl-controlling-and-expanding-cpanelwhm-through-the-cpanelwhm-api/&amp;title=Power+of+Perl+-+Controlling+and+expanding+Cpanel%2FWHM+through+the+Cpanel%2FWHM+API" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.highspeedweb.net/2009/02/11/power-of-perl-controlling-and-expanding-cpanelwhm-through-the-cpanelwhm-api/&amp;t=Power+of+Perl+-+Controlling+and+expanding+Cpanel%2FWHM+through+the+Cpanel%2FWHM+API" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Power%20of%20Perl%20-%20Controlling%20and%20expanding%20Cpanel%2FWHM%20through%20the%20Cpanel%2FWHM%20API%22&amp;body=Link: http://blog.highspeedweb.net/2009/02/11/power-of-perl-controlling-and-expanding-cpanelwhm-through-the-cpanelwhm-api/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A When%20running%20a%20shared%20hosting%20environment%2C%20it%20is%20impossible%20to%20stay%20competitive%20without%20the%20use%20of%20some%20form%20of%20control%20panel.%20And%20in%20the%20world%20of%20linux%20shared%20web%20hosting%2C%20no%20control%20panel%20is%20as%20widely%20used%20as%20cPanel%20Inc%27s%20cPanel%2FWHM%20combo.%20The%20Cpanel%20team%20has%20put%20a%20lot%20of%20time%20and%20effort%20into%20the%20" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.highspeedweb.net/2009/02/11/power-of-perl-controlling-and-expanding-cpanelwhm-through-the-cpanelwhm-api/&amp;title=Power+of+Perl+-+Controlling+and+expanding+Cpanel%2FWHM+through+the+Cpanel%2FWHM+API" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Power+of+Perl+-+Controlling+and+expanding+Cpanel%2FWHM+through+the+Cpanel%2FWHM+API+-+http://b2l.me/pjb6q&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.highspeedweb.net/2009/02/11/power-of-perl-controlling-and-expanding-cpanelwhm-through-the-cpanelwhm-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl on Linux &#8211; Iterative, Forking, Multi-Request Handling Server</title>
		<link>http://blog.highspeedweb.net/2008/08/07/perl-on-linux-iterative-forking-multi-request-handling-server/</link>
		<comments>http://blog.highspeedweb.net/2008/08/07/perl-on-linux-iterative-forking-multi-request-handling-server/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 21:31:14 +0000</pubDate>
		<dc:creator>Jay Ward</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://blog.highspeedweb.net/?p=63</guid>
		<description><![CDATA[Every so often you want to do something cool in perl, like make your own server capable of handling multiple requests. And if you are developing any type of network server, this functionality is not only handy, but essential. And so, without much further adieu, let&#8217;s do this. In order to save ourselves much time [...]]]></description>
			<content:encoded><![CDATA[<p><img class="left" src="http://blog.highspeedweb.net/wp-content/themes/darkwater-11/images/jay.gif" alt="" width="50" height="50" />Every so often you want to do something cool in perl, like make your own server capable of handling multiple requests. And if you are developing any type of network server, this functionality is not only handy, but essential. And so, without much further adieu, let&#8217;s do this.<br />
<span id="more-63"></span><br />
In order to save ourselves much time and annoyance, we are going to use the very standard <a href="http://search.cpan.org/~gbarr/IO-1.2301/IO/Socket/INET.pm" target="_blank">IO::Socket</a> module to handle the IO stream and sockets.</p>
<pre>
#! /usr/bin/perl
use strict;
use IO::Socket;
my $server = IO::Socket::INET->new
                          (
                            LocalPort => 9876,
                            Type => SOCK_STREAM,
                            Reuse => 1,
                            Listen => 10
                          )
                          or die "Unable to create socket.\n";
</pre>
<p>So first we create the socket with port 9876, make it a socket stream, set it to be reusable, and give it a queue listening size. If we are unable to create the stream, there isn&#8217;t much point of continuing (at least in this example) so we die.</p>
<pre>
my $connect = 0;
print "Waiting for a connection...\n";
while (my $cli = $server->accept())
{
</pre>
<p>We initialize a variable to keep track of how many connections we have going and then start the while loop that operates as long as we are able to accept a connection. </p>
<pre>
  if(fork() == 0))
  {
</pre>
<p>Once we get a connection, we fork, and if fork == 0 then we know we&#8217;re the child process and therefore we will handle the request!</p>
<pre>
    print "Connection received (#$connect)\n";
    while(<$cli>)
    {
      $connect++;
</pre>
<p>So now we loop through and read the input from the socket</p>
<pre>
      print "recieved $_";
      $result = eval ($_);
      print "result is $result\n";
      print $cli "$result\n";
</pre>
<p>So we read in the data, eval it, and return the result to the client &#8230; wouldn&#8217;t ever want to do this for real, but it makes a good example!</p>
<pre>
    }
    print "Terminating connection #$connect\n";
    exit 0;
</pre>
<p>We exit now (being the child process).</p>
<pre>
  }
  print "Waiting for connection #$connect\n";
}
</pre>
<p>And that&#8217;s it! Give it a shot, play around with it. This also works really well with the <a href="http://blog.highspeedweb.net/2008/07/02/perl-on-linux-making-a-deamon/">Daemon Making Tutorial</a> to make a server daemon.  Enjoy!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.highspeedweb.net/2008/08/07/perl-on-linux-iterative-forking-multi-request-handling-server/&amp;title=Perl+on+Linux+-+Iterative%2C+Forking%2C+Multi-Request+Handling+Server" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.highspeedweb.net/2008/08/07/perl-on-linux-iterative-forking-multi-request-handling-server/&amp;title=Perl+on+Linux+-+Iterative%2C+Forking%2C+Multi-Request+Handling+Server" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.highspeedweb.net/2008/08/07/perl-on-linux-iterative-forking-multi-request-handling-server/&amp;t=Perl+on+Linux+-+Iterative%2C+Forking%2C+Multi-Request+Handling+Server" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Perl%20on%20Linux%20-%20Iterative%2C%20Forking%2C%20Multi-Request%20Handling%20Server%22&amp;body=Link: http://blog.highspeedweb.net/2008/08/07/perl-on-linux-iterative-forking-multi-request-handling-server/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Every%20so%20often%20you%20want%20to%20do%20something%20cool%20in%20perl%2C%20like%20make%20your%20own%20server%20capable%20of%20handling%20multiple%20requests.%20And%20if%20you%20are%20developing%20any%20type%20of%20network%20server%2C%20this%20functionality%20is%20not%20only%20handy%2C%20but%20essential.%20And%20so%2C%20without%20much%20further%20adieu%2C%20let%27s%20do%20this.%0D%0A%0D%0AIn%20order%20to%20save%20our" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.highspeedweb.net/2008/08/07/perl-on-linux-iterative-forking-multi-request-handling-server/&amp;title=Perl+on+Linux+-+Iterative%2C+Forking%2C+Multi-Request+Handling+Server" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Perl+on+Linux+-+Iterative%2C+Forking%2C+Multi-Request+Handling+Server+-+http://b2l.me/pf7d8&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.highspeedweb.net/2008/08/07/perl-on-linux-iterative-forking-multi-request-handling-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>2010: R.I.P. IPV4?</title>
		<link>http://blog.highspeedweb.net/2008/06/17/2010-rip-ipv4/</link>
		<comments>http://blog.highspeedweb.net/2008/06/17/2010-rip-ipv4/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 18:19:01 +0000</pubDate>
		<dc:creator>jakob</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.highspeedweb.net/?p=10</guid>
		<description><![CDATA[It&#8217;s no big secret that our current numbering scheme for internet protocol addressing is limited, but some sources are reporting its demise as soon as 2010. IPV6 has been adopted as the solution for many, many years now because it&#8217;s a virtually limitless numbering scheme. The down-side? IPV6 is rather tricky to understand and implement. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="left" style="width: 50px; height: 50px;" src="http://blog.highspeedweb.net/wp-content/uploads/2008/06/barilan_internet-thumb.jpg" alt="" />It&#8217;s no big secret that our current numbering scheme for internet protocol addressing is limited, but some sources are reporting its <a href="http://www.news.com.au/technology/story/0,25642,23876509-5014108,00.html">demise as soon as 2010</a>.  <a href="http://en.wikipedia.org/wiki/IPv6">IPV6</a> has been adopted as the solution for many, many years now because it&#8217;s a virtually limitless numbering scheme.  The down-side?  IPV6 is rather tricky to understand and implement.  Instead of receiving an ip address like 69.51.xx.xx, you&#8217;ll now be issued one like 2008:0db8:85a3:08d3:1319:8a2e:0370:7334 once ipv6 is implemented.  There&#8217;s really no need to panic, though, your operating system more than likely supports IPV6 already and IPV4 will not just disappear over night.  Instead, I think we&#8217;ll see a gradual decline in the use of IPV4 as IPV6 begins to become more and more of an industry standard.    I believe by 2010 there will be more of a hybrid use of IPV4 and IPV6 and not just the flat-out demise of IPV4.</p>
<p>Also, don&#8217;t forget to grab your copy of Firefox 3 today!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-wealth">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://blog.highspeedweb.net/2008/06/17/2010-rip-ipv4/&amp;title=2010%3A+R.I.P.+IPV4%3F" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.highspeedweb.net/2008/06/17/2010-rip-ipv4/&amp;title=2010%3A+R.I.P.+IPV4%3F" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.highspeedweb.net/2008/06/17/2010-rip-ipv4/&amp;t=2010%3A+R.I.P.+IPV4%3F" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%222010%3A%20R.I.P.%20IPV4%3F%22&amp;body=Link: http://blog.highspeedweb.net/2008/06/17/2010-rip-ipv4/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A It%27s%20no%20big%20secret%20that%20our%20current%20numbering%20scheme%20for%20internet%20protocol%20addressing%20is%20limited%2C%20but%20some%20sources%20are%20reporting%20its%20demise%20as%20soon%20as%202010.%20%20IPV6%20has%20been%20adopted%20as%20the%20solution%20for%20many%2C%20many%20years%20now%20because%20it%27s%20a%20virtually%20limitless%20numbering%20scheme.%20%20The%20down-side%3F%20%20IPV6%20is%20r" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.highspeedweb.net/2008/06/17/2010-rip-ipv4/&amp;title=2010%3A+R.I.P.+IPV4%3F" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=2010%3A+R.I.P.+IPV4%3F+-+http://b2l.me/ppkka&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://blog.highspeedweb.net/2008/06/17/2010-rip-ipv4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
