Skip to content

Instantly share code, notes, and snippets.

View flotwig's full-sized avatar

Zach Bloomquist flotwig

View GitHub Profile
@flotwig
flotwig / gen.sh
Last active October 5, 2023 08:33
Generate a Chrome extension ID with a desired prefix
#!/bin/bash
# https://stackoverflow.com/a/23877974/3474615
while [[ $EXT_PREFIX != "ioio" ]] # change 'ioio' to your desired prefix (can only use lowercase a-p)
do
rm key.pem manifest_key.txt extension_id.txt
2>/dev/null openssl genrsa 2048 | openssl pkcs8 -topk8 -nocrypt -out key.pem
2>/dev/null openssl rsa -in key.pem -pubout -outform DER | openssl base64 -A > manifest_key.txt
[2023-04-02T16:13:32-04:00] [2023-04-02T16:18:32-04:00]
[2023-04-01T23:57:36-04:00] [2023-04-02T01:39:11-04:00]
[2023-04-01T23:30:06-04:00] [2023-04-01T23:45:06-04:00]
[2023-04-01T20:03:54-04:00] [2023-04-01T22:34:38-04:00]
[2023-03-30T12:45:23-04:00] [2023-03-30T13:52:35-04:00]
[2023-03-30T12:39:11-04:00] [2023-03-30T12:44:53-04:00]
[2023-03-29T12:14:51-04:00] [2023-03-29T12:19:51-04:00]
[2023-03-28T12:36:13-04:00] [2023-03-28T13:44:10-04:00]
[2023-03-28T02:56:59-04:00] [2023-03-28T03:03:36-04:00]
[2023-03-28T02:49:11-04:00] [2023-03-28T02:54:11-04:00]
@flotwig
flotwig / gh-comments.user.js
Created April 20, 2022 17:47
recursively load github comments userscript
// ==UserScript==
// @name recursively load github comment threads
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author https://github.com/refined-github/refined-github/issues/1892#issuecomment-1044913449
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==
@flotwig
flotwig / internet-wg0.conf
Last active November 21, 2021 11:01
WireGuard configuration
[Interface]
# Configuration for the server
# Set the IP subnet that will be used for the WireGuard network.
# 10.222.0.1 - 10.222.0.255 is a memorable preset that is unlikely to conflict.
Address = 10.222.0.1/24
# The port that will be used to listen to connections. 51820 is the default.
ListenPort = 51820
@flotwig
flotwig / gist:b62010eb5d1ee98f938b4f1e4892bc87
Created August 17, 2021 16:31
electron 13.17.1 sigsegv
Process: Cypress [729]
Path: /Users/USER/Library/Caches/*/Cypress.app/Contents/MacOS/Cypress
Identifier: com.electron.cypress
Version: 8.3.0 (8.3.0.848520)
Code Type: X86-64 (Native)
Parent Process: ??? [724]
Responsible: Terminal [379]
User ID: 501
Date/Time: 2021-08-17 09:22:42.346 -0700
@flotwig
flotwig / check.php
Last active July 1, 2021 13:54
Minecraft Server List Properties Example A concise, over-commented, efficiently-coded example for pinging a Minecraft server and retrieving its status. No error checking.
<?php
function pingMCServer($server,$port=25565,$timeout=2){
$socket=socket_create(AF_INET,SOCK_STREAM,getprotobyname('tcp')); // set up socket holder
socket_connect($socket,$server,$port); // connect to minecraft server on port 25565
socket_send($socket,chr(254).chr(1),2,null); // send 0xFE 01 -- tells the server we want pinglist info
socket_recv($socket,$buf,3,null); // first 3 bytes indicate the len of the reply. not necessary but i'm not one for hacky socket read loops
$buf=substr($buf,1,2); // always pads it with 0xFF to indicate an EOF message
$len=unpack('n',$buf); // gives us 1/2 the length of the reply
socket_recv($socket,$buf,$len[1]*2,null); // read $len*2 bytes and hang u[
$data=explode(chr(0).chr(0),$buf); // explode on nul-dubs
@flotwig
flotwig / why-snoonet.md
Last active July 28, 2020 16:39
Why should I use Snoonet over a network like Freenode or EFNet?
  • Snoonet is a network run by redditors, for redditors.
  • Thousands of redditors are already on Snoonet every day. Hundreds of subreddits are here as well. It's a centralized hub for redditors.
  • We can provide better security and support, because we focus primarily on reddit users and reddit communities.
  • Channel bots created specifically for redditors.
    • rAnnouncer - automatically posts to the IRC channel when there is a new message in the subreddit
    • RedditBot - allows users to view information about subreddits from IRC - karma, subscribers, mods
    • AutoFalc0n - community-accessible CloudBot, provides Googling, link announcement, and most common bot functions
    • memebot - provides a way to quickly create meme pictures - http://i.imgur.com/GYNG7cK.jpg
  • Priority enforced for reddit nicks and channels - no longer have to use a "#reddit-subredditname" channel format, simply "#subredditname" will do. Also, if you own the username on reddit, you will be able to use it with NickServ on Snoone
@flotwig
flotwig / pki.js
Last active June 18, 2019 18:47
node.js client certificate experiments
const assert = require('assert')
const Bluebird = require('bluebird')
const certyCb = require('certy')
const https = require('https')
const rp = require('request-promise')
const certy = Bluebird.promisifyAll(certyCb)
certy.createAsync()
.then((certs) => {
  • Bugs:
    • #76 - Node has a constant header size limit of 80kb
  • Serve dynamic HTTP/1.1 content on any http[s]://host:port/path combination
    • can serve pre-configured static responses to regex or glob urls
type GlobPattern = string
type StringMatcher = GlobPattern | RegEx
type StringDictMatcher = { [key: string]: StringMatcher }
type NumberMatcher = number | number[] // list of acceptable numbers