My personal blog

Enable TLS in redis-cli for Ubuntu

Redis server has an option to enable in transit encryption. This capability can help protect your data when it is moving from one location to another. However by the time this article written, by default redis-cli does not have an option to enable TLS connection to the redis-server. So if you install default redis-cli for your distro, you cannot establish connection to redis-server with in transit TLS encryption enabled. [email protected]:~# redis-cli --tls Unrecognized option or bad number of args for: '--tls' Workaround In this section we will cover how to enable tls option for redis-cli in Ubuntu 16.04.6 Xenial LTS. Other Ubuntu version usually have similar package name for it’s dependency.......

Expose your localhost with ngrok

In some use cases, we might need or want to expose our service running in local to public. So it is accessible via internet. Whether it is only for demo to client, troubleshooting staging environment, or just a weekend project. Ngrok can be quite helpful in these use cases. Installation Ngrok can be installed either using homebrew or manually download the binary then put in your $PATH directory. e.g: /usr/local/bin To install using Homebrew, use this command brew cask install ngrok. You can see all available options after your installation completed ❯ ngrok NAME: ngrok - tunnel local ports to public URLs and inspect traffic DESCRIPTION: ngrok exposes local networked services behinds NATs and firewalls to the public internet over a secure tunnel.......

How to publish Homebrew formula in private Git repository

This article is still related with How to publish your Go binary as Homebrew Formula with GoReleaser Full source code of this example can be seen in https://github.com/franzramadhan/homebrew-go-example Introduction This article will cover how to publish Homebrew formula to Private Github repository easily using GoReleaser. Background Sometimes, we need to publish our artifact or Homebrew formula privately. So it is only accessible within our organization or our teammates. Therefore, we need to create one logic to Homebrew so it is able to handle this scenario. Solution To do that we need to create a script as a download strategy, then tells the Homebrew formula to use the strategy instead of using normal one.......

How to publish your Go binary as Homebrew Formula with GoReleaser

TIL; There is a cool FOSS tool called GoReleaser. This will make releasing Golang project a lot easier. You can see the source code of this example in https://github.com/franzramadhan/homebrew-go-example Background We want to automate binary release process of our Golang code. We also want the binary to be installable using Homebrew without needing to manually create the Homebrew Formula. In this example we want to demonstrate how easily we can do a release for our Go binary project. Solution and Constraints We can utilize GoReleaser to automate the release and Homebrew Formula creation. GoReleaser also already has Github Action so we can easily integrate it in Github workflow We will only build and release commit-hash that has semantic versioning tag.......

How to handle EC2 Spot Instance Interruption

TLDR; this post was inspired by official AWS documentation for spot interruption handling. This is only for my self note. All credits should go to AWS Engineering team. This tutorial is only cover EC2 instance that is managed by AutoScaling group. Previously we already talked about average cost comparison between on-demand and spot instance. In the summary, we can save up to 90% of regular on-demand cost using Spot. However, this cost saving could reduce another aspect, reliability. Basically when we use spot, we borrow unused physical hardware for running the EC2, thus AWS can take it back once there is on-demand request that needs to use the resource.......