Using list and lookup in terraform HCL

Terraform delivers consistent build and save a lot of time from clicking and scrolling. But when the resources, in this case ec2 resources are slightly different, it may be necessary to create a tf config for every instance. That defeats the purpose of automation. By storing the differences in a list and use the lookup function to extract the values, I’m able to write the following tf config with little…

Read More

aliyun

Switched to aliyun international today. It’s incredibly fast compared to DigitalOcean in the same region. Monthly charge is reduced by almost 50% [1] Blazing fast Compared to what I previous used, network performance exceeds my expectation. My DO vm was in the same region. Very often I had to wait 3-10 seconds for my blog to load. After moving to aliyun, the site loads in under a second. Sorry but…

Read More

Writing a wordpress plugin to filter comments

I’m completely new to wordpress plugin development. I want to write a plugin to delete comments I don’t want based on a keyword list. Update: WordPress already comes with this feature under Comment Moderation The code The code isn’t complex. It first use the preprocess_comment hook to check the comment content. If it contains hyperlinks, a 404 error will be returned and the comment will not be inserted into database.…

Read More

Google wifi – days of work

Another user at home was complaining about all the different APs that I have installed. All the different SSID and the fact that wireless clients tend to cling to AP that are further away and the connection became dead slow. Often we will need to manually switch to a different SSID. My place isn’t particularly huge. But rooms are separated by brick walls. I was exited about google wifi when…

Read More

AWS Application Load Balancer Request Tracing

ALB is a layer7 load balancer on AWS. It offers more features than ELB. You can find out more about it on https://aws.amazon.com/elasticloadbalancing/applicationloadbalancer/ Recently, I was asked to look into a random 504 issue with ELB. Because there is not a lot to configure on ELB and it’s pretty much a black box, I wasn’t making any headway there. The client believes their code is solid and this is an…

Read More