Skip to content

Instantly share code, notes, and snippets.

@juniorz
juniorz / HTTP.md
Last active October 5, 2024 14:53
Tools of trade

Keep-Alive

time telnet www-org.example.com 80

GET / HTTP/1.1
Host: www-org.example.com
Connection: keep-alive

(wait)
@juniorz
juniorz / install_postgis_osx.sh
Created July 14, 2011 03:49
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@juniorz
juniorz / README.md
Last active September 23, 2023 12:54
sysdig sample capture file

Test file generated for sysdig homebrew formula

This is how it was generated

$ mkdir -p /tmp/sysdig && cd /tmp/sysdig
$ sudo sysdig -w sample.scap evt.type=open and fd.name contains /tmp/sysdig

The test performed should be

$ sudo sysdig -r sample.scap evt.type=open fd.name contains /tmp/sysdig/sample.scap

@juniorz
juniorz / platform-engineering.md
Last active June 21, 2023 11:07
The jungle I live in

"Those that know, do. Those that understand, teach."

Aristoteles (supposedly)

Scope: Building and running web-scale distributed cloud systems with container technologies :P

Learning goals

  • Establish the challenges for engineering cloud-native systems (the problem space).
  • Establish the approaches to address those challenges (the solution space).

Software development hard truths

  • Dead Space development struggling to integrate changes from multiple teams/experts: https://youtu.be/BQ3iqq49Ew8?t=655
  • Desktop apps: once in a while you kill a process eating all you RAM. Web apps: once in a while you kill the Google Chrome GPU task eating all your RAM after you open a GIF.
  • Today's browser wars: migrating a customer's 100s open tab from Chrome to Firefox/Edge/Opera/Safari.
  • Why it is important to make experimention cheap.
  • The origin of Control Plane vs Data Plane and how the concept influenced UNIX design
@juniorz
juniorz / dns.go
Last active June 14, 2022 14:50
XMPP SRV dns over Tor
package xmpp
import (
"errors"
"fmt"
"log"
"net"
"net/url"
"github.com/miekg/dns"
@juniorz
juniorz / README.md
Last active May 12, 2022 07:57
Annoying Kubernetes Issues

kubectl logs has quirks due to log-rotation

kubectl logs does not take into account container log rotation (kubelet config containerLogMaxSize and containerLogMaxFiles). You can still find the latest rotated logs in /var/log/pods/<namespace>_<pod-name>_<pod-uid>/ though.

Don’t assume --since=0s will have all logs since the container started because it won't look into previous log files. Don't assume a long-running --follow will always give you latest logs, because it will not switch over to the new log after current is rotated.

See: kubernetes/kubernetes#59902

KUBECONFIG is not portable

@juniorz
juniorz / instructions.md
Last active December 3, 2020 14:30
Building tor on WD My Cloud EX2

How to build tor for WD My Cloud EX2

WD My Cloud EX2 has an Marvell Armada-370 CPU (Marvell PJ4Bv7 Processor rev 1 (v7l)) with 512MB RAM.

This device uses 32-bit binaries with 64K page size. WD releases a cross-compilation environment as part of its "WD My Cloud EX2 GPL Source Code". Download it from WD support page (making sure it matches your firmware version) and follow the instructions in My_Cloud_EX2_Release_Notes_GPL_*.txt to setup the environment. I recommend using a Debian OS.

The following packages are required to use the cross-compilation environment: build-essential automake lib32z1

Building dependencies