« Archives in January, 2006

rar command line

If you need to break down a large file into multiple smaller ones, try rar:

rar a -v10000k test.log.rar test.log
# break a 4GB file into 700MB files quickly (lowest compression level)
rar a -m0 -v700000k SAMPLE_DVD.rar SAMPLE_DVD.ISO

rsync – find repository size

To find repository size before downloading, use –dry-run

$# rsync --dry-run --recursive mirrors.tds.net::rsync
sent 62 bytes  received 8161 bytes  5482.00 bytes/sec
total size is 52792107  speedup is 6420.05

That shows RSYNC mirror takes about 50MB.

Does GoogleBot run JavaScript?

Yes, Googlebot does execute JavaScript code. I have an AJAX vote form with Yes/No links. The links are in AJAX form. Something like this: href=”javascript:vote(‘Yes’);” and the database records these votes. I got many votes from GoogleBot. Its User-Agent string is like this: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html). Now it’s annoying since I do not want the bot to vote.

PHP: strtotime & Windows

It looks like PHP 5.1 on Windows doesn’t understand the time zone string “UTC”

The Planet & Server Owner Privacy

It’s quite simple to do a whois on an IP hosted at ThePlanet and get extra information about the person. Implications: good & bad

root# [~]# whois -h rwhois.theplanet.com -p 4321
[Querying rwhois.theplanet.com]
%rwhois V-1.5:003eff:00 whois.theplanet.com (by Network Solutions, Inc. V-
network:IP-Network-Block: -
network:Organization-Name:[xxxx xxxx]

%referral rwhois://root.rwhois.net:4321/auth-area=.

FlashObject 1.3 version check

A correction to FlashObject 1.3 when checking for player version, I got the warnings in Firefox.

Google wasting 200 gigs of bandwidth a day?

Even though the analysis has flaws, content optimization + content compression are distinctive. See the source for AdSense:


It’s already quite compact before the webserver gzipped it further. I don’t believe that is the same javascript version developers are viewing internally, I imagine they would see comments and meaningful function names.

read more | digg story

wget & mod_gzip

wget & curl are very good command line tools to test and pretend to be any browser. Here I’m testing Google webservers and support for content compression.

# pretend to be Firefox 1.5
wget –server-response –user-agent “Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5″ –header=”Accept-Encoding: gzip, deflate” http://www.google.com

# pretend to be IE6
wget –server-response –user-agent “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)” –header=”Accept-Encoding: gzip, deflate” http://www.google.com

Testing Google JavaScript Compression
wget –server-response –user-agent “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)” –header=”Accept-Encoding: gzip, deflate” http://www.google-analytics.com/urchin.js

wget –server-response –user-agent “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)” –header=”Accept-Encoding: gzip, deflate” http://pagead2.googlesyndication.com/pagead/show_ads.js

Connecting to pagead2.googlesyndication.com||:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.0 200 OK
  P3P: policyref="http://www.googleadservices.com/pagead/p3p.xml", CP="NOI 
  Last-Modified: Thu, 29 Dec 2005 19:55:11 GMT
  Content-Type: text/javascript; charset=UTF-8
  Content-Encoding: gzip
  Server: CAFE/1.0
  Cache-Control: private, x-gzip-ok=""
  Content-Length: 2268
  Date: Wed, 18 Jan 2006 22:03:43 GMT
  Connection: Keep-Alive
  Length: 2,268 (2.2K) [text/javascript]

JavaScript compression with Dojo Rhino


This is a modified version of Rhino (the Mozilla JS interpreter written in Java). We (the Dojo project) have added a “compressor” method to the built-in Decompile class. Since we’re operating on the token stream from the parser, this system is somewhat less prone to errors and “overzealousness”. A new “-c” flag sends the “compressed” version of the input to stderr. Normal invocation is:

java -jar js_with_compress.jar -c in.js > out.js 2>&1

This tool will NOT mangle your public APIs. We’re using it as a part of the build process in Dojo and it’s been working well for some time now. It’s much less error prone than the regexp-based stripper we used in netWindows.

Source for the tool (i.e., a zipped up version of my anonymous CVS checkout) is available in the same directory as the Jar file.


Comment by Alex Russell

mod_gzip/mod_deflate, JavaScript & IE problem

Description: They are not a very good combination as problems have been reported in different applications with JavaScript not loading when served with mod_gzip/mod_deflate on. The error is not deterministic and cannot guarantee 100% error replication but it happens frequent enough.

Affected: The problem only occurs in Internet Explorer (6 and probably lower versions) and refreshing (F5) the page will load the script again. Firefox and Opera do not have this problem.

Solution: a temporary solution is to turn off mod_gzip/deflate in Apache at least for JavaScript in IE.

Reference: http://www.schroepl.net/projekte/mod_gzip/browser.htm