Skip to content

Instantly share code, notes, and snippets.

@asenchi
asenchi / README.md
Created April 10, 2024 00:56 — forked from ctsrc/README.md
Guide: Run FreeBSD 13.1-RELEASE for ARM64 in QEMU on Apple Silicon Mac (MacBook Pro M1, etc) with HVF acceleration (Hypervisor.framework)
@asenchi
asenchi / OpenBSD_on_Apple_M2_QEMU.md
Created April 10, 2024 00:56 — forked from astreknet/OpenBSD_on_Apple_M2_QEMU.md
OpenBSD on Apple M2 with QEMU

OpenBSD on Apple M2 with QEMU

Minimalist installation of OpenBSD on the Apple M2 using QEMU

Ingredients

Installation

  1. install QEMU with Homebrew brew install qemu, also possible with MacPorts
  2. Write a script with execute permissions chmod +x qemu_aarch64_install_openbsd.sh for installing the image.

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@asenchi
asenchi / functions.tf
Created January 11, 2024 19:44 — forked from carlessanagustin/functions.tf
Terraform functions by example
##--------------------------
## Terraform: Functions ##
##--------------------------
## Open terraform console
terraform console
#######################
## Numeric Functions ##
#######################
@asenchi
asenchi / README.md
Created August 29, 2023 00:55 — forked from strfry/README.md
Deploys FreeBSD on a Hetzner cloud server

Deploys FreeBSD on a Hetzner cloud server

Prerequisites:

  • A Hetzner Cloud API Token (Pass in via APIKEY)
  • jq
  • sshpass

Usage

Replace server_id variable with your hetzner server Id
@asenchi
asenchi / biggest_relations.txt
Created September 7, 2011 02:03 — forked from nesquena/basic.sql
PostgreSQL Common Utility Queries
# Finding the total size of your biggest tables
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_relation_size(C.oid)) AS "size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
ORDER BY pg_relation_size(C.oid) DESC
LIMIT 20;
@asenchi
asenchi / sed cheatsheet
Created April 3, 2012 13:17 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@asenchi
asenchi / README.md
Created September 23, 2022 17:26 — forked from brentjanderson/README.md
Elixir runtime-controlled supervision tree using feature flags (circuit breaker)

These snippets provide a foundation for starting and stopping supervision trees at runtime using feature flags (e.g. Launch Darkly).

Some things to note when adapting these snippets:

  1. application.ex needs to be adapted into an existing application. The important part is that each child spec provided is compliant, and that there is a feature flag (ld_key) specified.
  2. As written, if a feature flag fails for some reason, it defaults to starting all children. There is room for adaptation here as needed.
  3. This implementation will still require a FeatureFlags module to be available that implements is_on?/2. Adjust as needed to accomodate your own feature flag setup.
@asenchi
asenchi / pipe.go
Created January 17, 2012 21:13 — forked from dustin/pipe.go
generic tcp proxy
package main
import (
"flag"
"io"
"log"
"net"
"runtime"
)
@asenchi
asenchi / pypy-gcbench-output.txt
Created March 17, 2011 19:00
Output from running the pypy-gcbench script below
export PYPY_GC_NURSERY=128K # procs=1
Completed in 5831.011057 ms.
export PYPY_GC_NURSERY=256K # procs=1
Completed in 5307.267904 ms.
export PYPY_GC_NURSERY=512K # procs=1
Completed in 5007.555008 ms.
export PYPY_GC_NURSERY=768K # procs=1
Completed in 4759.601116 ms.
export PYPY_GC_NURSERY=1M # procs=1
Completed in 4775.329828 ms.