Skip to content

Instantly share code, notes, and snippets.

View telday's full-sized avatar

Ellis Wright telday

View GitHub Profile
#!/usr/bin/env bash
set -ex
CONJUR_IMAGE=registry.tld/conjur-appliance:5.0-stable
TEMP_DIRECTORY="$PWD/mfa-tmp"
mkdir -p $TEMP_DIRECTORY
mkdir -p $TEMP_DIRECTORY/policy
echo 'MyP@ssword1!!!' > "$TEMP_DIRECTORY/admin_password"
#!/usr/bin/env bash
set -ex
echo 'MyP@ssword1!!!' > admin_password
git clone git@github.com:conjurinc/appliance.git
pushd appliance
summon --environment artifactory ./bin/build-appliance-image
popd
@telday
telday / Readme.md
Created April 8, 2022 15:38
Example of a policy loading operator for K8s and Conjur

Requirements

In order to run this operator you need to install kopf, requests, and conjur-api which technically requires python3.10. However the PyPI install is broken anyway, so if you download and install the module from source you can change the required version in the setup.cfg file to the python3 version you have. As long as it was compiled with openssl 1.1.1 it should work.

You can install the first two requirements with python3 -m pip install kopf requests and the downloaded/cloned version of conjur-api with python3 -m pip install -e . while in the project directory.

#### Conjur Service Broker Implementation
require 'conjur-api'
def api(appliance_url)
Conjur.configure do |config|
config.account = ENV['CONJUR_ACCOUNT']
config.appliance_url = appliance_url
config.ssl_certificate = ConjurClient.ssl_cert
@telday
telday / conf.py
Created April 17, 2020 21:00
Read The Docs Theme ugly boxes fix
html_static_path = ['_static']
html_css_files = ['no_boxes.css']
@telday
telday / vdoc.bat
Created March 13, 2020 16:32
Windows command for viewing python docs in vim
echo off
if "%1" == "" GOTO fail
python -m pydoc %1 > %1.txt
vim %1.txt
rm %1.txt
goto end
:fail
echo This program requires the name of a module as the argument
:end
"""
Example of using py_cui to create a simple Command line TODO list in under 150 lines of code
@author: Jakub Wlodek, Ellis Wright (telday)
@created: 12-Aug-2019
"""
import py_cui
import os
colorscheme desert
let mapleader="."
nnoremap . <nop>
nnoremap <leader>rc :vsplit $MYVIMRC<cr>
nnoremap <leader>" /(<cr>Na"<esc>/)<cr>s")<esc>
set shortmess=at
set cmdheight=1
inoremap kl <esc>
nnoremap t V>
nnoremap T V<
@telday
telday / factorio-recipe-parser.lua
Created February 3, 2020 23:40 — forked from pfmoore/factorio-recipe-parser.lua
Parse the Factorio recipe files to create a CSV of recipes
data = {}
data["extend"] = function (data, t)
for n, recipe in ipairs(t) do
for i, component in ipairs(recipe["ingredients"]) do
cname = component[1] or component["name"]
camt = component[2] or component["amount"]
print('"' .. recipe["name"] .. '","' .. cname .. '",' .. camt)
end
end
end