Thursday, November 25, 2010

GoDaddy Coupons

I tried YUP749 and it worked for me! Applied at the very last step, when you are reviewing your shopping card before the final confirmation. Look for "coupon" field at the top right of checkout page.

Good deal, particularly if you are buying 5- or 10- year domains.

FAN3 – 35% off domains Most popular.
FAN749 – 50% off .ORG domains
YUP749 – $7.49 .NET domains
FED749 – $7.49 .BIZ domains

GAM1 – 10% off any order
MIN15 – 15% off any order of $75 or more

GAM2 – $5 off any order $30 or more
FANOFF – $10 off any order $40 or more

PETS20 – 20% off hosting plans of 1yr or more
GAM1 – 10% off month to month hosting
AUCTION12 – 50% off godaddy auction account
FANSSL – 56% off godaddy ssl account ($30 account for $12.99)

Monday, November 22, 2010

How to remove categories slugs in WordPress

WordPress adds default category slug to your blog URLs, so a URL to your category page looks like myblog.org/category/receipts/

You can replace 'category' word with whatever you want, e.g. with 'food', so you'll get
myblog.org/food/receipts/
Better, but still not ideal - what if your blog is not about food only?

Surprisingly, if you completely remove the categories slug in Settings->Permalinks, leaving the field there empty, WP will restore the default 'category' slug back.

I want my categories URLs to look clean -
myblog.org/receipts/
It's better for humans and SEO (these two typically come together).
WP has no option for that, but there is a nice plugin:
WP No Category Base

Simply install it. No configuration required.
Voila! Here are you go: http://photocoupon.net/camera/

Saturday, November 13, 2010

Wordpress with HTTPS/SSL on a custom port

I wasted a few hours trying to configure Wordpress to run on a non-default (not 443) SLL port. Well, it looks it is impossible due to how the WP code is written. Switching from HTTP to HTTPS just replaces the 'http://' URL part with 'https://' part and the port is ignored. The developers assumed that SSL is always on port 443, which obviously can be a huge problem if you are willing to run a few WP with SLL on the same machine.

Playing with .htaccess can not do the trick either. At least I did not found how to do that.

Thursday, November 04, 2010

FULLTEXT search in MySQL DB does not return any result, but works fine in BOOLEAN mode

Well, that was a trap... First, I found that a simple query like
SELECT * FROM `articles` WHERE MATCH(title) AGAINST('jerusalem')
returns 0 rows on my development DB.
Next, I found that the same Native Language SQL query works just fine on the production DB with the real data.
Third, I discovered that the same query works just fine on both DBs when BOOLEAN search is used:
SELECT * FROM `articles` WHERE MATCH(title) AGAINST('jerusalem' IN BOOLEAN MODE)

The reason was that I got only two records in my development DB! So any Natural Language search failed there into the 50% 'common keywords' rule stated in MySQL manual:
A natural language search interprets the search string as a phrase in natural human language (a phrase in free text). There are no special operators. The stopword list applies. In addition, words that are present in 50% or more of the rows are considered common and do not match. Full-text searches are natural language searches if no modifier is given.

With just two rows any keyword was considered by MySQL as common! The obvious solution was adding one more empty row. And voila! - we got the search results.

It looks like this 50% rule can not be switched off by MySQL configuration. If you know how to switch it off drop me a note, would love to do that in my development environment.

Friday, October 22, 2010

Installing WP in a separate folder

Clear instructions by the Wordpress team how to get WP installed in its own directory.

Wednesday, October 06, 2010

Downgrade AWS AMI instance to the new 'micro' AMI

AWS prices for micro AMIs clearly show the costs advantage to run a micro instance for a low-volume site.
Furthermore, you can build the entire scalable IT system on micros, and then just scale up the nodes that have to be scaled.

Unfortunately, migrating to the new micro AMIs it is not that simple. There is no simple way to convert your exiting small or medium AMIs to micros if these AMI were created a while ago and use S3 as their instance store.
You can easily convert your existing AMI to micro using AWS console if your AMI is
a) Linux based
b) EBS (and not 'instance-store'/S3) based. Since 'EBS-root' is quite a new AWS feature many existing AMIs are S3 based, so here the story starts.

If you got a S3-based instance the migration to micro AMI is not that simple.
Of course you can start a new micro instance and install there anything from scratch (it will be automatically created as an EBS instance).
If starting from the scratch is not an option, you can try to follow unofficial guides for converting an S3-based instance to an EBS instance. If the conversion is successful AWS console will allow to create a micro instance from your EBS-hosted AMI.

There are only three blog posts providing some help in S3 to EBS AMI conversion (I did not try any of them yet, none of them looks like an easy way to go):
http://www.elastician.com/2009/12/creating-ebs-backed-ami-from-s3-backed.html
http://www.full360.com/blogs/Migrating-Linux-S3-Based-AMI-EBS-Based-AMI
http://coderslike.us/2009/12/07/amazon-ec2-boot-from-ebs-and-ami-conversion/

I wonder why AWS  did not provide a 'ec2-' tools script and/or console support for these S3-to-EBS-root conversions.

Saturday, September 04, 2010

To see all open (listening) ports in Linux

Run
netstat -ntulp
or
lsof -i -n -P
for some more info