Skip to content

Instantly share code, notes, and snippets.

View ag14spirit's full-sized avatar

Josh McKenna ag14spirit

View GitHub Profile
@mayneyao
mayneyao / notion2blog.js
Last active June 19, 2025 19:02
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@bryanbraun
bryanbraun / git-branching-diagram.md
Last active July 27, 2025 23:09
Example Git Branching Diagram

Example Git Branching Diagram

You can use this diagram as a template to create your own git branching diagrams. Here's how:

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below): https://gist.githubusercontent.com/bryanbraun/8c93e154a93a08794291df1fcdce6918/raw/bf563eb36c3623bb9e7e1faae349c5da802f9fed/template-data.xml
  4. Customize as needed for your team.

// Column names in sheet.
const EMAIL = 'Email';
const GOOGLE_GROUP = 'Google Group';
const ALLOWED = 'Allowed';
const EMAIL_TEMPLATE_DOC_URL = 'Email template doc URL';
const EMAIL_SUBJECT = 'Email subject';
const EMAIL_STATE = 'Email state';
// These represent whether an email was sent or not for a given row.
const EMAIL_STATE_VALUE = {
  • SC1000 $ is not used specially and should therefore be escaped.
  • SC1001 This \o will be a regular 'o' in this context.
  • SC1003 Want to escape a single quote? echo 'This is how it'\''s done'.
  • SC1004 This backslash+linefeed is literal. Break outside single quotes if you just want to break the line.
  • SC1007 Remove space after = if trying to assign a value (or for empty string, use var='' ... ).
  • SC1008 This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh. Add a 'shell' directive to specify.
  • SC1009 The mentioned parser error was in ...
  • SC1010 Use semicolo
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@f-steff
f-steff / excel formulas.md
Last active August 15, 2025 10:19
Excel formulas to calculate IP values such as Netmask, IP range start, IP range end, Broadcast IP, Number of hosts.

Excel formulas to calculate IP values - Works in Excel and Google Sheet.

Updated 2023-12-11: Hosts calculation updated to support CIDR or 31 and 32.

Prerequisites:

  • A1 contains an IP address, such as 10.0.0.2
  • B1 contains the number of bits in the netmask (CIDR) such as 24

The below formulas then go into C1, D1 etc. to perform the various calculations. Some calculations depends on other calculations.

@imatasic
imatasic / deb11vaultwardenInstall.md
Created February 5, 2023 20:44
Debian 11 Vaultwarden install (no docker)

Vaultwarden Debian 11 Install

This is how I installed the Rust implementation of bitwarden into a Proxmox Debian 11 LXC Container. It should work on any Debian 11 install (virtual or metal). I dislike running docker inside LXC containers for obvious reasons, so this is how I did it.

References

Prepare Base System

$ sudo apt update

Backup Cluster configuration - /etc/pve

TL;DR Backup cluster-wide configuration virtual filesystem in a safe manner, plan for disaster recovery for the case of corrupt database. A situation more common than anticipated.


ORIGINAL POST Backup Cluster configuration - /etc/pve

Why Proxmox VE shreds your SSDs

TL;DR Quantify the idle writes of every single Proxmox node that contribute to premature failure of some SSDs despite their high declared endurance.


ORIGINAL POST Why Proxmox VE shreds your SSDs

Improved SSH with hidden regressions

TL;DR Over 10 years old bug finally got fixed. What changes did it bring and what undocumented regressions to expect? How to check your current install and whether it is affected?


ORIGINAL POST Improved SSH with hidden regressions