Skip to content

Instantly share code, notes, and snippets.

@bmatthewshea
bmatthewshea / sa-testemail.bash
Last active August 25, 2022 18:33
Spamassassin - Command Line Test Email
#!/bin/bash
def_filename="test.eml"
tmp1="/tmp/emailresults.txt"
tmp2="/tmp/emailresults.log"
usage="
$(basename "$0") [-h] [mailmessage]
Send email through Spamassassin manually and view output
Flags:
@lbrame
lbrame / archtweaks.md
Last active September 1, 2025 06:10
Tweaks I've made to my Arch Linux installation

Arch Linux tweaks

This is a collection of the tweaks and modification I've made to my Arch Linux installation over the months. These may be applicable to other distros, but please check first before doing anything. I also included Arch Wiki references for all the procedures I mentioned. My recommendation is not to blindly follow this gist but to always check with the Arch Linux wiki first. Things move fast and by the time you're reading this my gist may be out of date. Lastly, the golden rule: never execute a command you don't understand.

Installing the KDE Plasma desktop

My current DE of choice is KDE's Plasma. I find it just about perfect.

There are various ways to install it on Arch. The most popular one is to install plasma and plasma-applications, but I don't like doing that because it comes with too many programs I'll never use. I, instead, install the base plasma group, remove the few extra packages that come with it, then I finish off by installing a few KDE apps that don't come with th

@cerebrate
cerebrate / README.md
Last active July 4, 2025 01:28
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

@romkatv
romkatv / Pure style for Powerlevel10k.md
Last active February 9, 2025 16:54
Pure style for Powerlevel10k

Powerlevel10k can generate the same prompt as Pure.

pure

Installation

git clone https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
@calebporzio
calebporzio / error_blade_directive.php
Created March 28, 2019 20:34
A little Blade directive to make working with validation errors a bit nicer.
<?php
// Usage:
// Before
@if ($errors->has('email'))
<span>{{ $errors->first('email') }}</span>
@endif
// After:
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active September 1, 2025 13:33
Conventional Commits Cheatsheet
@zouppen
zouppen / README.md
Last active October 13, 2018 07:44
Tool for checking SSL certificate expiration dates

SSL certificate expiration checker

Useful for Icinga or other alert tool. Checks certificates from service, not file. This detects cases where certificate is renewed but not updated.

Public domain.

HTTPS

@natemccurdy
natemccurdy / containment.pp
Created August 10, 2018 18:11
An example of the containment problem with roles and profiles in Puppet
# A WebServer role that may have a containment problem.
class role::webserver {
include profile::base
include profile::nginx
# We want EVERYTHING in base to come before the nginx profile
# but that is only possible if the base profile "contains" all of its
# included classes.
Class['profile::base']
@natemccurdy
natemccurdy / puppet-query.sh
Last active March 24, 2022 07:19
puppetdb query scripts
#!/bin/bash
#
# This script acts a replacement for the "puppet query" command.
# This uses curl and certificates to mimic the built-in query command that uses RBAC tokens.
#
# Use this script when 'puppet query' won't work because PuppetDB has been hotfixed
# and its RBAC integration is broken.
#
# Run this script from a PuppetDB node or a Compile Master that has PuppetDB on it.
#
@ameistad
ameistad / auth-mutation-resolvers.js
Created April 30, 2018 19:48
Prisma reset password example
const bcrypt = require('bcryptjs')
const jwt = require('jsonwebtoken')
const authMutations = {
async signup (parent, args, ctx, info) {
const { email } = args
const userExists = await ctx.db.exists.User({ email })
if (userExists) {
throw new Error('User already exists')
}