Skip to content

Instantly share code, notes, and snippets.

View TBK's full-sized avatar
💭
I may be slow to respond.

TBK TBK

💭
I may be slow to respond.
View GitHub Profile
#!/sbin/openrc-run
name="CNI DHCP"
description="CNI DHCP service"
command="/usr/libexec/cni/dhcp"
command_args="daemon"
command_background=true
pidfile="/run/$RC_SVCNAME.pid"
depend() {
need net
#!/sbin/openrc-run
name=$RC_SVCNAME
description="Netavark DHCP proxy service"
command="/usr/libexec/podman/netavark"
command_args="dhcp-proxy -a 0"
command_background=true
pidfile="/run/$RC_SVCNAME.pid"
depend() {
need net
@TBK
TBK / associated_freqs.sh
Created November 1, 2022 23:28
Script to extract and convert associated on frequencies to channel numbers from a wpa_supplicant log
#!/bin/sh
# Author: TBK
# Email: tbk@jjtc.eu
# SPDX-License-Identifier: GPL-2.0-only
# Version: 0.0.1
# Description: Tool to extract and nicely present channels that wpa_supplicant has associated on
# Usage: ./associated_freqs.sh
if [ -f wpa_supplicant.log ]; then
# Grab all lines with frequencies that has been associated on | Reduce it to the frequency | Sort | Remove duplicates
---
available:
- rancher/os:v0.4.5
- rancher/os:v0.5.0
- rancher/os:v0.6.1
- rancher/os:v0.7.1
- rancher/os:v0.8.1
- rancher/os:v0.9.2
- rancher/os:v1.0.0
- rancher/os:v1.0.1
@TBK
TBK / wireguard.initd
Last active April 6, 2020 15:31
WireGuard openrc-run service
#!/sbin/openrc-run
description="WireGuard VPN tunnel"
required_dirs="/etc/wireguard"
extra_started_commands="up down"
depend() {
need localmount net
use dns
@TBK
TBK / aport_bump_pkgrel.sh
Created February 21, 2020 18:44
Simple script to bump pkgrel of a pkg's dependents. Could be improved and simplified if Alpine Linux tools were used, but this can be used on other OS'
#!/bin/bash
set -eu
if [ $# -eq 0 ]
then
echo 'No arguments supplied. Supply two!
- $1 search pattern - e.g. icu-dev
- $2 string containing name & version of the pkg to rebuild against - e.g. "icu 65.1"'
exit 1
check() {
cd "$builddir"
# Setup user and cert
adduser -D sshuser
echo "sshuser:sshpassword" | chpasswd
mkdir -p ~sshuser/.ssh
chown sshuser:sshuser ~sshuser/.ssh
sh -c "cat $(pwd)/tests/testkey_rsa.pub >> ~sshuser/.ssh/authorized_keys"
chown sshuser:sshuser ~sshuser/.ssh/authorized_keys