Skip to content

Instantly share code, notes, and snippets.

@w3irdrobot
w3irdrobot / lnd_double_hop.patch
Created March 27, 2022 15:39
LND Test Extra Hop
From 40fc90640aeef70790012f19054199190294447b Mon Sep 17 00:00:00 2001
From: Alex Sears <me@alexsears.com>
Date: Sun, 27 Mar 2022 11:36:30 -0400
Subject: [PATCH] Add extra hop to single hop invoice test
---
lntest/harness.go | 29 +++++--
lntest/itest/lnd_single_hop_invoice_test.go | 84 ++++++++++++++++++++-
lntest/itest/lnd_test.go | 19 ++++-
3 files changed, 121 insertions(+), 11 deletions(-)
@w3irdrobot
w3irdrobot / create_kubernetes_user.sh
Created February 28, 2022 19:35
Create User in Kubernetes and output usable kubeconfig
#!/usr/bin/env bash
set -euo pipefail
# make sure username is passed as argument
if [[ "$#" -ne 1 ]]; then
echo "not enough arguments"
echo "Usage: create_kubernetes_user.sh USERNAME"
exit 1
fi
@w3irdrobot
w3irdrobot / download_monero_binaries.sh
Last active January 1, 2021 21:42 — forked from sethforprivacy/download_monero_binaries.sh
Bash script that downloads and verifies the latest Linux x64/x86 binaries.
#!/bin/bash
# Download fluffypony's GPG key
wget -q -O binaryfate.asc https://raw.githubusercontent.com/monero-project/monero/master/utils/gpg_keys/binaryfate.asc
# Verify fluffypony's GPG key
echo "1. Verify binaryfate's GPG key: "
gpg --keyid-format long --with-fingerprint binaryfate.asc
# Prompt user to confirm the key matches that posted on https://src.getmonero.org/resources/user-guides/verification-allos-advanced.html
echo
@w3irdrobot
w3irdrobot / query.js
Created September 22, 2019 01:34
Get last in Mongo collection and return partial object
db.getCollection('collectionName').find().sort({"$natural": -1}).limit(1).map(function(doc) {
var obj = {}
obj["_id"] = doc._id
obj["another_field"] = doc.another_field
return obj
})[0]
@w3irdrobot
w3irdrobot / bumpme
Last active November 16, 2018 21:02
Fri Nov 16 21:02:04 UTC 2018

Keybase proof

I hereby claim:

  • I am searsaw on github.
  • I am searsaw (https://keybase.io/searsaw) on keybase.
  • I have a public key ASAzDr14E_3O8kFKfIN3RRg8GjKq-3ocwZ10Mo7HWYbkEgo

To claim this, I am signing this object:

@w3irdrobot
w3irdrobot / kinesis.py
Last active February 4, 2022 15:02
Reading Data From Kinesis
from datetime import datetime, timedelta
import json
import boto
def get_kinesis_data_iterator(stream_name, minutes_running):
# Connect to Kinesis
kinesis = boto.connect_kinesis()
# Get data about Kinesis stream for Tag Monitor
kinesis_stream = kinesis.describe_stream(stream_name)
@w3irdrobot
w3irdrobot / authorization_helper.rb
Created August 13, 2014 02:20
Persisting Guest Users in Rails with Devise
module AuthorizationHelper
# if user is logged in, return current_user, else return guest_user
def current_or_guest_user
if current_user
if cookies.signed[:guest_user_email]
logging_in
guest_user.delete
cookies.delete :guest_user_email
end