Archive

Archive for the ‘Tips And Tricks’ Category

Adding a UNIQUE constraint

March 5th, 2010 Nizar No comments

I always forget how to do this and then have to spin my wheels searching websites for it. Finally, decided to post it on my blog so I (and others) can quickly get to it:

ALTER TABLE SomeTable
	ADD CONSTRAINT unique_key
	UNIQUE (ColumnOne, ColumnTwo, ...)

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to Reddit Reddit Post to StumbleUpon

WordPress on a GoDaddy hosted site – 500 internal server error!

February 20th, 2010 Nizar No comments
  • Is your blog site returning the infamous “500 – internal server error” more often than not?
  • Are you using Wordpress as your blog publishing platform?
  • Are you using GoDaddy as your website hosting provider?
  • Are you using IIS as your web server (as opposed to Linux)?

If yes, continue reading to fix this issue:

There is weird configuration issue with running WordPress with a IIS web server on GoDaddy. Taking the following actions will resolve this issue:

  1. Upgrade WordPress to the latest version. Detailed instructions at: Upgrading WordPress
  2. Install WP-Super-Cache plugin. Here is the download link for it. In order to enable the plugin, you have to do a little tweaking. Below are the steps you need to follow:

    • First off, extract the ‘wp-super-cache’ folder into your ‘wp-content/plugins’ directory.
    • Log in to your GoDaddy account and navigate to Hosting -> Manage Account.
    • Click on the Content tab and select File Manager.
    • Here you will see all your files and folders. Check the wp-content folder and click the Permissions icon on the top. Uncheck Inherit and check the Read and Write checkboxes. Don’t worry this is only temporary to get your plugin working correctly. Save your changes.
    • Now Enable the plugin by going to your WordPress Plugins page.
    • Next you will have to enable caching. For this, go back to your File Manager and browse to the “wp-content/cache” folder. Change the permissions on this folder to Read/Write as well.
    • Now open up the wp-config.php page that’s in the root directory and add the following line towards the end: define(‘WP_CACHE’, true)
    • Go back to the Settings page for the wp-super-cache plugin and set the status to ON. Make sure to save your settings. You may see a warning about apache mod_rewrite not enable or installed. Don’t worry about this warning. This just means that your caching will only be HALF-ON which is fine because even it being HALF-ON will fix our ‘500 – internal error’ issue.
    • Go back to the File Manager and change the permissions on the wp-content folder to Inherit.
    • Your website should now respond faster and stop generating the 500 – internal server error issue.
  3. As an additional security measure, I would also recommend installing the WP-SpamFree plugin. This is a very effective plugin that will eliminate virtually all SPAM comments. Thus decreasing the load on your website.

If that still doesn’t fix the “500 internal server error” issue, then try updating your current WordPress theme or switch to a different WordPress theme. If that doesn’t work either, then it’s time to bite the bullet and switch to Linux! :)

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to Reddit Reddit Post to StumbleUpon

What the heck was I working on??

August 24th, 2009 Nizar 2 comments

Does it ever happen to you that you go to work in the morning, look at the screen and then ask yourself : What the heck was I working on?? Happens to me all the time. Maybe I was in the middle of debugging some code the previous day, or writing a unit-test or finishing up the implementation of a class or going through existing code to understand what it’s doing or something else. Given the detailed nature of software development, it’s sometimes hard to remember where you left off and from where you need to pick things up again.

Below is an approach that’s worked quite well for me:

Tells me where I left off

Tells me where I left off





I write myself a little MS Outlook note and put right in the middle of the screen. Simple, but very effective!

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to Reddit Reddit Post to StumbleUpon

Bad Behavior has blocked 330 access attempts in the last 7 days.