Skip to content

Instantly share code, notes, and snippets.

View lucymhdavies's full-sized avatar
🍓
Strawb System

Lucy Davinhart || Strawb System lucymhdavies

🍓
Strawb System
View GitHub Profile
@lucymhdavies
lucymhdavies / policy attributes
Created August 7, 2022 13:35
HashiCorp Vault Sentinel policy to limit Userpass auth to my home network
$ vault read sys/policies/egp/restrict-userpass-cidr
Key Value
--- -----
enforcement_level hard-mandatory
name restrict-userpass-cidr
paths [auth/userpass/*]
policy ...
@lucymhdavies
lucymhdavies / bootstrap.sh
Created May 29, 2021 15:57
Vault Agent PKI on a Synology NAS
#!/bin/bash
set -e
# Proof of Concept Bash Script to connect to NAS and configure everything
REMOTE_PORT=1337
REMOTE_HOST=codex.davnet.lmhd.me
REMOTE_USER=shenanigans
@lucymhdavies
lucymhdavies / README.md
Last active July 7, 2021 12:01
Dynamic Terraform for Vault PKI Roles

Terraform plan to create this example looks like:

  # vault_pki_secret_backend_role.pki_roles["pki/inter/davnet.lmhd.me.yaml"] will be created
  + resource "vault_pki_secret_backend_role" "pki_roles" {
      + allow_any_name                     = false
      + allow_bare_domains                 = false
      + allow_glob_domains                 = false
      + allow_ip_sans                      = true
      + allow_localhost                    = false
@lucymhdavies
lucymhdavies / pki.tf
Last active May 10, 2021 20:59
Vault PKI Terraform
# Terraforming the example from here:
# https://learn.hashicorp.com/tutorials/vault/pki-engine
#
# Root CA
#
resource "vault_mount" "pki_root" {
path = "pki/root"
@lucymhdavies
lucymhdavies / status.sh
Created January 2, 2021 14:01
Set Discord Status via API
#!/bin/bash
DISCORD_TOKEN="REDACTED"
for i in $(seq 69 -1 0); do
curl 'https://discord.com/api/v8/users/@me/settings' \
-X 'PATCH' \
-H "authorization: ${DISCORD_TOKEN}" \
-H 'content-type: application/json' \
@lucymhdavies
lucymhdavies / nope.sh
Last active February 21, 2020 15:52
For when your computer just doesn't want to listen to you anymore...
#!/bin/bash
# Usage:
# source <(curl -L https://straw.be/nope.sh)
for c in $(\compgen -A function -abck); do \eval "\alias $c='\echo NOPE #'"; done
@lucymhdavies
lucymhdavies / signdance.go
Created January 26, 2019 20:28 — forked from Deleplace/signdance.go
Source code for a sample Google Cloud Function
# Copyright 2019 Google LLC
# SPDX-License-Identifier: Apache-2.0
package p
import (
"fmt"
"image"
"image/color"
"image/draw"
"image/gif"
FROM ubuntu:18.04
MAINTAINER muebau
ENV DEBIAN_FRONTEND noninteractive
ENV HOME /
VOLUME ["/config"]
VOLUME ["/output"]
VOLUME ["/world"]
@lucymhdavies
lucymhdavies / README.md
Created January 25, 2018 23:12
Experimenting with marcusolsson/tui-go as a search/list combobox
package cmd
import (
"github.com/docker/go-connections/nat"
"github.com/skybet/cali"
)
func init() {