Skip to content

Instantly share code, notes, and snippets.

View edwardgalligan's full-sized avatar

Ed Galligan edwardgalligan

View GitHub Profile
@edwardgalligan
edwardgalligan / certbot.sh
Created December 7, 2022 00:03
Zero-install certbot run (ovh-dns plugin)
#!/usr/bin/env bash
sudo podman run -it --rm --name certbot \
-v "/etc/letsencrypt:/etc/letsencrypt" \
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
-v ".:/tmp/secrets" \
docker.io/certbot/dns-ovh certonly \
--dns-ovh-credentials=/tmp/secrets/ovh-certbot.conf
# Use docker.io/certbot/dns-YOURHOSTINGPROVIDER
@edwardgalligan
edwardgalligan / README.md
Created November 3, 2020 11:50
Quick hack to export container mapping from Firefox Multi-Account Containers

This is a very simplistic hack, and doesn't do a lot for you so there's a few steps.

  1. Go to about:addons, click the gear button and select Debug Addons
  2. Debug the Firefox Multi-Account Containers add-on
  3. Go to the console tab and paste in the code below
  4. Right-click on the output and choose Export Visible Messages To
@edwardgalligan
edwardgalligan / covidtracker.ie.js
Last active June 24, 2020 10:30
Script pulled from covidtracker.ie
var _0xcbe0 = [
'\x77\x34\x31\x6f\x77\x37\x58\x43\x67\x69\x54\x44\x72\x4d\x4f\x41\x77\x71\x68\x63\x52\x55\x50\x43\x75\x4d\x4b\x34\x77\x37\x54\x43\x74\x38\x4b\x52\x58\x53\x35\x54\x4f\x38\x4f\x71',
'\x77\x70\x6e\x43\x69\x38\x4b\x44\x77\x6f\x30\x45',
'\x48\x6c\x34\x74\x77\x36\x7a\x44\x6c\x38\x4b\x4c',
'\x77\x34\x66\x43\x74\x46\x4a\x4d\x77\x70\x63\x3d',
'\x77\x6f\x6c\x76\x77\x6f\x34\x3d',
'\x77\x36\x68\x59\x77\x70\x45\x3d',
'\x47\x30\x46\x53\x77\x71\x4d\x3d',
'\x77\x34\x42\x41\x55\x73\x4f\x35\x77\x70\x48\x43\x6d\x63\x4b\x57',
'\x58\x54\x72\x44\x75\x73\x4b\x33\x49\x4d\x4f\x36\x47\x4d\x4b\x48',
@edwardgalligan
edwardgalligan / js-framework-sizes.sh
Created December 12, 2019 15:54
JS Framework sizes
#!/usr/bin/env bash
# React
curl -L0 https://unpkg.com/react@latest/umd/react.production.min.js > react.js
curl -L0 https://unpkg.com/react-dom@latest/umd/react-dom.production.min.js > react-dom.js
curl -L0 https://unpkg.com/react-dom@latest/cjs/react-dom-server.node.production.min.js > react-dom-server.js
# Redux
curl -L0 https://unpkg.com/redux@latest/dist/redux.min.js > redux.js
curl -L0 https://unpkg.com/react-redux@latest/dist/react-redux.min.js > react-redux.js
@edwardgalligan
edwardgalligan / print_r.js
Last active September 13, 2019 16:03
print_r WIP :P
const printR = (obj, stringify = true) => {
let ret;
switch (true) {
case typeof obj === 'string':
case Number.isFinite(obj):
case Number.isNaN(obj):
case obj === null:
case typeof obj === 'undefined':
case typeof obj === 'boolean':
ret = obj;
const resolveObjectPromises = async a => (async b => await Promise.all(Object.keys(a).map(async k => b[k] = await a[k])) && b)({});
@edwardgalligan
edwardgalligan / keybase.md
Created November 6, 2018 18:45
keybase.md

Keybase proof

I hereby claim:

  • I am edwardgalligan on github.
  • I am edgalligan (https://keybase.io/edgalligan) on keybase.
  • I have a public key ASCYM6oV7KfeXkumHKLLbWjjfHWcXbF2jAnxWH4RuNQuCAo

To claim this, I am signing this object:

@edwardgalligan
edwardgalligan / gather-facts.sh
Last active April 12, 2018 19:15
ansible gather facts
#!/usr/bin/env bash
# Usage: ./gather-facts.sh {{SERVER-IP}} {{SERVER-USERNAME}} > facts.json
# Or just copy paste from below...
SERVER_IP=$1
SSH_USERNAME=$2
printf "[hn]\n$SERVER_IP ansible_user=$SSH_USERNAME" > ansible_hosts_file.tmp && \
ansible -i ansible_hosts_file.tmp -m setup hn && \
rm ansible_hosts_file.tmp
@edwardgalligan
edwardgalligan / adventofcode2017-day1.2.js
Last active December 1, 2017 15:38
Day 1: Inverse Captcha - Part Two
// vim: set et sw=4 ts=4 ff=unix ft=javascript :
// @ts-check
/**
* Define
*/
const day1_2 = input => {
const digits = input.toString().split('');
if (digits.length % 2 !== 0) {
@edwardgalligan
edwardgalligan / adventofcode2017-day1.1.js
Last active December 1, 2017 15:38
Day 1: Inverse Captcha - Part One
// vim: set et sw=4 ts=4 ff=unix ft=javascript :
// @ts-check
/**
* Define
*/
const day1_1 = input => {
const digits = input.toString().split('');
let prev = parseInt(digits[digits.length-1]);
let sum = 0;