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.
@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 / 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.

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 / k8s_client.ex
Created June 15, 2021 13:37 — forked from coryodaniel/k8s_client.ex
An extremely naive k8s http client
defmodule K8s.Client do
@moduledoc """
This is a very naive k8s client.
"""
alias K8s.Conf.RequestOptions
require Logger
def post(body, conf) do
path = body_to_path(body, false)
url = Path.join(conf.url, path)
@asenchi
asenchi / Dockerfile
Created October 16, 2018 15:01 — forked from jpfuentes2/Dockerfile
dropping_the_d_in_ACID
FROM postgres:9.6-alpine
LABEL version="9.6"
LABEL author="jpfuentes2@gmail.com"
RUN apk update && apk upgrade --available
RUN apk add build-base git postgresql-dev
ENV POSTGRES_VERSION=9.6
@asenchi
asenchi / kubernetes_add_service_account_kubeconfig.sh
Created June 28, 2018 19:35 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@asenchi
asenchi / nginx-elasticsearch-proxy.conf
Created June 25, 2018 18:25 — forked from abrudtkuhl/nginx-elasticsearch-proxy.conf
NGINX Reverse Proxy Authentication For Elasticsearch
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost/_search?q=*
#
# is rewritten to:
#