Backup MySQL database with AutoMySQLBackup

AutoMySQLBackup can backup a single database or multiple databases on the server. Each database is saved in a separate file that can be compressed into gzip or bzip2.
The installation is very simple. Just download the one file bash script and save it somewhere, customize it to fit your setup, make it executable (chmod 777) and [...]

A Perl script to reboot ZTE 831

A perl script to reboot ZTE ZXDSL 831 modem/router. Very useful if you want to schedule a reboot of the router.
#!/usr/bin/perl
use Net::Telnet;
$t = Net::Telnet->new( Timeout => 10 );
$t->open(”192.168.1.1″);
$t->waitfor(’/Login user: $/i’);
$t->print(’username’);
$t->waitfor(’/Password: $/i’);
$t->print(’password’);
$commands = “reboot\n”;
@response = $t->cmd(”$commands”);
print @response;

addthis_url = ‘http%3A%2F%2Fblog.ilmuit.com%2Fzainal%2F2007%2F03%2F06%2Fa-perl-script-to-reboot-zte-831%2F’;
addthis_title = ‘A+Perl+script+to+reboot+ZTE+831′;
addthis_pub = ‘ilmuit’;

Curl and PHP5 on Windows

I am trying to getting Curl to work properly on my Windows. I am getting this error when I try to load the php_curl.dll module:
Fatal error: Call to undefined function curl_init()
To fix this, copy libeay32.dll and ssleay32.dll from PHP\dll folder into c:\windows\system32. Override any existing file. Restart Apache server and this should fix the problem.

[...]

What caused an error in mysql query?

$query = mysql_query(”SELECT * FROM table WHERE table_id = 1″, $db);
$content = mysql_fetch_object($query);
The above command will execute the query using the mysql_query(). $query will be true if the query is successfully executed or it will return false. But if the error occured, it just show the arguement is not a valid MySQL result. Use the [...]

How to get blog name

Use the explode() function on URL to get the blog name.
For example: http://blog.ilmuit.com/blogname
$blogname = explode(”/”, get_bloginfo(’url’));
echo $blogname[3];

addthis_url = ‘http%3A%2F%2Fblog.ilmuit.com%2Fzainal%2F2007%2F02%2F07%2Fhow-to-get-blog-name%2F’;
addthis_title = ‘How+to+get+blog+name’;
addthis_pub = ‘ilmuit’;

Port Scanner in PHP

This is a very basic port scanner in PHP.
for($port = $from; $port <= $to; $port++)
{
$fp = fsockopen(”$host”, $port);
if ($fp)
{
print(”port $port opened \r”);
fclose($fp);
}

addthis_url = ‘http%3A%2F%2Fblog.ilmuit.com%2Fzainal%2F2007%2F02%2F05%2Fport-scanner-in-php%2F’;
addthis_title = ‘Port+Scanner+in+PHP’;
addthis_pub = ‘ilmuit’;

I know HTML

addthis_url = ‘http%3A%2F%2Fblog.ilmuit.com%2Fzainal%2F2007%2F02%2F03%2Fi-know-html%2F’;
addthis_title = ‘I+know+HTML’;
addthis_pub = ‘ilmuit’;