Posts

Showing posts from August, 2022

[Solved]AWS ECR keep waiting: --profile is created using aws configure --profile

Reference:  https://stackoverflow.com/a/70453287/1802483 Problem:  You are trying to push a docker image to ECR While you use the command provided by AWS and show "Login successfully" when running this command: `aws ecr get-login-password --region <your_region> | docker login --username AWS --password-stdin <aws-account-id>.dkr.ecr.<your-region>.amazonaws.com`, you still saw "Waiting" or "Preparing" when you run `docker push` Possible reason and solution: Chances are you are using multiple AWS accounts You need to "login" to correct AWS ECR account when you run `aws ecr get-login-password` If you read the link above, you would see a parameter called `--profile` `--profile` is actually created using `aws configure --profile <your_profile_name>` i.e. To push to your ECR using correct account, you need to create a new profile by running `aws configure --profile <your_new_profile_name>` To create a new profile, you need

PHP Ratel class in Drupal 7 - Ratel is a spam bot, Remove it.

Here is what I found: We have a Drupal 7 website that has a frontend that load very slowly (> 15 seconds per load, sometimes).  A performance problem. It looks like it is trying to call some remote URL/APIs that causes the timeout problem. Our colleague did a research by installing a PHP profiling tool called xhprof to do profiling on the page. It turns out that there is a PHP class called "Ratel" that takes quite a long time to execute. However, even if we are doing a code-scan, we can't even see a file that contains the word "Ratel" Thanks to  this article , and this gist , it turns out that there is a SEO spam bot that is executed ONLY when you are login to the site. In other words, you will see this performance problem more likely when you are logging in to Drupal. I recommend you to read the article above. I wonder, this is not just affecting Drupal, but mainly on Wordpress, as mentioned in the article above.  Here is how to solve: Once I know how this