March 2005
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Personal Links
Search


Most Recent Entries
Categories
Certifications
mcse.png

mcsa.png

mcp.png

ccna.png

aplus.png

Syndicate
Utilities

Blogs and Links loaded in 0.3937 seconds
Powered by
Hosted by
Preferred Browser
og-get-00-en-mic.png
Preferred FTP Client
sftp-btn-05.gif

Page loaded in 0.395 seconds

Creative Commons License
This work is licensed under a Creative Commons License.

January 28, 2005

comment spam / spammers suck.

Posted by Brewmonkey at 12:25 AM
Web Dev
Comments (0)
TrackBack (0)

Dreamhost rocks. They sent me a notice to update MT to its latest version.


Whats buggier, MT, Windows, or Internet Explorer?

March 12, 2004

Comment spam

Posted by Brewmonkey at 04:01 PM
Web Dev
Comments (0)
TrackBack (0)

Was comment spammed 232@WEE.COM from ip address 205.177.122.2 two days in a row.

August 13, 2003

Ascii Encoder

Posted by Brewmonkey at 03:30 PM
Web Dev
Comments (0)
TrackBack (0)

http://www.wbwip.com/wbw/emailencoder.html
Great for encoding email for spam protection.

Wait a minute... Are they fooling you into sending them the email address you want protected?

No. I took a look at the source. It is just strickly javascript. No cgi to harvest addresses.

They should have posted a disclaimer.

July 02, 2003

February 17, 2003

Upgraded to MT v2.62

Posted by Brewmonkey at 03:25 PM
Web Dev
Comments (0)
TrackBack (0)

When I upgraded to v2.60, I screwed up.

I use SmartFTP, to transfer files up to the webhost. It is too smart for its own good. It is, in my opinion the best FTP program. Its best and worst feature is its "global queue." This feature allows you to queue files for later upload or download. The fact that it can't log any activity that occurs in the global queue bothers me little. It also will not overwrite files by default. The program can be set to ask the user for permission to overwrite with direct upload or download, but the queue cannot be set to ask permission. The queue will overwrite files only after the program settings are changed, also affecting the settings for direct upload and download.

Didn't realize this until after upgrading to v2.60 from v2.51. The MT upgrade script indicated that the upgrade went smoothly. Working with my shell account this morning, I realized that the time stamps were wrong. My upgrade was messed up, even though I hadn't seen any errors. to remedy the problem, I decided to do a full install of v2.62, taking care of the file inconsistency and security problems in one shot.

If you want SmartFTP (it is a still a very good program) you can get it here.

February 16, 2003

Upgraded to MT v.2.6

Posted by Brewmonkey at 03:53 AM
Web Dev
Comments (0)
TrackBack (0)

Haven't played with it much. If you are interested, you can find it here.

I fancy myself an early adopter, thus I had no choice.

February 13, 2003

Another Blogrolling Mod

Posted by Brewmonkey at 03:40 PM
Web Dev
Comments (0)
TrackBack (0)

When I checked my site this morning, guess what happened? It hung up again. I was able to ping the webserver, and another site I run hosted on the same server remained up. It had to be blogrolling.com. I couldn't ping it, and traceroute didn't go all the way through.

As it turns out, my original blogroll mod was not very effective. It couldn't arbitrarily break the connection, once it started trying to establish it.

Since I usually can't leave good enough alone, I couldn't leave the script broken. Plus, it gave me the opportunity to learn a little more about client and server communications over the web.

Here is the script:


This function is used to calculate elapsed time. It actually retrieves the number of seconds between now and the UNIX epoch.

function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
The following section defines the info conveyed to blogrolling.com

$method = 'GET';

$host = 'rpc.blogrolling.com';

$path = '/display_raw.php';

$data = 'r=0b2bbfa247b0039a53b39ced41f70f38';

$socketTimeout = 0.3; // in seconds.

The variable $socketTimeout defines how long the script should try establish communications with the blogrolling.com server before giving up.



$fp = fsockopen($host,80,$errno,$errstr,$socketTimeout);

The function fsockopen established communication with the server.

If the socket fails to open, the following portion of the script is skipped.

if($fp){

The following part sends data to the server.

$path .= '?' . $data;

fputs($fp, "$method $path\n");

fputs($fp, "Host: $host\n");

fputs($fp, "Content-type: plain/text\n");

fputs($fp, "Content-length: " . strlen($data) . "\n");

fputs($fp, "User-Agent: MSIE\n");

fputs($fp, "Connection: close\n\n");

fputs($fp, $data);



Here, timing variables are determined. $feedTimeout is most important. If you want to increase the time, change the 0.3 value. It is in seconds.

$feedTimeStart = getmicrotime(); // in seconds

$feedTimeElapsed = 0; // in seconds

$feedTimeout=0.3; // in seconds

Here, the script retrieves information from the server. It loops until either the timeout is exceeded or all the information has been retrieved.

while (!feof($fp)&&$feedTimeElapsed < $feedTimeout){

$feedTimeCurrent = getmicrotime();

$feedTimeElapsed = $feedTimeCurrent - $feedTimeStart;

$blogroll = fgets($fp, 4096);

$buf .= $blogroll;

}

Close the stream.

fclose($fp);

I like the all or nothing model. if the feed timeout elapsed before the end of the stream, none of the links are printed and the script skips straight to the timeout statement.

if($feedTimeElapsed < $feedTimeout){

echo $buf;

}

else{

echo "<br>content timed out";

}

}

else{

echo "<br>connection timed out";

}


February 10, 2003

Blogroll Mod.

Posted by Brewmonkey at 08:50 PM
Web Dev
Comments (0)
TrackBack (0)

If your site is hosted on a reasonably fast server, the loading of your page is delayed by the blogrolling code, a you are using php to load the code, the following mod maybe useful for you. As you can tell by examining the times on the right side, the majority of the processing time required for the page is for the blogrolling script. Sometimes, it takes over 20 seconds for the script to negotiate the connection and return the information. I've run a few experiments that indicate the majority of the time is spent negotiating the connection. No fault of the people at blogrolling.com. The mod terminates the execution of the blogroll script after a webmaster specified interval. The default is set to one second. If you are more patient than me, you can set it to a larger number. My Mods are in red.

$time_start_blogroll = getmicrotime();
if($my_blogroll = @fopen("$url", "r")){
while(! feof($my_blogroll)){
$blogroll = fgets($my_blogroll, 255);
echo "$blogroll";

$time_current = getmicrotime();
$time_elapsed = round(($time_current - $time_start_blogroll), 4);

// Break out of controll structure if taking too long.
// Change the 1.0 to a larger number if you want to increase
// The elapsed time. (time is in seconds).
if($time_elapsed > 1.0){
echo "BlogRolling.com<br />timed out!!<br />";
break;
}
}
}else{
echo "ERROR: $url is currently inaccessible";
}

January 30, 2003

Pet Peeve

Posted by Brewmonkey at 04:08 PM
Web Dev
Comments (0)
TrackBack (0)

One of my pet peeves:
Sites that format their webpages for specific screen sizes and don't bother to center the pages.

Some examples:
The New York Times
USA Today
AsianWeek.com

January 22, 2003

Added additional code...

Posted by Brewmonkey at 03:59 PM
Web Dev
Comments (0)
TrackBack (0)

I was checking out my weblog this morning. The page would never load. I checked out other usual avenues for trouble shooting. My internet connection was ok. I was able to ping the url. I was also able to open a shell connection. Scripts were running ok in the shell. PHPMyAdmin was able to connect to MySQL. Every thing was working OK.

What could it be that prevented my web page from being served? I believed that it was the little code snippet that gets links from blogrolling.com. I wrote a little script that times how quickly portions of the script are processed. It is clear from the execution of that script that the blogrolling portion takes up most of the executiontime. Here is a snap shot of what I saw.

If you want the script, here it is:

<?
function getcliptime(){
list($microsec, $sec) = explode(" ",microtime());
return ((float)$microsec + (float)$sec);
}
?>

// placed before the script you want to time.
<? $startcliptime = getcliptime(); ?>

// placed after the script you want to time.
<?
$endcliptime = getcliptime();
$cliptime= round(($endcliptime - $startcliptime), 4);
echo "Loaded in $cliptime";
?>

January 19, 2003

Browser incompatibility sucks.

Posted by Brewmonkey at 09:24 PM
Web Dev
Comments (0)
TrackBack (0)

I spent half of my day tracking down a little bug on a couple of my templates. The layout was just a little off on a couple of pages. Specifically the contact and the IP lookup pages. Both are templates that I had written myself from scratch, and they are the only ones that are parsed for php code before being served.

If you check out my site, you'll notice that most of the it has a very consistent layout. It was specifically crafted to be that way. When I design pages (I am not a professional but very competent), I normally only check the pages on mozilla. It is the browser that I use on a normal basis. (Once you go tabbed, you can't go back.) From my experience, if it looks ok on a flavor of Netscape, it invariably looks ok on IE. All of my pages looked ok on mozilla. But on IE, the two pages mentioned earlier, the layout was fine, but all of the fonts looked disapporationately larger.

I went though all of the html looking for improper nesting. Coudn't find anything. I even passed the served pages through HTML Tidy. There were a couple of errors (now fixed) and warnings, but didn't resolve the problem. I looked over my PHP code, the problem wasn't with that. I even re-templated all of my pages into a more modular system. That didn't fix the problem. Just as I was about to start throwing things at my computer, I noticed that the pages were missing a DOCTYPE at the top of the page. I never knew that actually did anything, I thought it was just something that you put on top of the page by convention. Even Yahoo doesn't use DOCTYPEs.

Here is the missing code:

<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/
DTD/xhtml1-transitional.dtd">

Only if i had read an article about DOCTYPE on A List Apart earlier.

Here is are a couple of snap shots
desiredin error

Moral of the story: Remember your DOCTYPES.

January 16, 2003

Server Side Includes

Posted by Brewmonkey at 08:50 AM
Web Dev
Comments (0)
TrackBack (0)

Using server side includes:
Most servers with SSI turned are set to parse only SHTML files. If you need to force your server to parse HTML files you can add the following to the .htaccess file:
AddHandler server-parsed .html

The syntax for SSI is:
<!--#element attribute=value attribute=value ... -->
The most common usage for SSI is to include standard header and trailer templates in webpages.

For example, if every one of your webpages has a standard header, instead of manually inserting the information into each file, all you need to do is put the heading information into a single file (e.g. header.inc) and include the following at the top of each file.
<!--#include virtual="header.inc"-->

January 15, 2003

Updated Interface

Posted by Brewmonkey at 02:37 PM
Web Dev
Comments (0)
TrackBack (0)

Updated the interface. At least cosmetically. I started out trying to use css positioning. Decided that Netscape and Explorer handle it just differently enough to make it quite frustrating. After a couple of hours trying to make it fit to my expectations, I decided to scrap it and go back to using tables for layout.

I'll tinker with it, as is my nature. but the color scheme should stay roughly the same.