like every developer out there, I'm continually pushing new code and figuring things out.
I noticed that from time to time I've been collecting some Gists - even though not sharing them publicly, and not documenting them enough.
This section is where I'll now start sharing those snippets of code. I hope you learn something from them!
- Shell: how to add a prefix to the output of multiple commands
Executing multiple shell commands in continuous integration might become hard to read. Check out how to prefix command executions using bash.
- Using HAProxy maps with Access control lists (acl)
HAProxy frontends can have their logic simplified by using maps. Check out how to tie maps with ACLs to improve routing.
- Making HAProxy responds 200 OK to health checks
Sometimes you need HAProxy to have a special frontend to return 200 OK when a request is made for health-checking purposes. Check out three ways of doing it.
- Using C to inspect Linux syscalls
A deep dive into how to make use of ptrace to inspect syscalls made by a tracee while they occur.
- How to set up AWS EFS across multiple availability zones using Terraform
Having an AWS EFS file system over multiple availability zones using Terraform is not complicated. Check out one way of doing it.
- How to collect Docker Daemon Metrics
Docker ships with native Prometheus integration - the docker daemon can generate metrics about it and let you scrape that. Check out how to gather Docker daemon metrics in Linux and MacOS.
- Using find to search for Golang directories
The find UNIX utility is great for searching for directories, but vendoring might get in the way. Check out how to use find excluding the golang vendor directory
- An Example of Go RPC Client and Server
Having jump straight to gRPC, I got surprised by how easy is to set up Go RPC using net/rpc package. Check out a simple example exploring this package.
- Replacing HAProxy ACLs by HAProxy Maps
HAProxy maps can reduce the complexity of haproxy configurations by allowing you to define map lookup logic. Check out how to remove ACLs in favor of maps.
- Forcing (from inside) the redirection of all outputs of a bash script to a file
Using exec to redirect force redirection from within a bash script.
- HAProxy Docker Container Logs
HAProxy doesn't naturally log to standard out - you need to pick rsyslog and make it do so. Check out how to have HAProxy logs going to stdout using Docker containers.