Dec 22 2008

Severed cable disrupts net access

Internet and phone communications between Europe, the Middle East, and Asia have been seriously disrupted after submarine cables were severed.

It is thought the FLAG FEA, SMW4, and SMW3 lines, near the Alexandria cable station in Egypt, have all been cut.

A fault was also reported on the GO submarine cable 130km off Sicily.

Experts warned that it may be days before the fault is fixed and said the knock on effect could have serious repercussions on regional economies.

Jonathan Wright – director of wholesale products at Interoute which manages part of the optical fibre network – told the BBC that the effects of the break would be felt for many days.”This will grind economies to a halt for a short space of time,” he said “If you look at, say, local financial markets who trade with European and US markets, the speed at which they get live data will be compromised.”

Dec 18 2008

How to cleaning up SENDMAIL spool

Cleaning the Mail Spool

There could be a lot of “trash” qf or df files left behind following a bout of misbehaving sendmails. If the size of either file is 0, you should be able to trash them safely.

cd /var/spool/mqueue-fixme

to get into your queue directory, and

Read more …

Dec 18 2008

IE ignores custom error pages

if you use php to create custom error pages (such as header('HTTP/1.1 500 Internal Server Error');) Internet Explorer ignores you custom page unless it is at least 512 (or sometimes 1024 bytes)

IE ignores custom error pages that are less than 512 (or from what i've read 1024) bytes.

just place this before any output on your custom error page--- and be sure that your custom error page includes proper html tags (it must have a </body> for this specific example to work)

<?php
// set your custom error header --- example --- header('HTTP/1.1 503 Service Unavailable');

function padding($html){
return (
$padding=1024-ob_get_length()) > 0 ? str_replace('</body>','<!--'. ($padding>8?str_repeat(' ',$padding-8) :null ).'-->'."\n".'</body>',$html) : $html;
}

ob_start('padding');
?>

and then place this somewhere within the html error page output

<!-- ---- -->

that will auto-adjust to pad the file to 1024 bytes to override the default Internet Explorer error pages.

You can use below script to show the image file for public access, but public don’t have direct access to the file itself. Because its located outside of the public folder.

<?php
/* Read local file from /home/bar */
$localfile = file_get_contents("/home/userX/foo.jpg");

echo $localfile;
?>

Use below scripts :

mysql_insert_id() example

<?php
$link
= mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!
$link) {
die(
'Could not connect: ' . mysql_error());
}
mysql_select_db('mydb');

mysql_query("INSERT INTO mytable (product) values ('kossu')");
printf("Last inserted record has id %d\n", mysql_insert_id());
?>