Skip to content

Instantly share code, notes, and snippets.

View xer0x's full-sized avatar

Drew Miller xer0x

  • SLUG/LAB
  • Vancouver
View GitHub Profile
@jglien
jglien / config.lua
Last active February 7, 2024 22:44
My LunarVim Config
-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
-- tip: have ripgrep installed for telescope
-- note: LunarVim has language support built-in, don't use COC
lvim.plugins = {
-- Appearance
@Phate6660
Phate6660 / rust recommendations and alternatives.md
Last active September 1, 2023 16:49
My growing list of Rust programs to use.
@Deborah-Digges
Deborah-Digges / README.md
Last active August 11, 2020 18:46
Send logs to Splunk

Hacky script to send a bunch of logs to splunk directly

Currently, we don't have a tool that can send

  • a specific set of logs
  • with the right shape
  • to a tenant
  • in any environment

We have a bunch of separate tools that do different parts of this. We need a way to consolidate this functionality into fox-cli.

@ottokruse
ottokruse / aws-console
Last active March 14, 2024 10:36
Python script to launch the AWS console in your webbrowser, using a presigned URL generated from your AWS CLI credentials
#!/usr/bin/env python3
"""
Usage:
- Save this script somewhere on your path (e.g. `vi /usr/local/bin/aws-console && chmod +x /usr/local/bin/aws-console`)
- Make AWS credentials available in one of the usual places where boto3 can find them (~/.aws/credentials, env var, etc.)
- Excute the script: `aws-console --profile myprofile`
- :tada: Your browser opens and you are signed in into the AWS console
"""
@marc-barry
marc-barry / handler.js
Created June 30, 2020 18:29
Cloudflare Worker for Auth0 Self-Managed Certificates
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const url = new URL(request.url)
url.hostname = 'SOME_HOSTNAME' // i.e. 'dev-w-47n-vy-cd-e88kLg26GFbLGgBI.edge.tenants.auth0.com'
request = new Request(request)
request.headers.set('cname-api-key', 'SOME_KEY') // i.e. 'd4f2f3ef5a3ee3af4846127281d3450628bdc16d63e802dea75878fe9a63a279'

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@stefanjudis
stefanjudis / console.js
Last active July 31, 2019 17:09
Suprising replacement patterns in String.prototype.replace
const msg = 'This is a great message';
msg.replace('great', 'wonderful');
// "This is a wonderful message"
//
// -> 'great' is replaced by 'wonderful'
msg.replace('great', '$&-$&');
// "This is a great-great message"
// '$&' represents the matched substring
@johncantrell97
johncantrell97 / satoshistreasure.md
Last active April 15, 2023 15:09
How I Obtained Satoshi's Treasure Keys 1, 2, and 3 in Minutes

Today (April 16th 2019 at noon) the first major clues to discover key #1 was set to be released in a few cities. A QR code with the words 'orbital' were found at these locations and looked like this: (https://imgur.com/a/6rNmz7T). If you read the QR code with your phone you will be directed to this url: https://satoshistreasure.xyz/k1

At this URL you are prompted to input a passphrase to decrypt the first shard. An obvious first guess was to try the word 'orbital' from the QR code. Not suprisingly this worked! This reveals a congratulations page and presents the first key shard:

ST-0001-a36e904f9431ff6b18079881a20af2b3403b86b4a6bace5f3a6a47e945b95cce937c415bedaad6c86bb86b59f0b1d137442537a8.

Now, we were supposed to wait until April 17th to get clues from the other cities for keys #2 and #3 but that wouldn't stop me from digging around with all the new information we had. All that time "playing" notpron (http://notpron.org/notpron/) years ago was going to help me here.

The first thing I noticed was

@munificent
munificent / generate.c
Last active March 18, 2024 08:31
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u