Skip to content

Instantly share code, notes, and snippets.

#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#include "keymap_german.h"
#include "keymap_nordic.h"
@lrvick
lrvick / decode_punchcard.py
Last active August 11, 2017 08:48
Quick and dirty punch card decoder I wrote for a CTF challenge
#!/bin/python3
import cv2
class PunchCard(object):
def __init__(self, x_offset=131, y_offset=141, y_scale=52, x_scale=153):
self.x_offset = x_offset
self.y_offset = y_offset
self.x_scale = x_scale
self.y_scale = y_scale
@lrvick
lrvick / yubikey-provision-ssh.sh
Created August 3, 2017 22:09
Provision SSH key into Yubikey
#!/bin/bash
# Script to automate the provisioning of a new SSH certificate onto a yubikey device.
set -e
set -u
set -o pipefail
for path in "/usr/lib64/opensc-pkcs11.so" \
"/usr/lib/opensc-pkcs11.so" \
@lrvick
lrvick / WORKSPACE
Last active May 24, 2017 19:57
Non working go project with bazel
git_repository(
name = "io_bazel_rules_go",
remote = "https://github.com/bazelbuild/rules_go.git",
tag = "0.4.4",
)
load(
"@io_bazel_rules_go//go:def.bzl",
"go_repositories",
"new_go_repository",
)
@lrvick
lrvick / federated-hashbang-dns.md
Last active May 13, 2017 09:15
Federated #! hostnames

Problem

  • ISPs and VPS providers hosting donated #! shellboxes won't always have DNS hostnames, or have ones we can automatically discern
  • Machines that -do- have provider-assigned hostnames we can discern like in AWS, are subject to change if a machine is terminated/restored with same disk.
  • Users will discover federated #! shellboxes via some central list
  • Users should always be able to ssh to the same hostname and end up with the same disk/homdir

Solutions

Option 1

@lrvick
lrvick / gpgbrute.sh
Created January 22, 2017 00:27
The script I used to brute force the password for my master GPG key using a wordlist generated via regldg
#!/bin/bash
tmpdir=$(mktemp -d)
export GNUPGHOME="$tmpdir"
echo "allow-loopback-pinentry" >> "$GNUPGHOME/gpg-agent.conf"
echo "pinentry-mode loopback" >> "$GNUPGHOME/gpg.conf"
function cleanup {
rm -rf "$GNUPGHOME"
}
trap cleanup EXIT
@lrvick
lrvick / get_elb_dns.sh
Last active July 21, 2021 09:04
Get DNS of a given ELB via tag on registered asg instance
#!/bin/bash
environment=$1
app_name=$2
tag=$3
asg_name=$(
aws ec2 describe-instances \
--region us-west-2 \
--filters \
"Name=tag:$tag,Values='$app_name-$environment'" \
@lrvick
lrvick / kscow.sh
Last active May 28, 2016 00:19
Cow contemplating the current total pledged value of a given Kickstarter.
#!/bin/bash
api_url='https://www.kickstarter.com/projects/597507018/pebble-2-time-2-and-core-an-entirely-new-3g-ultra/stats.json?v=1'
while sleep 1; do
ks_json=$(curl $api_url -s | gunzip 2> /dev/null )
[ $? -ne 0 ] && continue
old_total=$total
total=$(echo $ks_json | jq -r '.project.pledged')
[[ "$total" == "$old_total" ]] && continue
@lrvick
lrvick / 00-bypass-nginx-proxy.config
Last active April 27, 2016 01:02
Hack to bypass Nginx proxy in a ElasticBeanstalk deployment for UDP applications such as rsyslog
# Place in .ebextensions/00-bypass-nginx-proxy.config at the root of your appkication repository.
files:
"/tmp/setup_iptables.sh":
mode: "000755"
content: |
#!/bin/sh
# remove rules added by us (marked by the "added_by_ebextension" comment), if any
iptables-save | grep -v added_by_ebextension | iptables-restore

Keybase proof

I hereby claim:

  • I am lrvick on github.
  • I am lrvick (https://keybase.io/lrvick) on keybase.
  • I have a public key whose fingerprint is 6B61 ECD7 6088 748C 7059 0D55 E90A 4013 36C8 AAA9

To claim this, I am signing this object: