Category: code

Nginx + Fail2ban Blocking IP behind AWS Load Balancer

You know there is this problem, if you have some web servers behind an Amazon ELB it’s hard to block some malicious hosts. Why is it hard? Well, first of all, on the ELB you can use only security groups to allow/block IP/nets, BUT AWS Security Group doesn’t permit you to block something but only to allow, […]


Stop/Block Apache/Nginx hack attempts with fail2ban

Here is a useful quick post to stop hack attempts to your WordPress web server like wp-login brute force and xmlrpc exploits attacks. First of all, install the package “fail2ban“: sudo apt-get install fail2ban Then add these two rules to your jail file on /etc/fail2ban/jail.conf Please change the logpath according to your web servers access […]


Magento How to convert text attribute to dropdown attribute

If you are using Magento as ecommerce framework you could be interested on how to change an attribute type. The main answer is: you can’t! Indeed, you have to create a new one because you can’t change the attribute types (nether the code name and many other things), so the best solution for me was […]


Magento: how to create a super fast catalog export for Google Merchant

So you need a script to export your catalog products into a CSV file to import it on Google Merchant. There is a lot of scripts on the net to do this, but the problem with these scripts is, as usual, speed performance. If you have a big/huge catalog you will experience issue on speed, […]


Get correct Magento multi level categories page title and canonical url

Hello, I noticed there was a problem with the page titles and canonical urls for multi-level categories pages, for example if I have a category like this: ebook/fiction/general Magento 1.5.1.0 puts a wrong canonical url like this: http://example.com/ebook while it should be: http://example.com/ebook/fiction/general So we need a patch to fix this behavior and I will […]


Magento and Uservoice Single Sign-On Autenthication (Free extension)

Hello, I just wrote a small Magento extension to allow you the single sign-on between you Magento ecommerce site and your Uservoice support site. Based upon the original Uservoice documentation, you can install it (just copy the files into your Magento folder), you will find a new configuration settings under the left sidebar “USERVOICE SINGLE […]


Magento problem with Paypal Express and new customer registration [Solved]

You know there is this problem with Magento 1.4.* and 1.5.*, if you are using Paypal Express as payment method and your customer is a new one, when she/he complete the order this is without account association (Customer Group 0 USER NOT LOGGED IN) and the new customer is not created. To solve this problem […]


AWS EC2 Manage Snapshot Backup with PHP SDK

This is a simple script based upon AWS SDK PHP to manage volume’s snapshots. It simply create one snapshot per volume (once you run it) and delete snapshot older then 1 month. Please provide your personal information by copying config-sample.inc.php into config.inc.php. Run the script backup-snapshots.php with your CRON. For example: # Auto AWS Snapshots […]


Magento add Bestseller products by date range

Here is how to get a collection of products best sold in a given date range (could be daily, monthly, weekly, etc…)


Magento adding you own custom RSS Feeds

You know you will need, before or after, to add your own custom RSS feeds to your Magento. For example, I needed to create some custom RSS Feeds to list bestseller products by date (bestseller weekly, monthly, etc…) How to do it? It’s quite complex but not so much if you follow this mini tutorial: […]


Categories