Skip to content

Instantly share code, notes, and snippets.

View perry-mitchell's full-sized avatar

Perry Mitchell perry-mitchell

View GitHub Profile
@perry-mitchell
perry-mitchell / buttercup.md
Created March 3, 2025 15:53
Buttercup has come to an end - an explanation and a thank you

The Buttercup project is coming to an end

I've spent a long time debating this decision, but it's one that I need to make, since the project has all but stagnated. You've probably noticed or suspected this, if you've come into contact with any of Buttercup's repositories recently. While many of you have helpfully been reporting issues, there have been few responses (especially from myself) and even fewer PRs addressing them.

I wouldn't call this burn-out, first and foremost.. I honestly feel fine and excited by the prospect of developing OSS even. That being said, I do feel substantial relief at the thought of putting Buttercup onto potentially permanent hiatus. The project is enormous in scope - it would be for a small team of developers, let alone a single dev working full time who lacks both the energy and motivation to support the project. I've tried getting more serious help on board too, though since Sallar (the other co-founder) left it's honestly been just myself holding the fort. It's a passion

@perry-mitchell
perry-mitchell / dell-r720-fan-control.sh
Last active April 18, 2025 12:44
Dell R720 quiet fan control
#!/bin/bash
IDRAC_IP="192.168.0.101"
IDRAC_USER="root"
IDRAC_PASS=$1
if [ -z $IDRAC_PASS ]; then
IDRAC_PASS=$IDRAC_PASSWORD
fi
FANS_1="0x0A" # 10%
const config = {
devtool: false,
entry: path.resolve(__dirname, `source/entry_${entryType}/main_init.js`),
module: {
rules: [
{
test: /\.js$/,
use: "babel-loader"
@perry-mitchell
perry-mitchell / encryption-example.js
Last active February 27, 2022 09:55
Encryption and decryption using AES CBC in NodeJS, with key derivation
const { pbkdf2: deriveKey } = require("pbkdf2");
const crypto = require("crypto");
const DERIVATION_ROUNDS = 200000;
const HMAC_KEY_SIZE = 32;
const PASSWORD_KEY_SIZE = 32;
function pbkdf2(password, salt, rounds, bits) {
return new Promise((resolve, reject) => {
deriveKey(password, salt, rounds, bits / 8, "sha256", (err, key) => {
@perry-mitchell
perry-mitchell / encrypt.js
Last active August 20, 2019 16:38
Encryption (minus derivation) in NodeJS
const crypto = require("crypto");
const DERIVATION_ROUNDS = 200000;
function constantTimeCompare(val1, val2) {
let sentinel;
if (val1.length !== val2.length) {
return false;
}
for (let i = 0; i <= val1.length - 1; i += 1) {
@perry-mitchell
perry-mitchell / ads.txt
Last active August 8, 2019 06:37
RFC: Ads.txt chaining
# Sample publisher ads.txt
somenetwork.com, 1234, DIRECT
another.org, 4455abc, RESELLER
# !include https://managednetwork.com/managed.ads.txt.php?id=123
@perry-mitchell
perry-mitchell / derive.js
Last active August 20, 2019 16:27
Key derivation in NodeJS
const { pbkdf2: deriveKey } = require("pbkdf2");
const HMAC_KEY_SIZE = 32;
const PASSWORD_KEY_SIZE = 32;
function pbkdf2(password, salt, rounds, bits) {
return new Promise((resolve, reject) => {
deriveKey(password, salt, rounds, bits / 8, "sha256", (err, key) => {
if (err) {
return reject(err);
@perry-mitchell
perry-mitchell / log.js
Created May 2, 2019 16:19
Basic styled console.log 2
console.log(
"%cabc%cdef",
"background-color: #000; color: #99F; font-weight: bold; padding: 2px",
"background-color: #99F; color: #000; font-style: italic; padding: 2px"
);
@perry-mitchell
perry-mitchell / log.js
Created May 2, 2019 16:02
Basic styled console.log
console.log(
"%c Excellent ",
[
"background-color: #663dff",
"background-image: linear-gradient(319deg, #663dff 0%, #aa00ff 37%, #cc4499 100%)",
"padding: 8px",
"font-weight: bold",
"color: #FFF",
"font-family: Arial",
"font-size: 28px",
@perry-mitchell
perry-mitchell / component.js
Created April 15, 2019 10:23
Redux browser state sync component
import { applyMiddleware, createStore } from "redux";
import { createSyncMiddleware, syncStore } from "redux-browser-extension-sync";
import rootReducer from "../reducers/index.js";
const syncMiddleware = createSyncMiddleware();
const store = syncStore(createStore(
rootReducer,
applyMiddleware(syncMiddleware)
));