summary refs log tree commit diff
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rw-r--r--.local/share/navi/cheats/robertgzr__cheats/balena/misc.cheat33
-rw-r--r--.local/share/navi/cheats/robertgzr__cheats/docker.cheat13
-rw-r--r--.local/share/navi/cheats/robertgzr__cheats/gentoo/openrc.cheat17
-rw-r--r--.local/share/navi/cheats/robertgzr__cheats/gentoo/pkg.cheat10
-rw-r--r--.local/share/navi/cheats/robertgzr__cheats/git.cheat9
-rw-r--r--.local/share/navi/cheats/robertgzr__cheats/misc.cheat33
-rw-r--r--.local/share/navi/cheats/robertgzr__cheats/qemu.cheat28
7 files changed, 143 insertions, 0 deletions
diff --git a/.local/share/navi/cheats/robertgzr__cheats/balena/misc.cheat b/.local/share/navi/cheats/robertgzr__cheats/balena/misc.cheat
new file mode 100644
index 0000000..ac0e63d
--- /dev/null
+++ b/.local/share/navi/cheats/robertgzr__cheats/balena/misc.cheat
@@ -0,0 +1,33 @@
+
+% balena, mount
+
+# remount rootfs writable
+mount -o remount,rw /
+
+# remount rootfs readonly
+mount -o remount,ro /
+
+% balena, journal
+
+# engine + container logs
+journalctl -fu balena -a
+
+# engine logs only
+journalctl -fu balena -t balenad
+
+# supervisor logs
+journalctl -fu resin-supervisor
+
+# kernel logs
+journalctl -fk
+
+# last boot logs (needs persistent-logging)
+journalctl -b -1 -r
+
+% balena, edit systemd
+
+# edit engine (dev)
+vi /etc/systemd/system/balena.service.d/balena.conf
+
+# edit engine
+vi /etc/systemd/system/balena-engine.service
diff --git a/.local/share/navi/cheats/robertgzr__cheats/docker.cheat b/.local/share/navi/cheats/robertgzr__cheats/docker.cheat
new file mode 100644
index 0000000..c89d141
--- /dev/null
+++ b/.local/share/navi/cheats/robertgzr__cheats/docker.cheat
@@ -0,0 +1,13 @@
+
+% docker
+
+# List images, sorted by size
+docker image ls --format '{{.Size}}\t{{.ID}}\t{{.Repository}}:{{.Tag}}' | sort -h
+
+# List images, sorted by creation time
+docker image ls --format '{{.CreatedAt}}\t{{.ID}}\t{{.Repository}}:{{.Tag}}' | sort
+
+# List images, include architecture
+docker image ls --format '{{.Size}}\t{{.ID}}\t{{.Repository}}:{{.Tag}}' \
+  | awk '{"docker inspect "$2"| jq -r .[].Architecture"|getline arch; printf "%s\t%s\t%s\t%s\n", $1, $2, arch, $3}' \
+  | sort -h
diff --git a/.local/share/navi/cheats/robertgzr__cheats/gentoo/openrc.cheat b/.local/share/navi/cheats/robertgzr__cheats/gentoo/openrc.cheat
new file mode 100644
index 0000000..627ff70
--- /dev/null
+++ b/.local/share/navi/cheats/robertgzr__cheats/gentoo/openrc.cheat
@@ -0,0 +1,17 @@
+
+% openrc
+
+# OpenRC service start
+doas rc-service <svc> start
+
+# OpenRC service restart
+doas rc-service <svc> restart
+
+# OpenRC service stop
+doas rc-service <svc> stop
+
+# OpenRC service status
+doas rc-service <svc> status
+
+# OpenRC runlevel change
+doas rc <runlevel>
diff --git a/.local/share/navi/cheats/robertgzr__cheats/gentoo/pkg.cheat b/.local/share/navi/cheats/robertgzr__cheats/gentoo/pkg.cheat
new file mode 100644
index 0000000..6bfe040
--- /dev/null
+++ b/.local/share/navi/cheats/robertgzr__cheats/gentoo/pkg.cheat
@@ -0,0 +1,10 @@
+
+% gentoo, eix
+
+# list installed pkgs
+
+eix-installed -a
+
+# list installed unstable pkgs
+
+eix-installed -a | grep 9999
diff --git a/.local/share/navi/cheats/robertgzr__cheats/git.cheat b/.local/share/navi/cheats/robertgzr__cheats/git.cheat
new file mode 100644
index 0000000..01bccce
--- /dev/null
+++ b/.local/share/navi/cheats/robertgzr__cheats/git.cheat
@@ -0,0 +1,9 @@
+% git
+
+# checkout branch
+git checkout <branch> && git status
+
+$ branch: git branch -a --format='%(refname)' \
+	| cut -d' ' -f1 \
+	| sed -e 's#^refs/##' -e 's#^remotes/##' -e 's#^heads/##' \
+	| sort
diff --git a/.local/share/navi/cheats/robertgzr__cheats/misc.cheat b/.local/share/navi/cheats/robertgzr__cheats/misc.cheat
new file mode 100644
index 0000000..792bd38
--- /dev/null
+++ b/.local/share/navi/cheats/robertgzr__cheats/misc.cheat
@@ -0,0 +1,33 @@
+
+% rsyncez
+
+rsyncez '<from>' '<to>'
+
+$ to: fd --one-file-system -p -t d -d 5 $HOME
+
+
+% cat, EOF
+
+# cat <<-EOF
+
+cat <<-EOF > /dev/stdout
+hello world
+EOF
+
+
+% ubnt, wifi
+
+# get wifi leases from ubnt router
+
+ssh ubnt -- ./leases 2>/dev/null
+
+
+% ssh, tunnel
+
+# tunnel local port to remote machine
+
+ssh -nNTR <remote-port>:<local-host-and-port> <machine>
+
+# tunnel remote port to local machine
+
+ssh -nNTL <remote>:<host-hostport> <machine>
diff --git a/.local/share/navi/cheats/robertgzr__cheats/qemu.cheat b/.local/share/navi/cheats/robertgzr__cheats/qemu.cheat
new file mode 100644
index 0000000..d92b88b
--- /dev/null
+++ b/.local/share/navi/cheats/robertgzr__cheats/qemu.cheat
@@ -0,0 +1,28 @@
+
+% qemu, balena
+
+# boots a balenaOS vm
+
+qemu-system-x86_64 -name balena0 \
+	-netdev "user,id=net0,hostfwd=tcp::22222-:22222" -device e1000,netdev=net0 \
+	-bios /usr/share/edk2-ovmf/OVMF_CODE.fd \
+	-m 4G -smp 4 \
+	-cpu max \
+	-machine type=pc,accel=kvm \
+	-display none \
+	-drive format=vvfat,file=fat:rw:/tmp/qemu,index=1 \
+	-drive format=raw,cache=none,if=virtio,index=0,file=balena.img
+
+
+% qemu, ubuntu
+
+# boots an ubuntu vm
+
+qemu-system-x86_64 -name ubuntu0 \
+	-netdev "user,id=net0,hostfwd=tcp::2222-:22" -device e1000,netdev=net0 \
+	-m 4G -smp 4 \
+	-cpu max \
+	-machine type=pc,accel=kvm \
+	-display none \
+	-drive format=vvfat,file=fat:rw:/tmp/qemu,index=1 \
+	-drive format=qcow2,cache=none,index=0,file=/home/robert/ubuntu.qcow2