Skip to content

Instantly share code, notes, and snippets.

View jaredallard's full-sized avatar

Jared Allard jaredallard

View GitHub Profile
token, err := conf.Token.Data(ctx)
if err != nil {
log.Error(ctx, "failed to get token", events.NewErrorInfo(err))
}
tokenByt := []byte(token)
tokenLength := int32(len(tokenByt))
// Check the auth token
base.Use(mux.MiddlewareFunc(func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@jaredallard
jaredallard / make.conf
Last active May 27, 2024 15:23
Portage Configuration for an M1 Mac
# vim: set language=bash;
CHOST="aarch64-unknown-linux-gnu"
# Optimization flags.
COMMON_FLAGS="-march=armv8.5-a+fp16+simd+crypto+i8mm -mtune=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
RUSTFLAGS="-C target-cpu=native"
#!/usr/bin/env bash
# Sets up a portage bin host GPG trust. Uses a local key
# and signs the remote key with it to establish trust.
set -eo pipefail
# GPG_DIR is the directory to establish the trust in
GPG_DIR="/etc/portage/gnupg"
# Key information.
KEYFILE="https://gentoo.rgst.io/signing.gpg"
@jaredallard
jaredallard / module-a_helpers.library.tpl
Last active September 28, 2024 04:30
Example of how the new cross-module function calls work
{{- define "HelloWorld" }}
Hello, world!
{{- end }}
# Exports the "define" template above allowing it to be called.
# Must be in a .library.tpl, as we are. Must start w/ capital
# letter.
{{- module.Export "HelloWorld" }}
@jaredallard
jaredallard / rm2-tailscale.sh
Last active March 20, 2025 20:21 — forked from cceckman/rm2-tailscale.sh
Tailscale setup for remarkable
#!/usr/bin/env bash
#
# Original: https://github.com/cceckman/homelab/blob/main/helpers/rm2-tailscale.sh
# I am the original author of this document and release it into the public domain.
# Go wild.
#
# 2025 Modified by @jaredallard to build release versions of Tailscale.
#
# This script enables [Tailscale] on a [reMarkable 2] tablet.
#
@jaredallard
jaredallard / m2-max-make.conf
Last active April 5, 2025 23:08
gentoo.rgst.io binhost make.conf(s)
# vim: set language=bash;
CHOST="aarch64-unknown-linux-gnu"
# Optimization flags.
WARNING_FLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
COMMON_FLAGS="-march=armv8.6-a+fp16+simd+crypto+i8mm -mtune=native -O2 -pipe -flto ${WARNING_FLAGS}"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"