Skip to content

Instantly share code, notes, and snippets.

View ryancurrah's full-sized avatar

Ryan Currah ryancurrah

  • Toronto, Ontario
View GitHub Profile
@ryancurrah
ryancurrah / ssh-agent.sh
Last active August 21, 2023 19:31
ssh-agent
#!/bin/zsh
# Check for a currently running instance of ssh-agent
RUNNING_AGENT="$(ps -ax | grep 'ssh-agent' | grep -v grep | wc -l | tr -d '[:space:]')"
if [ "${RUNNING_AGENT}" = "0" ]; then
# Launch a new instance of ssh-agent
eval "$(ssh-agent)"
else
# Connect to the existing ssh-agent instance
export SSH_AUTH_SOCK="$(find /var/folders/*/*/*/ssh-* -name 'agent.*' -user "$(whoami)" 2> /dev/null | head -n 1)"
@ryancurrah
ryancurrah / k8s.yml
Created February 11, 2021 21:28
MetalLB and Nginx Ingress Example
---
apiVersion: v1
kind: Service
metadata:
name: ingress
namespace: ingress
spec:
selector:
name: nginx-ingress-microk8s
type: LoadBalancer
@ryancurrah
ryancurrah / Jenkinsfile
Last active April 6, 2020 23:42
shouldSkipBuild.groovy
// Check if we can skip the build if only boilerplate files have changed
skipBuild = shouldSkipBuild(['README.md', 'CHANGELOG.md', '.gitignore'])
@ryancurrah
ryancurrah / 503.html
Last active March 20, 2020 17:22
503.html
<!doctype html>
<title>Site Maintenance</title>
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gOTAK/9sAQwADAgIDAgIDAwMDBAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgWFBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8AAEQgBugJOAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A8Booor9zPzQKKKKADO3pS+dJ/ef/AL6
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<PersistAllDeviceInstalls>false</PersistAllDeviceInstalls>
<DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices>
</component>
@ryancurrah
ryancurrah / rundeck.cfg
Created November 10, 2017 20:23
Rundeck Pro HAPROXY Example
#############
## BACKEND ##
#############
backend www-rundeck
mode http
balance roundrobin
option httpchk get /api/14/system/info?authtoken=loadbalancer
http-check expect status 200
cookie JSESSIONID prefix nocache
server rundeck-a rnd01.vagrant.test:4440 check cookie rnda
@ryancurrah
ryancurrah / qip_provision_ip.py
Last active November 30, 2021 07:04
Allocate an IP Address using VitalQIP SOAP API
#!/usr/bin/env python
import argparse
import re
import uuid
import sys
from xml.dom import minidom
from xml.parsers.expat import ExpatError
try:
@ryancurrah
ryancurrah / keybase.md
Last active July 14, 2016 23:36
keybase.md

Keybase proof

I hereby claim:

  • I am ryancurrah on github.
  • I am rcurrah (https://keybase.io/rcurrah) on keybase.
  • I have a public key whose fingerprint is 24DC 44B2 89F9 A289 C6D5 81AB 0742 9ACA A803 887D

To claim this, I am signing this object:

@ryancurrah
ryancurrah / vault_module.py
Created December 18, 2015 01:25
SaltStack Module and Renderer for HashiCorp Vault
# -*- coding: utf-8 -*-
'''
Execution module to work with HashiCorp's Vault
:depends: - python-requests
In order to use an this module, a profile must be created in the master
configuration file:
Token example:
@ryancurrah
ryancurrah / tcp_returner.py
Created December 10, 2015 05:15
SaltStack State Event TCP Returner Module
# -*- coding: utf-8 -*-
'''
Returns state event data for state.sls and state.highstate execution only using a tcp socket, this method of
returning data can be used for Splunk or ELK.
Each event sent represents a single state executed.
It is strongly recommended to use the ``event_return_whitelist`` so not all
events call this returner, for example: