Skip to content

Instantly share code, notes, and snippets.

View lanefu's full-sized avatar
🏅
outstanding achievement in the field of excellence

lanefu

🏅
outstanding achievement in the field of excellence
View GitHub Profile
@lanefu
lanefu / getPR.sh
Created November 3, 2024 11:27
Git checkout pull request from GitHub
#!/bin/bash
REMOTE_REPO=origin
PR=${1}
git fetch -v ${REMOTE_REPO} +refs/pull/${PR}*:refs/remotes/${REMOTE_REPO}/pull/${PR}*
git checkout -f ${REMOTE_REPO}/pull/${PR}/merge
@lanefu
lanefu / render_template.py
Last active September 25, 2024 14:50
simple python jinja2 template rendeer
import os
from jinja2 import Environment, FileSystemLoader
import yaml
import argparse
import sys
from pathlib import Path
def render_template(template_path: Path, output_path: Path, var_values: dict) -> None:
"""
Render a Jinja2 template from a file and save it to the specified output path.
@lanefu
lanefu / livbirt_import_arm_vm.sh
Last active July 14, 2024 21:05
script to import arm vm images to libvirt with virt-install
#!/bin/bash
DEFAULT_IMAGE=armbian_24.5.0-trunk_Uefi-arm64_bookworm_edge_6.8.9.img.raw
DEFAULT_MEM=2048
DEFAULT_CPU=2
IMAGE_FORMAT=raw
IMAGE_DIR=/mnt/zfs/cheapo/images
@lanefu
lanefu / emergency_team_building.md
Last active October 20, 2023 16:14
Emergency Team building Exercises

Emergency Team Building Exercises

Draw the short straw? Getting paid to kill the time with strangers? Need to heal some relationships to get some work done?

Maybe you need a team building exercise.

Paper Airplanes

remote and on-prem friendly

@lanefu
lanefu / add user public key
Last active July 23, 2023 04:38
another ssh public key script
#!/bin/bash
NEW_USER="someuser"
USER_PUBLIC_KEY="some public key"
mkdir -p /home/${NEW_USER}/.ssh
echo "${NEW_USER_PUBLIC_KEY}" >> /home/${NEW_USER}/authorized_keys
chown -R ${NEW_USER} /home/${NEW_USER}/.ssh
chmod 700 /home/${NEW_USER}/.ssh/
@lanefu
lanefu / install_lvim.mac.sh
Last active March 6, 2025 20:26
Isolated LazyVim install for debian
#!/bin/bash
brew install xz pyenv ninja cmake gettext curl npm wget ripgrep lazygit wget fzf
## also forreal you can probably just use the homebrew package now
git clone --single-branch --branch stable https://github.com/neovim/neovim
pushd neovim
git checkout stable
@lanefu
lanefu / simple-git-over-ssh.md
Created November 10, 2022 13:37
simple self-hosted git over plain ssh

Sometimes you just need an easy way to have a private git repo. Put it on your favorite VPS, SBC, linux box, etc

creates a folder and git repo via relative path of user directory

GIT_REMOTE_DIR=GIT/hosted/example
GIT_REMOTE_HOST=myhost.example.com
ssh ${GIT_REMOTE_HOST} "mkdir -p ${GIT_REMOTE_DIR} && git init --bare ${GIT_REMOTE_DIR}"
@lanefu
lanefu / WTFastly.sh
Created March 13, 2021 14:25
armbian fastly debug
!/usr/bin/env bash
# Examples:
# linx hello.txt # paste file (name/ext will be set).
# echo Hello world. | linx # read from STDIN (won't set name/ext).
# linx -n 1 self_destruct.txt # paste will be deleted after one read.
# linx -i ID hello.txt # replace ID, if you have permission.
# linx -d ID
fastly_headers() {
curl -I -X GET https://mirrors.fossho.st/armbian/apt/
@lanefu
lanefu / graphana.hcl
Created January 6, 2021 15:09
grafana nomad example
job "grafana" {
datacenters = ["example_datacenter"]
type = "service"
constraint {
attribute = "${attr.kernel.name}"
value = "linux"
}
@lanefu
lanefu / sd-seq-write.md
Last active January 1, 2021 21:58
SDcard sequentional write testing

sequentional write tests

hardware

  • pinebook pro
  • usb 3.0 ugreen sdcard reader

benchmark

  • write a random arnbian image approx 1.4G command time dd of=/dev/sdb if=Armbian_21.02.0-trunk-AR-512_Orangepioneplus_focal_dev_5.10.0.img bs=1M conf=fsync status=progress

tests