Skip to content

Instantly share code, notes, and snippets.

@asenchi
asenchi / README.md
Created August 29, 2023 00:55 — forked from strfry/README.md
Deploys FreeBSD on a Hetzner cloud server
View README.md

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)
View README.md

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.
View adams-heroku-values.md

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
View k8s_client.ex
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
View Dockerfile
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
View kubernetes_add_service_account_kubeconfig.sh
#!/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
View nginx-elasticsearch-proxy.conf
# 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:
#
View aws_vpc.tf
# file name terraform/modules/aws_vpc/vpc.tf
# first create the VPC.
# Prefix resources with var.name so we can have many environments trivially
resource "aws_vpc" "mod" {
cidr_block = "${var.cidr}"
enable_dns_hostnames = "${var.enable_dns_hostnames}"
enable_dns_support = "${var.enable_dns_support}"
tags {
Name = "${var.env}_vpc"
View keybase.md

Keybase proof

I hereby claim:

  • I am asenchi on github.
  • I am asenchi (https://keybase.io/asenchi) on keybase.
  • I have a public key ASA7x3jgDU46kd6ITI7xBCcKRBueQr8CB8IbwUDfKuJ3RQo

To claim this, I am signing this object: