Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
defmodule I do
def cls, do: IO.puts("\ec")
def qt(m, f \\ :_) do
:recon_trace.calls(
{m, f, :return_trace},
{100, 10000},
pid: :all,
scope: :local,
stack: :return
@dch
dch / .iex.exs
Created February 20, 2024 11:27
dch custom iex prompt, put in ~/.iexs
defmodule I do
def cls, do: IO.puts("\ec")
def qt(m, f) do
:recon_trace.calls(
{m, f, :return_trace},
{100, 10000},
pid: :all,
scope: :local,
stack: :return
@dch
dch / beetroot_risotto.md
Created February 1, 2024 15:01
beetrtoot risotto
  • fry a few onions
  • add salt and grated beetroot
  • add risotto rice and thyme
  • cook a few minutes
  • add red wine, stock, water slowly
  • stir in parmesan cheese or feta
  • serve with chopped walnuts or similar
  • rock a sprinkle of green chives or rucola
@dch
dch / pot-stickers.md
Last active January 7, 2024 22:12
Asian Dumplings or Piryogi
@dch
dch / chilli.md
Created January 7, 2024 21:47
chilli beans

ingredients

  • 2 red peppers, diced
  • 4 onions, sliced
  • 4 cloves garlic, chopped
  • 3 carrots, grated
  • 2 tins red beans, washed & drained
  • 1 tin white beans, washed & drained
  • 1 tin corn kernels, washed & drained
  • 2 tins peeled or diced tomatoes
@dch
dch / lentils.md
Last active January 7, 2024 21:37
Syrian shorbit adas lentil soup
@dch
dch / http_proxy.go
Created December 7, 2023 18:47 — forked from jim3ma/http_proxy.go
Register Dialer Type for HTTP&HTTPS Proxy in golang
package main
import (
"bufio"
"fmt"
"net"
"net/http"
"net/url"
"crypto/tls"
@dch
dch / spicey-rub.md
Last active July 15, 2023 11:49
Dave's magic Spicey Dry Rub

2023 Spicey Rub 2.0

  • measurements don't need to be precise

  • adjust chilli, cayenne & cumin to taste

  • leave your recommendations in the comments!

  • T Tablespoon

  • t teaspoon

  • C metric cup ~ 200mL

This file has been truncated, but you can view the full file.
-- SPDX-License-Identifier: CC0-1.0
-- vim:syntax=lua:set ts=4 sw=4:
-- Refer to manual: https://knot-resolver.readthedocs.org/en/stable/
-- Network interface configuration
net.listen('127.0.0.1', 53, { kind = 'dns' })
net.listen('100.64.0.0', 53, { kind = 'dns' })
net.listen('172.16.1.1', 53, { kind = 'dns' })
net.listen('172.16.2.1', 53, { kind = 'dns' })
@dch
dch / _readme.md
Last active October 3, 2022 21:17
GET haproxy sticky table data as json

HTTP JSON API for haproxy stick tables

intro

A quick sketch of haproxy config with lua to provide an HTTP API to query stick tables in JSON format. Probably has a few rough edges around output as kv_pairs() doesn't really understand its output, just building up strings. A proper table traversal function would be better, and verifying its actually valid JSON would be even better.