Skip to content

Instantly share code, notes, and snippets.

@pirogoeth
pirogoeth / dirlocate.sh
Created November 28, 2012 02:34
locates a directory above the current. used to find project directories in dm. based on lsiden's original.
function dirlocate () {
fDir=$1
sLimit=$2
lDir=""
curdir=`pwd`
while [[ "`pwd`" != "${sLimit}" && "`pwd`" != "/" ]] ; do
if test -e "${fDir}" ; then
cd ${fDir}
lDir=`pwd`
break;
@pirogoeth
pirogoeth / saml.lua
Created November 9, 2015 04:04
beginning of saml support in lsso
--
-- saml.lua -- module that handles SAML communication
--
module('saml', package.seeall)
-- Lua standard and external library imports
local os = require "os"
local xml = require "xml"

Keybase proof

I hereby claim:

  • I am pirogoeth on github.
  • I am failfish (https://keybase.io/failfish) on keybase.
  • I have a public key whose fingerprint is FE59 36DF 6B1F AE3E 0DB7 716E 331C 0128 EADB D70D

To claim this, I am signing this object:

@pirogoeth
pirogoeth / _INSTALL.md
Created January 16, 2016 22:42 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@pirogoeth
pirogoeth / openpgp.txt
Created March 11, 2016 02:44
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:fe5936df6b1fae3e0db7716e331c0128eadbd70d]
@pirogoeth
pirogoeth / cockpit.yaml
Last active March 20, 2017 16:39
cockpit dev env with tmuxp and asdf
# Place this in ~/.tmuxp/cockpit.yaml OR in the root of your cockpit directory as .tmuxp.yaml
session_name: cockpit-dev
shell_command_before:
# Change this to pop in to your cockpit dev dir!
- cd ~/Projects/cockpit
- workon cockpit
windows:
- window_name: services
layout: main-horizontal
@pirogoeth
pirogoeth / tap.py
Created July 7, 2017 20:49
Python method to "tap" a config object
def dict_tap(path, default=None):
""" Retrieves the path through a dictionary.
"The config is a lot like an onion - it has layers"
example:
>>> dict_tap(
>>> 'otp.age_threshold',
>>> default=2,
>>> )
"""
@pirogoeth
pirogoeth / result.go
Created July 28, 2017 19:27
I tried ¯\_(ツ)_/¯
package main
import (
"errors"
"fmt"
"reflect"
"time"
)
type Result struct {
@pirogoeth
pirogoeth / diecast-example.py
Created February 7, 2018 05:45
Example usage for components with Diecast
# -*- coding: utf-8 -*-
# this is the base test case of the DI prototype
import logging
import sys
from typing import Callable, Type
from diecast.component import Component
from diecast.inject import build_passthru_args, make_injector
from diecast.registry import get_registry, register_component
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import io
import os
import re
import sys
from os import path