Skip to content

Instantly share code, notes, and snippets.

View epequeno's full-sized avatar

Steven Pequeno epequeno

View GitHub Profile
@epequeno
epequeno / opa_cli.sh
Last active March 8, 2023 22:12
opa eval cli example
$ ls -1
example.rego
input.json
$ bat -pp example.rego
package example
default allow := false
@epequeno
epequeno / cilium.sh
Created March 6, 2023 21:53
cilium/hubble basic install
~ $ minikube start --network-plugin=cni --cni=false
😄 minikube v1.29.0 on Ubuntu 22.10
✨ Automatically selected the virtualbox driver. Other choices: none, ssh
❗ With --network-plugin=cni, you will need to provide your own CNI. See --cni flag as a user-friendly alternative
👍 Starting control plane node minikube in cluster minikube
🔥 Creating virtualbox VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🐳 Preparing Kubernetes v1.26.1 on Docker 20.10.23 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
@epequeno
epequeno / httpie_k8s.sh
Last active March 7, 2023 14:00
use httpie to PATCH k8s
# example derived from https://kubernetes.io/docs/tasks/administer-cluster/extended-resource-node/
NODE_NAME="foo"
URL="localhost:8001/api/v1/nodes/${NODE_NAME}/status Content-Type:application/json-patch+json"
DATA='[{"op": "add", "path": "/status/capacity/example.com~1dongle", "value": "4"}]'
echo -n "${DATA}" | http PATCH "${URL}"
# or
http PATCH "${URL}" <<< "${DATA}"
[package]
name = "simple-rust"
version = "0.1.0"
authors = ["Steven Pequeno <steven@pequeno.in>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
algonaut_client = "0.2.0"
$ ./sandbox down
Stopping sandbox containers...
Stopping algorand-sandbox-indexer ... done
Stopping algorand-sandbox-algod ... done
Stopping algorand-sandbox-postgres ... done
$ ./sandbox clean
Cleaning up sandbox environment...
@epequeno
epequeno / iam.py
Created May 8, 2019 20:54
basic aws config rule example
def evaluate_compliance(event, configuration_item, valid_rule_parameters):
iam = get_client('iam', event)
users = get_all_users(iam)
evaluations = []
for user in users:
e = build_evaluation(user["UserId"], 'COMPLIANT', event, annotation="testing")
evaluations.append(e)
return evaluations
@epequeno
epequeno / Stringify.elm
Created March 13, 2019 14:20
take an input (bash script ideally) and output a json string
-- Elm 0.19.0
import Browser
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Json.Encode exposing (..)
main = Browser.sandbox { init = init, view = view, update = update }
@epequeno
epequeno / certs.txt
Created January 1, 2019 01:29
certification verification info
# AWS - https://aw.certmetrics.com/amazon/public/verification.aspx
AWS Certified DevOps Engineer - Professional - 6SPY1SVKDF4Q1N97 (Mar 2018)
AWS Certified Solutions Architect - Professional - SM19EYTCJEV1QZ9X (Mar 2018)
AWS Certified Developer - Associate - X616ETF1JE441E94 (Oct 2016)
AWS Certified Solutions Architect - Associate - E6K5BTR2BE4Q1956 (Nov 2016)
AWS Certified SysOps Administrator - Associate - 1BK6ESTCDBE41PKC (Nov 2016)
# GCP
Google Certified Professional - Cloud Architect (May 2018) - https://verify.accredible.com/verify/id?value=11592440&custom=false
Google Certified Associate Cloud Engineer (Jul 2018) - https://verify.accredible.com/verify/id?value=11730093&custom=false
@epequeno
epequeno / Counter.elm
Last active December 3, 2018 18:50
working counter example using elm-ui
-- Elm 0.19.0
-- mdgriffith/elm-ui 1.1.0
import Browser
import Html exposing (..)
import Html.Events exposing (..)
import Element exposing (..)
import Element.Input as Input
import Element.Border as Border
import Element.Font as Font