Skip to content

Instantly share code, notes, and snippets.


Ryan Canty onetwopunch

View GitHub Profile
onetwopunch /
Last active Sep 30, 2020
Using Tink for Hybrid Encryption


I've migrated the contents of this Gist to this Medium post for better readability.

module "okta" {
source = "onetwopunch/okta/vault"
version = "<version>"
okta_discovery_url = "<Okta Authorization Server Issuer>"
okta_client_id = "<Okta Vault App Client ID>"
okta_client_secret = "<Okta Vault App Client Secret>"
vault_addr = "https://<Vault Domain>:8200"
okta_bound_audiences = [
onetwopunch / redlock.rb
Last active Oct 16, 2018
Pull alerts from RedLock given a JWT
View redlock.rb
#!/usr/bin/env ruby
require 'httparty'
require 'json'
class Redlock
include HTTParty
base_uri ''
def initiailize(jwt)
onetwopunch / iam-ssh-auth
Created Feb 18, 2018
IAM SSH Authentication for use with AuthorizedKeysCommand
View iam-ssh-auth
#!/usr/bin/env ruby
require 'aws-sdk-iam'
client =
resp = client.list_ssh_public_keys(user_name: ARGV[1], max_items: 1)
pub_key_id = resp.ssh_public_keys.first.ssh_public_key_id
puts client.get_ssh_public_key({
user_name: ARGV[1],
echo "This will wipe the Yubikey and restore to factory settings"
read -p "Are you sure? (y/n)" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
gpg-connect-agent <<EOF
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
View config.php
echo "<script>alert(U 4r3 0wn3d !!);</script>";
echo "Run command: ".htmlspecialchars($_GET['cmd']);
View .vimrc
"External plugins used:
" Pathogen
" NERDTree
" AutoComplPop
" DetectIndent
" L9 for autocomplete
"Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.

Many Time Pad

Let us see what goes wrong when a stream cipher key is used more than once. Below are eleven hex-encoded ciphertexts that are the result of encrypting eleven plaintexts with a stream cipher, all with the same stream cipher key. Your goal is to decrypt the last ciphertext, and submit the secret message within it as solution.

Hint: XOR the ciphertexts together, and consider what happens when a space is XORed with a character in [a-zA-Z].

ciphertext #1:

### Keybase proof
I hereby claim:
* I am onetwopunch on github.
* I am jryancanty ( on keybase.
* I have a public key ASBR6C_i42SrAvGAVoFbdfAonNSS2_HP8dPN0L3W4xKfYQo
To claim this, I am signing this object:
onetwopunch / Sublime Like Vim
Created Nov 22, 2013
I like using Sublime Text but I wanted a quick way to use it from the Terminal in MacOSX. This is how you use Sublime Text in the Terminal just like vim.
View Sublime Like Vim
First, you create a new file: ~/Scripts/
if [ ! -e "$file" ] ; then
touch "$file"
open -a Sublime\ Text\ 2 $file
Since I keep this with my handy scripts in my home directory, I just make it executable to other users with:
You can’t perform that action at this time.