Skip to content

Instantly share code, notes, and snippets.

View gregalia's full-sized avatar

Greg Sheppard gregalia

  • FireTail.io
  • Helsinki, Finland
View GitHub Profile
@gregalia
gregalia / code-snippets.md
Created April 24, 2024 21:12
Code Snippets

‎‎​

@gregalia
gregalia / lint_fmt_gha_shell_blocks.sh
Last active July 24, 2023 09:39
Lint and format GitHub Actions run blocks
#!/bin/bash
WORK_DIR="${PWD}/.ignore/run_blocks"
function export_run_blocks() {
mkdir -p "${WORK_DIR}"
yaml_file="${1}"
num_runs="$(
yq '[
.jobs | .. |
@gregalia
gregalia / main.js
Created March 8, 2022 00:51
Node Cert Check
'use strict';
const tls = require('tls');
// HT: https://medium.com/@keithwan.programming/doing-ssl-certificate-expiry-alert-in-node-js-1714ef15621
const HOSTNAME = 'amazon.com';
const EXPIRATION_DAYS_THRESHOLD = 60;
function checkCertExpiry({ cert, days }) {
@gregalia
gregalia / staggered_rollout_number
Created February 5, 2021 17:45
Jamf Pro extension attribute for creating arbitrary groups of arbitrary size
#!/bin/bash
####################################################################
# \\\/// #
# / _ _ \ #
# (| (.)(.) |) #
# .-----------------------.OOOo--()--oOOO.-----------------------. #
# | | #
# | Test whether the machine has assigned itself a random number | #
# | for rolling out policies in staggered groups and assign one | #

Keybase proof

I hereby claim:

  • I am thegoodsheppard on github.
  • I am thegoodsheppard (https://keybase.io/thegoodsheppard) on keybase.
  • I have a public key ASBul9257xIZWdk-pcOHjI4dfYXojm_237UgUciy68lK3go

To claim this, I am signing this object: