Skip to content

Instantly share code, notes, and snippets.

View nicjansma's full-sized avatar

Nic Jansma nicjansma

View GitHub Profile
@yorickdowne
yorickdowne / tremor.md
Last active August 22, 2025 09:05
Stabilize an Asus or Intel NUC for 24/7 server operations

The issue

Asus (formerly Intel) NUCs weren't designed for use as a 24/7 server, though they see enthusiastic use as such. Some users report instability. And while some of that can be bad RAM or a faulty motherboard / CPU, some can also just be configuration issues. And some is plain heat.

It's a little tough to nail it down. Here are some good practices to follow, to have a stable NUC.

BIOS update

@nolanlawson
nolanlawson / scaling_mastodon_down.md
Last active June 27, 2025 11:05
Scaling Mastodon down

Scaling Mastodon down

There is already a guide on scaling your Mastodon server up. This is a short guide on scaling your Mastodon server down.

I.e., maybe you want to run a small instance of <100 active users, and you want to keep your cloud costs reasonable. So you might be running everything on a single machine, with limited memory and CPU. (In my case, I was using a t3.medium instance with 2 vCPUs and 4GB of RAM.) How do you do this?

Note that I'm not a Ruby or Sidekiq expert, and most of this stuff I figured out through trial and error.

@simonhearne
simonhearne / mPulse_postman.json
Created February 20, 2020 14:46
A Postman collection for interacting with mPulse APIs
{
"info": {
"_postman_id": "7eaf462d-6713-446d-9872-0c5ecef206d8",
"name": "mPulse",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Annotations",
"item": [
#!/bin/bash
curl -L -O https://downloads.redisinsight.redislabs.com/latest/redisinsight-linux64
chmod +x redisinsight-linux64
./redisinsight-linux64
@mergwyn
mergwyn / zfsbench
Last active September 26, 2025 18:25
ZFS benchmarking using fio
#!/usr/bin/env bash
set -o errexit
echo $(date):Random read
fio --filename=test --sync=1 --rw=randread --bs=4k --numjobs=1 \
--iodepth=4 --group_reporting --name=test --filesize=10G --runtime=300 && rm test
echo $(date):Random write
fio --filename=test --sync=1 --rw=randwrite --bs=4k --numjobs=1 \
@ferenczy
ferenczy / atom-get-lost-unsaved-buffers.js
Last active May 29, 2024 21:09
Get lost unsaved buffers in Atom editor: Load text content of all unsaved buffers stored by Atom for any project and print it to Developers tools console
/**
* Get lost unsaved buffers in Atom editor
*
* Load text content of all unsaved buffers stored by Atom for any project in IndexedDB and print it to Developers tools console
*
* Author: David Ferenczy Rogožan (https://ferenczy.cz)
*
* Instructions:
*
* 1. Start Atom
@bradwestfall
bradwestfall / HoC-vs-RenderProps-vs-Hooks.md
Last active September 10, 2025 20:18
An explanation of why Hooks are a nicer way to abstract re-useable state and functionality vs HoC's and Render Props

HoC (pattern) vs Render Props (pattern) vs Hooks (not pattern, a new API)

Someone was asking me about comparing the HoC and Render Props patterns (and their shortcomings) to hooks. I might leave this up as a public gist for others if it's helpful.


tldr;

Issues with HoC:

@querymetrics
querymetrics / loader-onload.js
Last active November 14, 2017 22:54
mPulse Loader snippet that delays Boomerang loading until onLoad has occurred
<script>
(function(){
if (window.BOOMR && window.BOOMR.version) { return; }
var win = window;
function boomerangSaveLoadTime(e) {
win.BOOMR_onload=(e && e.timeStamp) || new Date().getTime();
}
function boomerangLoad() {
@troyfontaine
troyfontaine / 1-setup.md
Last active December 1, 2025 15:11
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@porjo
porjo / dump_route53_records.md
Last active February 12, 2025 02:08
Export route53 records to CSV

Retrieve hosted zones with aws route53 list-hosted-zones then enter the zone Id below:

aws route53 list-resource-record-sets --hosted-zone-id "/hostedzone/xxxxxxxxxxx" | \
   jq -r '.ResourceRecordSets[] | [.Name, .Type, (.ResourceRecords[]? | .Value), .AliasTarget.DNSName?]  | @tsv'