Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Benji Visser noqcks

🏠
Working from home
  • Xeol
  • Toronto, ON
  • 09:21 (UTC -04:00)
View GitHub Profile
@noqcks
noqcks / o.json
Created March 11, 2023 18:14
syft v0.74.0 - python:3.4
View o.json
This file has been truncated, but you can view the full file.
{
"artifacts": [
{
"id": "55b15606ad877995",
"name": "adduser",
"version": "3.115",
"type": "deb",
"foundBy": "dpkgdb-cataloger",
"locations": [
{
@noqcks
noqcks / o.json
Created March 11, 2023 18:12
syft v0.74.1 - python:3.4
View o.json
This file has been truncated, but you can view the full file.
{
"artifacts": [
{
"id": "55b15606ad877995",
"name": "adduser",
"version": "3.115",
"type": "deb",
"foundBy": "dpkgdb-cataloger",
"locations": [
{
View user-data.sh
#!/bin/sh
sudo apt-get -y install awscli
export AWS_DEFAULT_REGION=$( curl -s http://169.254.169.254/latest/meta-data/placement/region )
EFS_ID=$( aws ssm get-parameter --name dev_efs_id --output text --query 'Parameter.Value' )
ACCESS_POINT_DATA=$( aws ssm get-parameter --name dev_efs_data_ap --output text --query 'Parameter.Value' )
EFS_MOUNT_AZ=$( aws ssm get-parameter --name dev_efs_az --output text --query 'Parameter.Value' )
IP_ALLOC_ID=$( aws ssm get-parameter --name dev_ip_allocation_id --output text --query 'Parameter.Value' )
SSH_PUBLIC_KEY=$( aws ssm get-parameter --name dev_ssh_key --output text --query 'Parameter.Value' )
@noqcks
noqcks / README.md
Created May 26, 2022 13:25
Add growl notifications when a long running command fails or succeeds
View README.md
  1. Add this to your .rc file
preexec () {
   (( $#_elapsed > 1000 )) && set -A _elapsed $_elapsed[-1000,-1]
   typeset -ig _start=SECONDS
}

# Notify about long running commands
function precmd() {
@noqcks
noqcks / decrypt.sh
Last active January 6, 2019 19:59
This is a script to be added to a Docker ENTRYPOINT for secret decryption using ejson-kms.
View decrypt.sh
#!/bin/sh
# This is a secret decryption script that will decrypt ejson-kms secrets and
# export them to the shell environment.
#
# It expects two sane defaults:
# 1. That $ENV has been set already, so that we know which environment we're in
# and what secrets to export.
# 2. That the location of your secrets are either relative at
# _infra/secrets/$ENV.json or absolutely located at /opt/_infra/secrets/$ENV.json.
@noqcks
noqcks / ejson2env
Last active December 24, 2018 17:43
View ejson2env
This file has been truncated, but you can view the full file.
@noqcks
noqcks / ejson.sh
Last active December 24, 2018 17:47
View ejson.sh
#!/bin/sh
set -eo pipefail
# get ejson2env
wget -q https://gist.github.com/noqcks/88304840eb85e6d7ac6d3dcfe1fa9bc4/raw/e8d7beaa89ec8a819489852d023dc641b027748c/ejson2env
chmod +x ejson2env
mv ejson2env /usr/bin/ejson2env
# exit if $ENV doesn't exist. Not sure what environment to decrypt!
@noqcks
noqcks / main.go
Created December 6, 2018 15:53
Kubernetes go-client deployment patching.
View main.go
package main
// the equivalent of kubectl set image deployment/api api="image"
import (
"fmt"
patchtype "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
"k8s.io/client-go/rest"
View airflow-rbac.yml
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: airflow-scheduler
namespace: airflow
---
# Allows Airflow to grab config maps (airflow.cfg)
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1