Skip to content

Instantly share code, notes, and snippets.

View sarcasticadmin's full-sized avatar

Robert James Hernandez sarcasticadmin

View GitHub Profile
@sarcasticadmin
sarcasticadmin / oxide-rs-cli-oxide.sh
Created October 17, 2024 06:48
Oxide CLI (oxide-rs) nixpkg build test notes
# Test oxide-rs cli built via nixpkgs
./result/bin/oxide version
Oxide CLI 0.7.0+20240821.0
Built from commit: 2fd0e64a68cf8abe06dcca97dae2661d90efabe5 (dirty)
Oxide API: 20240821.0
# Login to rack silo, copy url into the browser
# Note: --no-browser seemed to be the only way I could get the one code to be displayed. Without out it nothing would output (--debug didnt help either)
./result/bin/oxide auth login --host https://<HOSTURL> --no-browser
@sarcasticadmin
sarcasticadmin / shell.nix
Last active July 18, 2024 21:13
leveraging python3 gtk and webkit with nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
mkShell {
# Nixpkgs in include in shell
buildInputs = [
gobject-introspection
python3Packages.pygobject3
@sarcasticadmin
sarcasticadmin / enable-serial.sh
Created October 30, 2023 16:22
ubuntu 22.04 enable serial tty
# ref: https://www.rogerirwin.co.nz/linux-open-source/enabling-a-serial-port-console/
# assuming your serial device is ttyS1
systemctl enable [email protected]
systemctl start [email protected]
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
http.HandleFunc("/", getRoot)
@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"
#!/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

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
@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
@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 / 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