Skip to content

Instantly share code, notes, and snippets.

View dch's full-sized avatar
🛋️

Dave Cottlehuber dch

🛋️
View GitHub Profile
@dch
dch / count.lua
Last active December 29, 2024 22:59
lua jail API
#!/usr/libexec/flua
local jail = require("jail")
local i = 0;
for j in jail.list({"name"}) do
i = i + 1
if i % 100 == 0 then
print(j["name"])
@dch
dch / bebuild.sh
Created December 13, 2024 21:39
builder
#!/bin/sh -eu
# echo 'WITH_CCACHE_BUILD=yes' > /etc/src.conf
# echo 'WITH_META_MODE=yes' > /etc/src-env.conf
# echo 'WITH_DIRDEPS_BUILD=yes' >> /etc/src-env.conf
umask 0022
cd /usr/src
NOW=$(date -u +%Y%m%d-%H%M)
# NCPU=$(sysctl -n hw.ncpu)
NCPU=3.0
@dch
dch / .iex.exs
Created December 10, 2024 14:10
iex
defmodule I do
def cls, do: IO.puts("\ec")
def qt(m, f \\ :_) do
l(m)
:recon_trace.calls(
{m, f, :return_trace},
{1000, 10000},
pid: :all,
scope: :local,
@dch
dch / .iex.exs
Created November 29, 2024 08:41
iex.ex
defmodule I do
def cls, do: IO.puts("\ec")
def qt(m, f \\ :_) do
:recon_trace.calls(
{m, f, :return_trace},
{1000, 10000},
pid: :all,
scope: :local,
stack: :return
@dch
dch / diff.patch
Created November 26, 2024 09:03
arcanist
--- ArcanistPatchWorkflow.php.orig 2022-05-17 23:20:14.000000000 +0000
+++ ArcanistPatchWorkflow.php 2024-11-26 09:01:01.137494000 +0000
@@ -436,10 +436,7 @@
echo phutil_console_format(
"<bg:blue>** %s **</bg> %s\n",
pht('INFO'),
- pht('Base commit is not in local repository; trying to fetch.'));
- $repository_api->execManualLocal('fetch --quiet --all');
- $has_base_revision = $repository_api->hasLocalCommit(
- $bundle->getBaseRevision());
@dch
dch / 00_nocloud.cfg
Last active July 25, 2024 16:50
cloudinit 24.1.4 on FreeBSD fails to use NoCloud provider
datasource:
NoCloud:
seedfrom: file:///root/cloud/
network:
config: disabled
timeout: 1
@dch
dch / mlx5.md
Created June 12, 2024 08:55
mlx5
[12324] mce0: ERR: mlx5e_dump_err_cqe:75:(pid 12): Error CQE on CQN 0x22, CI 0x37d, QN 0xc5, OPCODE 0xd, SYNDROME 0x2, VENDOR SYNDROME 0x68
[12324] [0] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[12324] [0x10] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[12324] [0x20] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[12324] [0x30] 00 00 00 00 04 10 68 02 65 00 00 c5 03 80 0e d2
[15596] mce0: ERR: mlx5e_dump_err_cqe:75:(pid 12): Error CQE on CQN 0x1b, CI 0x100, QN 0xa7, OPCODE 0xe, SYNDROME 0x4, VENDOR SYNDROME 0x32
[15596] [0] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[15596] [0x10] 00 00 00 00 00 00 e2 7e 06 00 00 00 00 00 00 00
[15596] [0x20] 00 00 00 00 00 00 92 32 00 00 00 00 00 00 01 f5
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