Skip to content

Instantly share code, notes, and snippets.

View jaredallard's full-sized avatar
:shipit:

Jared Allard jaredallard

:shipit:
View GitHub Profile
@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}"
@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 / 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" }}
#!/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 / 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"
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 / Dockerfile
Last active February 27, 2022 22:00
Balena IoT Project Blog Post
# syntax=docker/dockerfile:1.0-experimental
FROM golang:1.17-alpine AS build
ARG VERSION
ENV GOCACHE "/go-build-cache"
ENV GOPRIVATE github.com/org/*
ENV CGO_ENABLED 0
WORKDIR /src
# Copy our source code into the container for building
COPY . .
@jaredallard
jaredallard / worker.go
Created October 21, 2020 05:42
parallel array processor in go
package worker
import (
"context"
"fmt"
"runtime"
"sync"
)
// ProcessArray asynchronously processes an array, spinning up n (n being number of CPUs) goroutine worker
@jaredallard
jaredallard / crash-report.txt
Created December 13, 2019 01:01
thermal dynamics issue?
---- Minecraft Crash Report ----
// My bad.
Time: 2019-12-12 16:54:20 PST
Description: Unexpected error
java.lang.ArrayIndexOutOfBoundsException
A detailed walkthrough of the error, its code path and all known details is as follows:
@jaredallard
jaredallard / daemon.lua
Last active December 8, 2019 21:44
ck8s-test
while true do
print("POD: I'm running!")
os.sleep(2)
end