our experience in resizing an ebs volume in ec2 instances.

Increasing disk space without downtime. So in our team, we had to resize an instance disk because it’s getting full, this is our experience. For the first time we search on how to do this, there are many articles written about it and most of them require to stop the system and detaching a volume. But there must be a real doc from aws itself, that is most likely up to date. ...

March 19, 2018 · 2 min · Zakatell Kanda

disabling udp in memcached.

One of our server provider which is running in Germany have a bot that scans for an open port, this is to prevent other humans/robot in abusing services that are open on the internet. For us, they determined that our memcached port is open, we were confused at first how could this happen, we were sure that this is blocked via iptables. It turns out memcached by default listens to both TCP and UDP, since we don’t have yet a firewall for UDP, we opted for something simpler and to disable UDP on memcached(we know we only use TCP). ...

March 7, 2018 · 1 min · Zakatell Kanda

updating a configmap/secrets in kubernetes

At work, we started using Kubernetes for stateless application. We frequently change the values of configmap/secrets especially in staging environments, however, this is still not baked in to k8s. How to do it? You have to replace a config to update it. For example, if you create a configmap like this: kubectl create configmap site-config --from-file=nginx.conf If you want to update that, you have to add the command above with ...

March 6, 2018 · 1 min · Zakatell Kanda

golang: defer inside a for loop

So I have an infinite for loop however I want to use defer to make my intention clearer. Problem is this defer would never run because my function wouldn’t return. This, in turn, would give you memory leak. As neat as it could be, you can use a closure/anonymous function for this. for x := 0; x < 2; x++ { func() { defer fmt.Println(x) }() } Real world use case: So what I’m trying to do is to have an infinite polling using context on AWS SQS to add a timeout if something is wrong with SQS(this can be anything from network errors to aws being down, it can happen). ...

August 2, 2017 · 1 min · Zakatell Kanda

running elasticsearch on a 2gb digital ocean droplet

So I want to run Elasticsearch on a very limited memory machine and I keep running on this error: cannot allocate memory. Did some research and found this docs on increasing max_map_count: echo "vm.max_map_count=262144" | sudo tee -a /etc/sysctl.conf sudo sysctl -w vm.max_map_count=262144 But the problem still persists, turns out memory still actually still not enough. I want don’t to upgrade the memory since I just want to test things out and I have no plan on running it on production. ...

July 3, 2017 · 1 min · Zakatell Kanda

installing python packages directly from github using pip

Recently, I needed to install a package directly from Github which I’m trying to contribute into. For example, you have this url: https://github.com/zkanda/lambda-uploader What you can do is just add git+ as a prefix in the URL. Here’s how you can do it! pip install git+https://github.com/zkanda/lambda-uploader But I want to install a code in another branch, so how do we do it? We just add @branch_name at the end of the url. ...

December 5, 2016 · 1 min · Zakatell Kanda

setting vi mode on ipython

When I upgraded my IPython version to 5 and one thing that I’m missing is vi mode binding. When I read the changelog, they now replace readline with prompt_toolkit a pure python interactive command line prompt. This is very nice because it supports all platform that Python supports. So to bring back your vi binding, you need to do some few changes. ipython profile create This will create a default profile where you can change your IPython configuration. ...

July 13, 2016 · 1 min · Zakatell Kanda

compiling a beta kernel in archlinux

You have a new laptop, you install ArchLinux on it and seems like some things are missing. This is currently the case for me: one missing feature was “suspend”, my laptop just seems to boot as if I turned off everything, my application is not persisted another is a fix for my headphone noise issue, just to name a few… One of the few things you can try is to install the latest beta kernel. In my case, it’s Linux 4.6. This fixes all of the issued I outlined above. ...

June 17, 2016 · 2 min · Zakatell Kanda