Skip to content

Instantly share code, notes, and snippets.

@patcable
patcable / make-vpnkit.sh
Last active October 13, 2021 21:41
vpnkit w/ yubikey tools and opensc
#!/bin/bash
#########################################################
# Configuration
#########################################################
# PKG_NAME is the actual name of the package "NAME-x.y.z.pkg"
PKG_NAME=vpnkit
# PKG_VERSION is the x.y.z above.
PKG_VERSION=1.2.3
@patcable
patcable / inviter.go
Last active March 13, 2020 22:00
Slack: Invite people in channel A to channel B
package main
import (
"fmt"
"os"
"github.com/slack-go/slack"
)
func main() {
@patcable
patcable / certupdate.sh
Last active July 7, 2018 23:15
CloudKey Update Certificates
#!/bin/bash
#
# certupdate.sh: renew a TLS cert and configure unifi cloudkey using Cloudflare
# DNS verification for ACME
#
# To use this script, make sure you have lego (https://github.com/xenolf/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
@patcable
patcable / count_submission_length.rb
Created April 27, 2017 02:51
Submittable API Demo
#!/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>.submittable.com/settings/api"
exit 1
end
### API SETTINGS
@patcable
patcable / org.homebrew.ssh-agent-logging.plist
Last active March 30, 2017 20:58
homebrew ssh-agent w/ opensc
<!-- 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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.homebrew.ssh-agent</string>
<key>ProgramArguments</key>
@patcable
patcable / 000_readme.md
Last active December 1, 2016 18:21
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' 'http://graylog.example.org:9000/api/roles/rolename' -d 'collapsed_json_here'
### Keybase proof
I hereby claim:
* I am patcable on github.
* I am patcable (https://keybase.io/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: