Skip to content

Instantly share code, notes, and snippets.

@macros
macros / gist:a0969b17e4342fd4ddaade671b65bbb7
Created November 1, 2026 18:30
OKF like git wiki conventions
# Conventions
How this wiki works — for humans and agents. This is the contract that keeps
the wiki the source of truth.
## Source of truth
This wiki (`computers.wiki.git`) is the single source of truth for fleet
documentation. Humans read and edit via the web UI. Agents work in a
persistent clone at `~/fastly/computers-wiki`:
{
config,
lib,
pkgs,
...
}: let
cfg = config.kernel.autofdo;
profileExists =
cfg.profilePath
@macros
macros / miniupnpd.nix
Created March 1, 2022 20:06
Miniupnpd with nftables override
# Rebuild the package with nftables support
# Module expects scripts named iptables_ so copy nft versions to those names
nixpkgs.config.packageOverrides = pkgs: {
miniupnpd = pkgs.miniupnpd.overrideAttrs (o:{
buildInputs = o.buildInputs ++ [ pkgs.libmnl pkgs.libnftnl pkgs.openssl ];
makefile = "Makefile.linux_nft";
configureFlags = [ "--firewall=nftables" ];
postFixup = ''
cp $out/etc/miniupnpd/nft_init.sh $out/etc/miniupnpd/iptables_init.sh
cp $out/etc/miniupnpd/nft_removeall.sh $out/etc/miniupnpd/iptables_removeall.sh
#include <stdio.h>
#include <fcntl.h>
#include <stdint.h>
int main(int argc, char **argv) {
int32_t l;
int fd;
if (argc != 2) {
fprintf(stderr, "Usage: %s <latency in us>\n", argv[0]);
@macros
macros / gist:553c2ef4d4b0594154f5
Created April 12, 2015 04:59
haproxy-gmetric
#!/usr/bin/ruby
require 'socket'
PROCESS_METRICS = {
'Uptime_sec' => %w(uptime seconds),
'ConnRate' => %w(connection_rate connections rate),
'SessRate' => %w(session_rate sessions rate),
'SslFrontendKeyRate' => %w(sslkey_rate lookups rate),
'SslCacheLookups' => %w(sslcache_lookups lookups counter),
#!/usr/bin/ruby
require 'openssl'
cert = OpenSSL::X509::Certificate.new File.read(ARGV[0])
cn = cert.subject.to_a.select{|oid, value| oid == "CN"}[0][1]
puts "Cert metadata"
puts cert.serial
puts cert.issuer
@macros
macros / bgpd.conf
Created September 26, 2012 23:54
bgp samples
!
! Zebra configuration saved from vty
! 2012/03/15 02:25:13
!
hostname bgpd
log file /var/log/quagga/bgpd.log
log stdout
!
router bgp 31377
bgp router-id 17.16.0.1
Hi Jason,
I wanted to reach out to see if you are open to exploring engineering
opportunities with Google. ?I support Google.com engineering and thought
your experience with ops engineering and keeping Fastly's systems up and
running would be a good fit for our team.
If you're interested, please let me know when you have a few minutes to
chat. ?Even If you aren't looking for a change at the moment let's still
connect on LinkedIn so we can follow up at a later date.
Regards,
?
APT
{
Install-Recommends “false”;
Install-Suggests "false";
};
Dpkg::Options {
"--force-confdef";
"--force-confold";
}
@macros
macros / gist:3165661
Created July 23, 2012 19:29
Rackspace, not home of the iops
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await svctm %util
xvda 0.00 3.60 0.00 3.40 0.00 0.03 16.47 0.90 263.82 117.65 40.00