Skip to content

Instantly share code, notes, and snippets.

View edwardtheharris's full-sized avatar
:shipit:
; – Hide and seek champion since 1971

Xander Harris edwardtheharris

:shipit:
; – Hide and seek champion since 1971
View GitHub Profile
@edwardtheharris
edwardtheharris / calicoctl.sh
Last active November 28, 2024 04:14
containerd run calicoctl
#!/bin/bash
ctr run --rm -t docker.io/calico/ctl:v3.29.1 calico calicoctl --help
ctr run --env DATASTORE_TYPE=kubernetes --env KUBECONFIG=/kube.conf --mount type=bind,src=/etc/kubeadm/admin.conf,dst=/kube.conf,options=rbind:ro --net-host --rm -t docker.io/calico/ctl:v3.29.1 calico calicoctl get nodes --allow-version-mismatch
@edwardtheharris
edwardtheharris / cadvisor.sh
Last active March 20, 2025 14:21
cadvisor docker run script
VERSION=v0.49.1 # use the latest release version from https://github.com/google/cadvisor/releases
sudo docker run \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:ro \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--volume=/dev/disk/:/dev/disk:ro \
--publish=8080:8080 \
--detach=true \
--name=cadvisor \
@edwardtheharris
edwardtheharris / firmware-install.sh
Last active March 17, 2025 05:03
ArchLinux install missing firmware
#!/bin/bash
# You will need to use `yay` or some other Pacman tool with access to the AUR.
yay -Syyu aic94xx-firmware ast-firmware linux-firmware-qlogic upd72020x-fw wd719x-firmware
# Extra packages for a more complete system when following the install guide.
# https://wiki.archlinux.org/title/Installation_guide
pacstrap -K /mnt base base-devel linux linux-headers linux-firmware git \
@edwardtheharris
edwardtheharris / net.completion
Last active April 3, 2024 19:40
Samba CLI BASH completion
net
@edwardtheharris
edwardtheharris / samba-tool-completion.md
Last active February 18, 2024 18:07
samba-tool.bash.completion

Bash Completion for samba-tool

I noticed that this was missing or difficult to find on the internet, so I had my friendly local AI write one up for me.

It's incomplete at the moment, but I will be updating it with more commands and options as I continue to use samba-tool.

Anyway, hopefully this is helpful to someone.

@edwardtheharris
edwardtheharris / git-prepare-commit-msg.py
Last active May 8, 2024 16:21
A selection of git commit message preparation scripts
#!/usr/bin/env python3
"""
A small Python script to produce commit messages.
.. rubric:: Prepare Commit Message
This hook is invoked by `git-commit[1] <https://git-scm.com/docs/git-commit>`_
right after preparing the default log message, and before the editor is started.
It takes one to three parameters. The first is the name of the file that
@edwardtheharris
edwardtheharris / raid.sh
Last active December 6, 2018 06:28
ArchLinux RAID Creation
#!/bin/bash
arrayname='media'
# 150G partitions, fd00 filesystem type
gdisk /dev/sdb
gdisk /dev/sdc
gdisk /dev/sdd
mdadm --verbose -C /dev/md0 -l6 -Nmedia -n12 \
@edwardtheharris
edwardtheharris / enter-vm.bash
Last active November 23, 2018 21:17
Update the hostname of the Docker VM when running Docker for Mac
docker run -it --rm --uts=host --cap-add SYS_ADMIN busybox
#!/bin/bash
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj "/C=US/ST=California/L=Los Angeles/O=Gahan Corporation/[email protected]" -keyout duchess.key -out duchess.crt