Posts Tagged ‘cgi’

Practical Extraction and Report Language/Common Gateway Interface

Simply known as PERL and CGI respectively. I decided to change my priorities in studying “Web based apps” from ASPX to Perl and CGI scripting because of the flexibility, powerfulness of this language. Also what is good about it is that I can work in different O.S platforms and I can work also both in Web, Client based or a mixture of them. My first Perl script is a couple of months ago when I made a automatic restart/redial of my DSL modem (which I revised when I changed my ISP and its modem).

#DSL Modem Script
 
#used to reboot Huawei and Prolink modems
 
#(C)opyright 2007 by Michael Angelo Yap. All Rights Reserved.
 
#!/usr/bin/perl -w
use strict;
use Net::Telnet;
use Time::Local;
 
my ($host, $port, $user, $pass, $command);
 
$host = '192.168.1.1';
$port='xxxx'; #replaced for security reasons, duhh!
$user='yyyy'; #replaced for security reasons, duhh!
$pass='zzzz'; #replaced for security reasons, duhh!
 
my ($sec,$min,$hour,$mday,$mon,$year,
$wday,$yday,$isdst) = localtime time;
 
my($vart)="$hour:$min";
 
if($vart eq "HH:MM") #replaced for security reasons, duhh!
{
my $tn = new Net::Telnet(Host => $host, Port => $port,Timeout => 10)
or die "connect failed: $!";
 
$tn->open ($host);
$tn->waitfor('/login: $/i');
$tn->print($user);
$tn->waitfor('/password: $/i');
$tn->print($pass);
 
$tn->waitfor('/\$$/i');
$tn->print('reboot');
$tn->print('exit');
}

super basic, but so very important to me!

  • Share/Bookmark

Another server load

I finished installing and configuring ffmpeg, mplayer and ffmpeg-php after 2 days of massive research and trial-errors.

other improvements in the server:

- I wrote my first PERL script about interfacing my DSL modem (tru telnet, sorry hackers, I secured my firewall so that the port will not leak outside my network .hahaha) ability to disconnect my dsl modem connection at certain time(time is secret).

-checked and clean unnecessary configurations, files, bootup scripts and caches to speedup the server by 0.0000000000001%. :)

-perform my ritual full hardrive backup after adding two more hosted websites.

  • Share/Bookmark
Return top

DISCLAIMER

Due to my superb English vocabulary, users are still encourage to use dictionary and thesaurus for your references :D
 

Switch to our mobile site