Getting rid of the extremely annoying “Do you want to restart you computer now?” prompt after windows update June 17, 2008
Posted by ahmadfarhan in Tip & tricks.Tags: disable windows update restart prompt, windows update restart prompt
add a comment

Everybody has seen their share of this message prompt. Let me show you how to disable this prompt completely.
PHP web based application performance tuning May 29, 2008
Posted by ahmadfarhan in Articles.Tags: performance, php, php performance, web application
add a comment
I’ve been doing a lot of research on this lately, both for my personal sites and also for work. And by using some of the techniques here. You can increase the responsiveness of you web application.
I try to make this as general as possible but mostly they apply to php/mysql development as that is what I have the most experience in.
Databases
First of all. The most common bottlenect of a web application is not the application itself but the database.
Query optimization
Database queries are typically very expensive. But a poorly designed query can take even the best servers to its knees. Which is another reason to hire good programmer (But that’s a rant I’ll save for another time). A profile is an important tool in query optimization. For MySQL there a handy guide to Using the New MySQL Query Profiler MySQL profiler at mysql.com.If you are using postgres then there’s the EXPLAIN command for you to use.
Caching
MySql have a query cache system that you can use. This is particularly usefull for if your application keeps asking for the same data over and over again. For example requesting application settings from database on each page load. If you are using a language that, unlike PHP, supports application wide variables, for example Java. These queries are better cached into the application memory during application start instead. Just make sure you update the settings if you update the settings in the database. This frees up the cpu from doing sql queries at the expense of some memory overhead. On a busy site this is very much worth it.
memcached is a general purpose memory cache engine but is frequently used as a database cache. Running a big site without memcache is like running up a hill with a backpack full of bricks. You can do it, but you really don’t want to. A lot of people use memcached In conjuction with all any database cache that they already have in the database. memcached is created by the guys behind LiveJournal to help cope with their 20million+ page view, so you don’t need to worry. memcached is one of the big boys here.
Application
These deal with mostly application performance tuning. And not programming for performance.
Caching
On the application front, you can attack the issue of caching from multiple angle. There opcode caching, output caching.The great thing about opensource is that a lot of very smart people that face the problems that you face today already created a solution for it. PHP opcode caching
PHP is an scripting language. Meaning that it is not compiled. When a page is requested. The source is process into machine language and then the instructions are ran. This is done each time the page is requested. You can save a lot of CPU power by caching the generated bytecode that so that the same page need not to compile each time it is access. This is called opcode caching. For this there are a lot of solution but I recommend APC(wiki link). It’s one of the few that still remain active. Opcode caching was popular around PHP 4.1 but somehow most of them fell off the bandwagon and no longer being actively developped, some evolve as other opcode caching projects but just stay dead. Most of the old ones still works with PHP4 but most can’t even work with PHP5(I think no one should use PHP 4 anyway, a 10 years old language but that is also a rant for another day).
Template Caching
Opcode caching is often accompanied with the used of a tempalate engine to do template caching. Template engine like Smarty can cache all or parts of a rendered web page, or leaving parts uncached. A cached page use more or less the same amount of processing power as serving a plain HTML page. This is really usefull for a site for data that don’t change to often after they are updated, for example, blog posts. With Smarty your blog posts can be cached while your sidebar with the your widgets that needs fresh up to date data can get the updated data.
Segragate dynamic and static data
Apache is a good webserver. But it is geared towards dynamic content. lighthttpd on the other hand is a webserver that is made for speed. It can’t do many of the fancy things that apache can do. But it can serve static page really really fast. phpClasses used lighthttpd for all their static pages (graphics, javascripts,css, file downloads) to handle the huge amount of traffic for their site. On a smaller scale you can offload all you static content to services like Amazon S3 to host all your static content. That’s the speed of Amazon Enterprise Datacenter at your disposal what else can you ask for.
Summary
Basicly I touched a little on performance for traditional Web application. There are many other thing that you can do to optimize your web application. Newer AJAX heavy websites require the same basic concept but a different approach towards the subject. There are also many other areas that I haven’t touched yet. Like replications of database to spread your database load database and web server clustering. We also haven’t touched on programming techniques to maximize performance.
Application performance is a big subject and hopefully this will give you a small start toward designing high performance PHP web application
Let’s benchmark our salary April 28, 2008
Posted by ahmadfarhan in Rants.Tags: ActiveTechPros IT Sallary Benchmark, IT industry, sallary
add a comment
I’ve just filled in The ActiveTech Pros’ IT Salary benchmark. I all IT professionals do the same.
A few things that caught my eyes.
- “IT management”, (meaning managers. Read:PHB) has the highest average annual salary
- The regional’s ( Malaysia, Indonesian, HK, Thailand, India, Philipines, Singapore) Top Certification is CCNA. (Which is understandable, since most network engineers and/or servers operator job are very Certification oriented in selecting candidate) But in Malaysia the top Certification is MCP. Where did all this MIcrosoft love come from? I thought we are the pirate culture here in Malaysia.
- Our neighbour in singapore earn about the same amount as we do in Malaysia. Only in Sing Dollar.
- “Media, Marketing and Sales (Non-IT)” gets the highest average annual salary.
That’s the only thing I ca think off. I’m to depressed from finding out that I get less money than salesgirls and PHB alike.
Use firefox on different computers with FEBE April 25, 2008
Posted by ahmadfarhan in Tip & tricks.Tags: FEBE, firefox, firefox backup, firefox extension
add a comment
The Firefox Environment Backup Extension is a great tool for firefox users that are using more than one computer,for example at work and at home, it allows you to synchronize your bookmarks, settings, cache, saved passwords, everything between diffrent computers.

One tip though, create a new firefox profile before restoring a full backup as the extension cannot replace in use files.
You can find FEBE at the Firefox Addon Site or at the Chuck Baker firefox entension forum.
Lowyat.net, Programming, Visual Basic, Microsoft bashing and what not (rant) April 9, 2008
Posted by ahmadfarhan in Rants.Tags: lowyat.net, programming, programming language, Rants, vb, vb bashing
2 comments
Recently I’ve registered at LowYat.net a big community of people that range from codders to bloggers to pet owners and mangga kiddies. My old haunt of a tech forum is dead for some time now and I never like big community because of the signal vs noise ratio that you usually get in big communities, as opposed to smaller you know everyone community. But I needed input on something, and I lurk there sometimes, so I’ve decided to register.
While waiting for someone to answer my questions I figured I’d be helpful and browse for something in the coders forum. So the the story was there was a guy that started programming and wanted to know a good language to start with, and wanted to choose between vb.NET and java. I’ve always had a bone to pick with vb and vb.NET, nothing personal, I’ve always feel that best practices are better learnt when you are starting to learn to code, rather than go through the trouble of unlearning your bad practices. And I feel like I’ve articulated my point through calm and in a more or less civil way. And I personally believe what I wrote about all the bad things a bad programming language teach you and how it is better to start off with a better programming language like java or even C#. See, I said C#, I support .NET, I’m not a microsoft basher. Which is why it puzzles me why a guy in the forum called me out as a Microsoft basher.
Granted my research was not that complete. I cited some stuff that is more relevant to vb6 rather than vb.net (it was a forum post, I googled a little and that’s it, i didn’t do a 3 hours research). But I do feel that the essense of it was there and the point is that it is better to start with a language that doesn’t follow best practices like allowing uninitialized variables. I even said that I understand that vb is not bad, it has it uses like rapid UI prototyping, and my point is that it is not a bad language, it’s just a bad FIRST language. Which I believe that I have stated clearly.
Which is why I was stil puzzled as to why I was called out as a Microsoft basher. I didn’t even mention Bill Gates. I don’t blame the poster, maybe he had his fair share of microsoft and VB basher. Which is why he annoyed at “yet another one”. I’ve just felt that I was really sincere in my posting and not flamebaiting. Maybe the language of the internet is a lacking in communicating some of the emotion in a sentence. Or whatever. Anyway the poster was a regular with 1000+ post, so I didn’t bother to reply, I’d just look like newbie trying to pick a fight with a regular. No amount of reason can win that fight. And even the poster said that he’s signing off on the conversation cause he’s tire of this old debate and the thread already starting to veer into another direction. So I let it go.
The thing that gets me about this is that I really was sincere in trying to help the thread starter and also sincere in my believe that you should start out with a good programming laguage that teaches you go programming practices. I’m not trying to bring the debate here. Just making my point and saying my peace. No offence intended to anyone.
The thread:
http://forum.lowyat.net/topic/660021
Wanita & Komputer – A website for women in computing April 3, 2008
Posted by ahmadfarhan in Links.Tags: Links, wanita, Wanita & komputer, women, Women and computing
1 comment so far
I have stumbled upon Wanita & Komputer. The tag line says it all “Tips mudah komputer hanya untuk wanita”.Roughly translated into ”Easy computing tips just for women”.

I think what makes me so excited about this site is that it does perfectly what I am trying to do most of the time. Give simple tips to ease the use of computer for non tech savvy computer users. And the owner of the site does it in simple plain language that is easy to understand for beginners. And she does it with a little style and personality too in her writting.
I also like the educating the masses aspect of the site. It aims to give help and tips for things that an advanced user like me already took for granted. Reading through the entries reminded me of things that I took for granted for so long and forgot that it needed to be learnt. That I think is the problems with me (and I believe other advanced computer user) is that we are so used to a lot of things we subconciously assume a that everyone knows how to ,for example, ping a site to test for connection or burn a dvd. But the site gives out simple tips like these and in a way that is interesting to the reader base.
In summary, I think the content is good for the level of audience and the writting is interesting. And I personally love the site because it sort of reflect what I’ve been trying to do but don’t have the time, effort, eloquence, style and the right gender to do.
Come head on over there. Wanita & Komputer
Domain name market price and a few cheap domain name registrar April 2, 2008
Posted by ahmadfarhan in Tip & tricks.Tags: domain name, domain name price, hosting, price list, register domain name
3 comments
Well, now that you’ve made the hard decision on what your domain name is going to be. You want to go ahead and register it. First thing you should know that not all domain registrar are the same. Some are more expensive than others here I will give you a few examples of sites that offer cheap domain name registering.
Compiling slocate on Solaris 10 March 25, 2008
Posted by ahmadfarhan in How-to.Tags: installation, slocate, slocate v2.7, Solaris 10
1 comment so far
The gnu secure locate utility or more commonly known as slocate is a very usefull utility to have. Not only does it index the drive so that seaches are done to a compressed database instead of the filesystem to speed it up, slocate also apply security restriction to searches so that you can only see the files you have access to.

I have grown fond of it from my ussage of slocate in linux. When working in Solaris 10, however, there was no slocate utility.Browsing through the Sun Freeeware site I was surprise to see that is it not among the available download. The alternative is to compile it from source. I will show you how.
Virus running through Celcom’s Broadband service March 7, 2008
Posted by ahmadfarhan in Monster Servant.Tags: celcom broadband, virus, Win32/Fujacks.S
add a comment
If you are using Celcom’s Broadband services then this is something that you have to know. First some background. Celcom’s way of connecting to the internet is sort of putting everybody in the same big LAN and then connecting the users to the internet through their proxy. To anyone else on the internet, we are all just 1 person/computer. That is why If you are using Celcom you sometimes are blocked by services like http://www.spamhaus.org or http://cbl.abuseat.org/ or any other services that do any sort of IP based filtering and/or banning. If some jerk that is on Celcom is being a jerk on your favorite message board and get banned, chances are you’ll be banned too.

Another caveat of this is that everyone using Celcom will essentially be as if on the same LAN as you are. So if someone have a virus, It’ll spread more easily. And now apparently someone got infected by a Fujacks worm. Technically it is called Win32/Fujacks.S by ESET.
The virus spreads by trying to infect any shared folder on the network. At work I swapped files a lot with my fellow co-worker so I have a shared folder with write access enabled so that anyone can just copy a file over when they want me to take a look at it. This is a BIG risk. But sometimes convenient trumps security, even if all the guys at the office are very very tech and security savvy. We work on identity management system, security is out job after all.

Windows shared folder has a hard time with computers across different domains/workgroup so usually spreading anything through Windows shared folder only happened on networks and not the open internet. And guys here all have PC clean as a wistle. But with Celcom broadband connected, suddenly I am on a big networks with all kinds of (infected) PC.
So, the combined two factors above lead to an infection. The virus does a lot of things, like disabling services that it thinks will stop its spread like commonly used virus scanner (AVG, McAfee, etc). One nasty thing it does is that it deletes any .GHO files it finds. .GHO are Norton ghost files, usually used to image a harddisk for backup. That’s why you always hear people telling you to have an offsite physical backup. It also infects popular web files, all files with the extension ASP,PHP,HTML,JSP are modified so that they show certain website when they are run. So if you are running a webserver it’s also a very nasty thing to have.
So after that little incident I have disabled all the shares on my PC. And if you are like me and want to have a way to share files on your network. I suggest a SFTP server. coreftp.com the makers of the CoreFTP client, also have a simple, stripped down SFTP server. Core FTP/SFTP Server is a very simple SFTP server, no fancy configuration, no multi level ACL, just a plain SFTP server. You fire it up, it ask for a username and password that you want people to use to connect to the server and you put in the root path of the directory you wish to share and click “Start”. That’s all, you got it running. No messing around with any SSH keys, no config, no nothing. Just a simple SFTP server, good enough to use in the office’s LAN.

This just one of the ways to secure your PC, I’m sure they are many other. You can tell me how you secure your PC in the comment.
wp-plugins.net is down. February 21, 2008
Posted by ahmadfarhan in Knicks and knacks.Tags: word press, wordpress plugins, wp-plugins.net
2 comments
The very usefull site http://wp-plugins.net/ is now down due to heavy load. Which is a real downer on me. I’ve been trying to get my personal blog start off and was really looking foward to some wordpress plugins wholesome goodness.

http://wp-plugins.net has been good source of some obscure-ish plugins that don’t make it to wordpress plugin repository and I am eagerly awaiting their return, hopefully soon.