Skip to content

Instantly share code, notes, and snippets.

View sarcasticadmin's full-sized avatar

Robert James Hernandez sarcasticadmin

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sarcasticadmin on github.
  • I am sarcasticadmin (https://keybase.io/sarcasticadmin) on keybase.
  • I have a public key whose fingerprint is BBBA 6D31 E451 9326 518A 1493 8CC9 6E1E C9BA 9CEF

To claim this, I am signing this object:

@sarcasticadmin
sarcasticadmin / build_laptop.sh
Created December 29, 2017 23:21
Simple Laptop Config
#!/usr/bin/env bash
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
apt-get update
apt-get install -y vim curl openssh-server tmux stow git google-chrome-stable
test -d ~/.ssh || mkdir ~/.ssh && chmod 750 ~/.ssh
test -f ~/.ssh/authorized_keys || curl -o ~/.ssh/authorized_keys https://github.com/sarcasticadmin.keys
######
# Moving single disk zroot to new, larger SSD via temporarily adding new disk as mirror
# Done on FreeBSD 10.2
#
# Sources:
# https://forums.freebsd.org/threads/zfsroot-without-mirror-how-to-replace-disk-migrate-to-bigger.57916/
# http://www.wonkity.com/~wblock/docs/html/disksetup.html
#####
# Look up paritions from previous disk
@sarcasticadmin
sarcasticadmin / iohyve-grow.txt
Created December 7, 2018 07:57
Growing iohyve vm in bhyve without LVM
#####
# Growing iohyve vm in bhyve without LVM
# Source:
# https://vinfrastructure.it/2018/01/resize-linux-filesystem-without-lvm/
#####
# Grow disk on Bhyve VM
iohyve resize <vm> disk0 80G
# Check vm disk info
@sarcasticadmin
sarcasticadmin / ports-tree-notes.md
Created February 1, 2019 07:40
Misc notes from ports tree work

Freebsd 11 ports notes

Disabling x11 for headless instances

echo "OPTIONS_UNSET+=X11" >> /etc/make.conf

Building a pkg from a local port

make config-recursive package
@sarcasticadmin
sarcasticadmin / 8bitdo-controller.sh
Created April 12, 2020 00:35
Lakka 8bitdo bluetooth controller autoadd
# Tried this on Lakka (official): 2.3.2 (Generic.x86_64)
#
# This script is a WIP (work in progress
# Refs
# https://www.pcsuggest.com/linux-bluetooth-setup-hcitool-bluez/
# https://wiki.archlinux.org/index.php/Bluetooth
# https://stackoverflow.com/questions/12888589/linux-command-line-howto-accept-pairing-for-bluetooth-device-without-pin
#
# Once 8bitdo controllers are paired they do not get remembered after reboot
# Even though their configs are still present in ~/.config/bluetooth

Poudriere gist

Inspired from: https://bsdrp.net/documentation/technical_docs/poudriere

System info:

# pkg info | grep poudriere
poudriere-devel-3.3.99.20200326 Port build and test system
# uname -a
FreeBSD robs-desktop 12.1-RELEASE-p5 FreeBSD 12.1-RELEASE-p5 3135379a043(releng/12.1) GENERIC amd64
#!/bin/sh
### BEGIN INIT INFO
# Provides: s3backup
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Backup unifi dvr contents to s3
### END INIT INFO
@sarcasticadmin
sarcasticadmin / uronode-tarball2git.sh
Created August 15, 2023 05:51
uronode-tarball2git
set -e
set -o pipefail
VERSION=$1
# Location of all tarballs
TARBALL="/home/rherna/backups/srcs/uronode-${VERSION}.tar*"
# Get the oldest file in the tarball and well assume thats the time for the release
VERSION_DATE="$(tar tvf $TARBALL | sort -k 4 | tail -n 1 | tr -s '[:blank:]' | cut -d ' ' -f 4)T00:00:00+00:00"
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
http.HandleFunc("/", getRoot)