Skip to content

Instantly share code, notes, and snippets.

View jakejarvis's full-sized avatar

Jake Jarvis jakejarvis

View GitHub Profile
@kevinoconnor7
kevinoconnor7 / authelia.sh
Last active March 17, 2024 15:09
Home Assistant Command Line Authentication for Authelia
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
## BEGIN CONFIGURATION SECTION ##
# The domain/path of your authelia service. For example:
# - sso.example.com
# - example.com/auth
# - example.com:8443
@x43x61x69
x43x61x69 / vnc_install.sh
Last active April 29, 2024 05:04
Steam Deck VNC Installation
#!/bin/bash
#
# Script for installing x11vnc on Steam Deck.
#
# Install:
#
# sh -c "$(curl -fsSL https://gist.githubusercontent.com/x43x61x69/9a5a231a25426e8a2cc0f7c24cfdaed9/raw/vnc_install.sh?$RANDOM)"
#
# This will modify root filesystem so it will probably get
# overwrite on system updates but is totally ok executing
@nolanlawson
nolanlawson / scaling_mastodon_down.md
Last active May 4, 2024 01:48
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.

@metasikander
metasikander / NIP-05_Simple_Guide.md
Last active February 13, 2024 20:09
A small minimal guide on setting up NIP-05 identifier on branle/nostr

This is a very basic guide, just to understand what's needed to set it up.
If you have any questions you can find me at https://nostr.com/8355095016fddbe31fcf1453b26f613553e9758cf2263e190eac8fd96a3d3de9

Prerequisite

Setup static file on server

Create a file that resolves to <domain>/.well-known/nostr.json, and fill it out like this (enter the name you want to use, and input your own public key, make sure its the HEX-key):

{
@ovcharik
ovcharik / input-keysym.d.ts
Last active June 17, 2022 10:19
@novnc/novnc 1.3.0 declarations
declare module '@novnc/novnc/core/input/keysym' {
export default {
XK_VoidSymbol: 0xffffff, /* Void symbol */
XK_BackSpace: 0xff08, /* Back space, back char */
XK_Tab: 0xff09,
XK_Linefeed: 0xff0a, /* Linefeed, LF */
XK_Clear: 0xff0b,
XK_Return: 0xff0d, /* Return, enter */
XK_Pause: 0xff13, /* Pause, hold */
@dgalli1
dgalli1 / authelia-config.yml
Last active May 10, 2024 06:10
Authelia + OpenLDAP + Ldap User Manager
ldap:
## The LDAP implementation, this affects elements like the attribute utilised for resetting a password.
## Acceptable options are as follows:
## - 'activedirectory' - For Microsoft Active Directory.
## - 'custom' - For custom specifications of attributes and filters.
## This currently defaults to 'custom' to maintain existing behaviour.
##
## Depending on the option here certain other values in this section have a default value, notably all of the
## attribute mappings have a default value that this config overrides, you can read more about these default values
## at https://www.authelia.com/docs/configuration/authentication/ldap.html#defaults
@sindresorhus
sindresorhus / esm-package.md
Last active May 24, 2024 02:36
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@justinhartman
justinhartman / 01_nginx-reload-post-hook.sh
Last active April 30, 2024 17:18
Let's Encrypt Certbot post hook command for Nginx which checks the updated configuration files and reloads the server if everything validates.
#!/usr/bin/env bash
#
# Certbot Nginx Reload
#
# Let's Encrypt Certbot post hook command for Nginx which checks the updated
# configuration files and reloads the server if everything validates.
#
# Author : Justin Hartman <code@justinhartman.co>
# Version : 1.0.1
# License : MIT <https://opensource.org/licenses/MIT>
@JeffMatsonPagely
JeffMatsonPagely / accessibility_contrast_example.scss
Created January 21, 2021 00:11
Styles from the new White House WordPress site
%a-link-hover {
transition: 0.2s ease;
&:hover,
&:focus {
color: v.$text-link-hover-color;
border-bottom: 1px solid rgba(v.$text-link-hover-color, 0.8);
}
.accessibility__contrast & {
&:hover,
&:focus {
@cutiful
cutiful / mastodon-ip.md
Last active March 21, 2024 04:00
Detecting the real IP of a Cloudflare'd Mastodon instance

Detecting the real IP of a Cloudflare'd Mastodon instance

NB: This will not work for instances that proxy outgoing requests!

Reading the docs

I wanted to find a way to detect the real IP address of a Mastodon/Pleroma/Misskey/etc instance hosted behind Cloudflare. How to do that? Well, it's federated, which means I can probably get it to send a request to a server of mine! And how to do that? I tried reading the ActivityPub spec. The following caught my attention:

Servers should not trust client submitted content, and federated servers also should not trust content received from a server other than the content's origin without some form of verification.