Skip to content

Instantly share code, notes, and snippets.

package main
import (
"database/sql"
"fmt"
"io"
"log"
"os"
"strings"
"time"
param (
[string]$inputFile,
[string]$outputFile
)
if (-not (Test-Path $inputFile)) {
Write-Host "Input file '$inputFile' not found."
Exit 1
}
{ config, pkgs, lib, ... }:
let
user = "guest";
password = "guest";
SSID = "mywifi";
SSIDpassword = "mypassword";
interface = "wlan0";
hostname = "myhostname";
nixosHardwareVersion = "1bc731fde4af337134331572889de8dd8dbff897";
+ HAS_PRO_INSTALLED=0
++ dirname bash
+ SCRIPT_DIR=.
+ [[ . = \. ]]
+ SCRIPT_DIR=/opt/tinypilot
+ readonly SCRIPT_DIR
+ readonly TINYPILOT_README=/opt/tinypilot/README.md
+ TINYPILOT_README=/opt/tinypilot/README.md
+ [[ -f /opt/tinypilot/README.md ]]
+ readonly HAS_PRO_INSTALLED
@mtlynch
mtlynch / install.sh
Created October 25, 2022 21:47 — forked from Overemployed/install.sh
Jacktrip running on PiKVM / Raspberry Pi with arch distro
# your personal machine running jacktrip
REMOTE_JACK_SERVER=nat.local
# change to any name to identify this jacktrip client
JOB_NAME=J1
BUFFER_SIZE=1024
# -d hw:1,0 for pikvm v3 hat
# -d hw:0,0 for others
AUDIO_DEVICE=-d hw:1,0
pacman -Sy
@mtlynch
mtlynch / check-imbalanced-transfers.sh
Last active June 27, 2022 02:12
Bash script for checking unmatched transfers in a beancount journal (https://redd.it/vlkaxp)
#!/bin/bash
set -eu
JOURNAL="myjournal.beancount" # Replace with your beancount file
RESULT="$(bean-query "${JOURNAL}" \
'SELECT account, sum(position)
WHERE account = "Assets:Transfers";')"
TRANSFERS_LINE="$(echo "${RESULT}" | grep "^Assets:Transfers")"
$ docker run --privileged --network host --publish 8001:8001 --publish 8002:8002 --name janus-ustreamer janus-ustreamer:latest
WARNING: Published ports are discarded when using host network mode
-- INFO [164530.467 main] -- Using internal blank placeholder
-- INFO [164530.467 main] -- Using H264-sink: h264_memsink
-- INFO [164530.470 main] -- Listening HTTP on [127.0.0.1]:8001
-- INFO [164530.470 stream] -- Using V4L2 device: /dev/video0
-- INFO [164530.470 stream] -- Using desired FPS: 30
-- INFO [164530.470 http] -- Starting HTTP eventloop ...
-- INFO [164530.470 stream] -- H264: Initializing MMAL encoder ...
-- INFO [164530.470 stream] -- H264: Using bitrate: 5000 Kbps
# Instructions for resizing the LVM volume on a VM
DISK=/dev/sda
VOLUME="${DISK}3"
sudo fdisk "${DISK}
# Press d, accept defaults
# Press n, accept defaults
# Press w, accept defaults
function git_sync_and_branch {
local readonly TARGET_BRANCH="$1"
git checkout master && \
git pull origin master
if [[ ! -z "$TARGET_BRANCH" ]]; then
git checkout -b "${TARGET_BRANCH}"
fi
}
#!/bin/bash
# Set TinyPilot to jiggle the mouse every 3 seconds.
# Author: Michael Lynch
# https://tinypilotkvm.com
# License: MIT License
set -e
set -u