Skip to content

Instantly share code, notes, and snippets.

View zalary's full-sized avatar

Zalary Young zalary

  • ATX
View GitHub Profile
@zalary
zalary / preserve_transform_spaces
Created August 20, 2020 20:32
preserve spaces with transform
vault write transform/alphabet/allow-spaces alphabet="123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-_ "
vault write transform/alphabet/no-spaces alphabet="123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-_"
vault write transform/transformation/testing \
type=fpe \
template="spaces-tmpl" \
tweak_source=internal \
allowed_roles=spaces
@zalary
zalary / controlgroup_policy_perms.sh
Created June 5, 2020 19:55
cannot list policies when control group is set for read/update operations
#!/bin/bash
set -aex
ps aux | grep "vault server" | grep -v grep | awk '{print $2}' | xargs kill
sleep 2s
tee /tmp/config.hcl <<EOF
storage "inmem" {}
ui = true
listener "tcp" {
address = "127.0.0.1:8200"
@zalary
zalary / plus_policy.sh
Created April 6, 2020 15:19
using a + in a policy path
#!/bin/bash
set -aex
pkill -9 vault || true
sleep 2s
tee /tmp/config.hcl <<EOF
storage "inmem" {}
listener "tcp" {
#!/bin/bash
set -aex
pkill -9 vault || true
sleep 2s
tee /tmp/config.hcl <<EOF
storage "inmem" {}
listener "tcp" {
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"specified_lists":["my_list"],
"key":"test@email.com",
"found":true,
"exists_in_lists":["my_list"]
}
@zalary
zalary / TrustedForm_trigger.html
Created October 1, 2014 22:39
custom trigger TrustedForm script
<!DOCTYPE html>
<html>
<head>
<title>Trigger TF Snapshot</title>
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
// this line sets the value of an input form in the dom when the input is change
@zalary
zalary / keybase.md
Created March 25, 2014 17:03
keybase zalary

Keybase proof

I hereby claim:

  • I am zalary on github.
  • I am zalary (https://keybase.io/zalary) on keybase.
  • I have a public key whose fingerprint is E47F 88AE 27C7 4B21 B453 4871 EB8D 0A6E 246E 5031

To claim this, I am signing this object:

@zalary
zalary / taxi_meter_spec.rb
Last active December 5, 2016 19:53
taxi-meter spec
require './taxi_meter.rb'
require 'pry-debugger'
require 'time'
describe TaxiMeter do
def one_sixth
1.0 / 6.0
end
@zalary
zalary / pinterest-typepad-html
Created May 24, 2012 15:15
pinterest-typepad
<div style='padding: 5px; border: 1px solid grey; line-height: 0px; float: left; margin-right: 5px;'><div style='padding-bottom: 2px;><a href='http://pinterest.com/pin/146930006562784346/' target='_blank'><img src='http://media-cache4.pinterest.com/upload/210684088787536322_nyYj3w1J_c.jpg' border='0' width='495' height ='639'/></a></div><div style='float: left; padding-top: 0px; padding-bottom: 0px;'><p style='font-size: 10px; color: #76838b;'>Source: <a style='text-decoration: underline; font-size: 10px; color: #76838b;' href='http://crushculdesac.tumblr.com/post/8495893352'>crushculdesac.tumblr.com</a> via <a style='text-decoration: underline; font-size: 10px; color: #76838b;' href='http://pinterest.com/maviepetite/' target='_blank'>Colleen</a> on <a style='text-decoration: underline; color: #76838b;' href='http://pinterest.com' target='_blank'>Pinterest</a></p></div> </div> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vestibulum dui et purus feugiat dictum. Nullam varius iaculis nunc eget
@zalary
zalary / zal_debacle_001
Created April 13, 2012 16:54
zal_debacle_001
#!/usr/bin/ruby
require 'rubygems'
require 'csv'
require 'uri'
gem 'curb'
require 'curb'