aapje is baas tech

Recent Articles:

Add target tracking auto scale to your aws ecs service

This cloudformation snippet will add auto scale to your existing cloudformation based ecs service.

To connect it to your service you may need to edit the folowing vars ServiceScalingTarget:
- Service This is the name of the cloudformation block that defines your ecs service - Ref: ContainerCluster This should pull in the …


Hyper fast wordpress

How to speedup wordpress without without changing your website.

Not one of my regular deeply technical posts but not any less valueable.

You're probably here because you have a Wordpress based website and are not too impressed with the performance. There are a few approaches to make your content Hyper …


Get ec2 arn for local ec2 machine with python

A super minimal urllib based arn constructor based on local metadata

import urllib.request

# local ec2 arn:
f = urllib.request.urlopen('http://169.254.169.254/latest/meta-data/placement/availability-zone')
az = f.read().decode('utf-8')
f = urllib.request.urlopen('http://169.254.169.254/latest/meta-data/instance-id')
instance = f.read …

aws cli search for latest ami

This simple oneliner gets you the latest ami in a given region for a specific search term.

# get the latest ecs-optimized amazon ami in eu-west-1
aws ec2 describe-images --region eu-west-1 --owners amazon --filters "Name=name,Values=*amazon-ecs-optimized" "Name=architecture,Values=x86_64" "Name=architecture,Values=x86_64" --query 'sort_by(Images, &CreationDate)[-1 …

Install vim without X11 on FreeBSD

I can work with vi, but after using vim for years I just can't work without it. The only problem is, if you install vim with pkg install vim it installs X11 and related crap.

This should be done as root.

First update portsnap:

# get it
portsnap fetch update

# extract …