Skip to content

Instantly share code, notes, and snippets.

Patrick Cable patcable

Block or report user

Report or block patcable

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
patcable / deploy.yml
Created Dec 16, 2019
Lambda CI assume-role and deploy
View deploy.yml
- aws s3 cp s3://bucket/ --acl bucket-owner-full-control --region us-east-1
- DEPLOY_DEV_CREDS=$(aws sts assume-role --role-arn arn:aws:iam::ACCOUNT:role/lambda-deploy --role-session-name LambdaDeployer --duration-seconds 900 --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output json)
- export AWS_ACCESS_KEY_ID=$(echo -n $DEPLOY_DEV_CREDS | jq .[0] | tr -d \" | tr -d "\n")
- export AWS_SECRET_ACCESS_KEY=$(echo -n $DEPLOY_DEV_CREDS | jq .[1] | tr -d \" | tr -d "\n")
- export AWS_SESSION_TOKEN=$(echo -n $DEPLOY_DEV_CREDS | jq .[2] | tr -d \" | tr -d "\n")
- aws lambda update-function-code --region us-east-1 --function-name code --s3-bucket bucket --s3-key
patcable /
Last active Jul 7, 2018
CloudKey Update Certificates
# renew a TLS cert and configure unifi cloudkey using Cloudflare
# DNS verification for ACME
# To use this script, make sure you have lego (
# on the machine. You'll need to do the first run on your own so you can agree
# to TOS and such.
# CLOUDFLARE_EMAIL: Email address for your cloudflare account
View 001_left-ipsec.conf
config setup
conn %default
View count_submission_length.rb
#!/usr/bin/env ruby
require 'httparty'
apikey = ENV['SM_API_KEY']
if apikey.nil?
puts "Need to set $SM_API_KEY - see https://<your_submission_site>"
exit 1
patcable / org.homebrew.ssh-agent-logging.plist
Last active Mar 30, 2017
homebrew ssh-agent w/ opensc
View org.homebrew.ssh-agent-logging.plist
<!-- this is the plist with stdout/stderr logging enabled if you need it.
scroll down for the one without it. also remove this when you
copy and paste -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">
patcable /
Last active Dec 1, 2016
graylog2 editing permissions

Editing permissions w/ Graylog

  • Goal: let devs create streams and search.
  • How: Post permissions to REST API

Useful tool: API browser. https://<grayloghost>/api/api-browser Can also CURL as well...

curl -v -XPUT -u ADMIN:PASSWORD -H 'Content-Type: application/json' '' -d 'collapsed_json_here'
View gist:9443750
### Keybase proof
I hereby claim:
* I am patcable on github.
* I am patcable ( on keybase.
* I have a public key whose fingerprint is E927 DB61 4373 8AC2 CED8 6970 9643 FED3 0A2D A57A
To claim this, I am signing this object:
You can’t perform that action at this time.