Zak's Notes

SRE Field Notes

Using Dig For Debugging

dig (Domain Information Groper) is a command-line tool used for querying DNS (Domain Name System) servers for information about host addresses, mail exchanges, nameservers, and other related information. It provides a way to manually check the DNS records for a particular domain and see what information the DNS servers are providing. Here’s how you can use dig and an example usage: Install dig: The dig tool is typically included in most Unix-based systems, such as Linux and macOS.

Local Sandbox Kubernetes for Development with Kind

Local Dev Kubernetes Cluster with Kind When spinning up a kubernetes cluster on gcp or aws it may take time to provision. A quick way to spin up a cluster locally is by using this tool called Kind. You may want to set this up for testing purposes or for experimenting with a new tool. Setting up a full-blown Kubernetes cluster for just some testing can feel like overkill, right?

Terraform Vpc Peering

Here’s an example Terraform configuration for creating two VPCs and automatically accepting VPC peering between them: provider "aws" { region = "us-west-2" } resource "aws_vpc" "vpc_a" { cidr_block = "10.0.0.0/16" tags = { Name = "VPC A" } } resource "aws_vpc" "vpc_b" { cidr_block = "10.1.0.0/16" tags = { Name = "VPC B" } } resource "aws_vpc_peering_connection" "peer_a_b" { vpc_id = aws_vpc.vpc_a.id peer_vpc_id = aws_vpc.vpc_b.id auto_accept = true tags = { Name = "Peer A to B" } } resource "aws_vpc_peering_connection_accepter" "peer_b_a" { vpc_peering_connection_id = aws_vpc_peering_connection.

Profiling Python Programs

When profiling programs in python you will need to use a module called cProfile which will output a file which you can later use with Snakeviz. Snakeviz is a tool to see how well your code is performing. Another option to display the output is by using gprof2dot to convert the cprofile output into a graph. python -m cProfile -o ~/prof.out app.py > cprof.txt snakeviz ~/prof.out Make A Graph Of Your Program: gprof2dot -f pstats ~/prof.

Clean White Theme for Hugo

How to set up this theme

Clean White Theme for Hugo CleanWhite is a clean, elegant, but fully functional blog theme for Hugo. Here is a live demo site using this theme. It is based on huxblog Jekyll Theme and Clean Blog Jekyll Theme. These two upstream projects have done awesome jobs to create a blog theme, what I’m doing here is porting it to Hugo, of which I like the simplicity and the much faster compiling speed.