Archive for April, 2009

JavaScript Aggregate; WordPress plugin

April 30th, 2009 1 comment

After reading about Website Performance Tweaks, and a lot of other blogs and slides, I thought about how to cook up a javascript aggregate plugin for wordpress. The out come is wp-jsmin. Though this is in its infancy, it is being used in this blog, to combine all linked javascript to a single link, thereby reducing server requests. This code is still in the testing stage, and may break if the used scripts do not pass lint checks. I am planning to shift all the options to a options page in the wordpress admin page.

Those who are daring enough could download and try. Please put a comment here if you are using this on your wordpress. And for others who would like professional help, I would be most pleased to extend my services through RentACoder. Or for a whole dedicated wordpress team to design, build and maintain sites like Kerala News, Cirrus Travles or Rajeev Gandhi Center for Biotechnology, send an inquiry to Saturn.

WP-JsMin (1306)

Distributed Media; a WordPress Challege

April 27th, 2009 No comments

Though when the team at Saturn decided to build kerala online, on wordpress, they were quite confident, the complications started to get under their skins when the first wave hit the portal and at a point were the portal was being run from a single server and reached about 35K visits per day. The server was running on apache with about 2G Memory and hosted in Asianet the ISP division. There was times when the server was running at load averages above 60. All workarounds were getting futile, and there was certain times, like evening and early morning when the server hits the upper limit and ceases to respond. Read more…

Categories: Wordpress Plugins Tags:

Tunning (tuning) WordPress

April 27th, 2009 No comments

Today on the server logs I found about 2900 404 errors triggered from a single IP, the logs are similar as

[IP REMOVED] - [27/Apr/2009:11:38:34 +0530] "GET /wp-content/uploads/2009/04/photo993.jpg HTTP/1.0" 404 18013 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
[IP REMOVED] - [27/Apr/2009:11:38:38 +0530] "GET /wp-content/uploads/2009/04/photo997.jpg HTTP/1.0" 404 18013 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
[IP REMOVED] - [27/Apr/2009:11:38:39 +0530] "GET /wp-content/uploads/2009/04/photo999.jpg HTTP/1.0" 404 18013 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"

one can see that the request is scripted and at a random interval, seems to be a script kiddie trying to leech images, but I got worried that even for this wordpress would go and output my pretty 404 page, which was as you could see is a whopping 17Kb, and takes about half a second to build. So just gave a twist and modified the top area of my 404 template Read more…

Mysql representing ‘not equal to’ in query

April 21st, 2009 No comments

please help me to find out a solution for this am not getting correct o/p for query where am using mysql not equalto as (where tableone.file_name!=tabletwo.file_name)
Explanation Read more…

Categories: Queries from Visitors Tags:

function is_ipaddress

April 10th, 2009 2 comments

Well this may not be new to you all, but still, when I was on the lookout how I could validate an ip address, all the regular expression techniques either failed on valid addresses or bloated too much. The out come was wrote a piece of code which may help others if this is correct, in its way. Not sure, since most of the addresses which I tested against the other validation methods, and failed or non valid ones which passed were blocked here.
Still I am not the ultimate, if you have better suggestions than the code given here, please do so. Read more…

Categories: Code Snippets, Tips Tags:

FLV Streaming with PHP

April 1st, 2009 No comments

Pseudostreaming is a protocol that can be installed on regular HTTP servers such as Apache, Tomcat, IIS or lighthttpd. It uses a server side script for Flash-to-server communication. The player sends a HTTP request to the server with a start time parameter in the request URL’s query string and the server script responds with the video stream so that its start position corresponds to the requested parameter. This start time parameter is usually named simply start. This same technique is used by the ultra-popular YouTube service which uses lighthttpd servers.
Read more…