Skip to content

Instantly share code, notes, and snippets.

View jaredallard's full-sized avatar

Jared Allard jaredallard

View GitHub Profile
@jaredallard
jaredallard / keyring.sh
Last active February 10, 2024 01:27
Sets up a Gentoo machine to use the gentoo.rgst.io binhost with GPG signature verification. Assumes you're using an m1 mac.
#!/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"
TRUST_FILE="${GPG_DIR}/trustdb.gpg"
PASSWD_FILE="${GPG_DIR}/pass"
@jaredallard
jaredallard / make.conf
Last active May 22, 2023 01:34
Portage Configuration for an M1 Mac
COMMON_FLAGS="-march=armv8.5-a+simd+crypto -mtune=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable before changing.
CHOST="aarch64-unknown-linux-gnu"
# This sets the language of build output to English.
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
@jaredallard
jaredallard / mount-kubelet.sh
Last active February 25, 2018 05:05
Hack to mount /mnt/media-v1 into kubelet in rancher, docker-enter: docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter
#!/bin/sh
set -e
CONTAINER=r-kubernetes-kubelet-3-59fec1df
HOSTPATH=/mnt/media-v1
CONTPATH=/mnt/media-v1
REALPATH=$(readlink -f $HOSTPATH)
FILESYS=$(df -P $REALPATH | tail -n 1 | awk '{print $6}')
while read DEV MOUNT JUNK
@jaredallard
jaredallard / directstream.json
Last active January 26, 2018 02:04
Failed to switch audio tracks
2018-01-26 01:57:14.640
Application version: 3.2.70.0
https://media.tritonjs.com:4433/emby/videos/89b24d01481a033f5e6f3e85abeb2fb7/hls1/main/0.ts?DeviceId=c622f4a4436c96222f86b38fa3e808ba74af04f1&MediaSourceId=89b24d01481a033f5e6f3e85abeb2fb7&VideoCodec=h264&AudioCodec=mp3,aac&AudioStreamIndex=1&VideoBitrate=195726367&AudioBitrate=192000&PlaySessionId=64e5927d4d6d404bacef1253d81e6c55&api_key=&CopyTimestamps=false&TranscodingMaxAudioChannels=2&EnableSubtitlesInManifest=false&Tag=cc090a08752635650bfee403698f9387&RequireAvc=true&RequireNonAnamorphic=false&SegmentContainer=ts&MinSegments=2&BreakOnNonKeyFrames=True&TranscodeReasons=SecondaryAudioNotSupported&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=51&h264-deinterlace=true
{"Protocol":"File","Id":"89b24d01481a033f5e6f3e85abeb2fb7","Path":"/mnt/media-v1/production/tv/Mirai Nikki/01 - Sign Up.libx264.mkv","Type":"Default","Container":"mkv,webm","Name":"01 - Sign Up.libx264.mkv","IsRemote":false,"ETag":"cc090a08752635650bfee403698f9387"
@jaredallard
jaredallard / serverlog.txt
Created January 25, 2018 18:20
Media Trancoded when it wasn't supposed too
This file has been truncated, but you can view the full file.
2018-01-25 04:14:43.128 Info Main: Application path: /opt/emby-server/system/EmbyServer.dll
2018-01-25 04:14:43.175 Info Main: Emby
Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
Operating system: Unix 4.13.0.31
64-Bit OS: True
64-Bit Process: True
User Interactive: True
Processor count: 2
Program data path: /var/lib/emby
Application directory: /opt/emby-server/system