From a75881a2e87c6fb2316e44201b84149f20a76104 Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 13:46:58 -0400 Subject: [PATCH 1/9] git config from quad --- config/macos/gitconfig.local | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/macos/gitconfig.local b/config/macos/gitconfig.local index 95801f0..63fdc7b 100644 --- a/config/macos/gitconfig.local +++ b/config/macos/gitconfig.local @@ -1,4 +1,12 @@ [gpg] format = ssh [user] - signingkey = /Users/spraints/.ssh/id_ed25519.pub + signingkey = /Users/spraints/.ssh/id_rsa.pub +[commit] + gpgsign = true +[url "git@github.com:"] + insteadOf = https://github.com/ +#[url "git@ghe.io:"] +# insteadOf = https://ghe.io/ +[maintenance] + repo = /Users/spraints/src/github.com/github/spokesd From 402295bc7a1df5321b65ba5817cecd6cecd16dfc Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 13:47:11 -0400 Subject: [PATCH 2/9] a note about using fuse for neovim bundles --- config/nvim/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/nvim/install b/config/nvim/install index 10c3a5d..64410f5 100755 --- a/config/nvim/install +++ b/config/nvim/install @@ -22,6 +22,8 @@ start_dir="$(pwd -P)" curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage chmod u+x nvim.appimage +# Instead of extracting it, maybe just install fuse? +# https://github.com/AppImage/docs.appimage.org/blob/master/source/user-guide/troubleshooting/fuse.rst#how-to-install-fuse cd / sudo "${start_dir}/nvim.appimage" --appimage-extract rm -f "${start_dir}/nvim.appimage" From 52bc8f1e327971cea551b6ea8aed9496fcb2211c Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 13:47:27 -0400 Subject: [PATCH 3/9] chmod +x a new install thing i think this is already on main. --- config/iterm2/install | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 config/iterm2/install diff --git a/config/iterm2/install b/config/iterm2/install old mode 100644 new mode 100755 From aed443c59bb877e73ba400adbdeefd0dbf2824d4 Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 13:47:48 -0400 Subject: [PATCH 4/9] Add --oneline as an option for 'merge-queue' --- dotfiles/bin/merge-queue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dotfiles/bin/merge-queue b/dotfiles/bin/merge-queue index 1280c08..f6148fa 100755 --- a/dotfiles/bin/merge-queue +++ b/dotfiles/bin/merge-queue @@ -2,7 +2,7 @@ export RBENV_VERSION=system exec ruby "$0" "$@" #!ruby -#/ Usage: merge-queue OWNER/REPO +#/ Usage: merge-queue [--oneline] OWNER/REPO #/ Shows pretty merge queue for the given repository. require "date" @@ -10,7 +10,7 @@ require "json" require "net/http" require "timeout" -def main(nwo:, token:, user: nil) +def main(nwo:, token:, user: nil, oneline: false) data = query_mq(nwo: nwo, token: token) if errors = data["errors"] p errors @@ -31,7 +31,9 @@ def main(nwo:, token:, user: nil) active_group_ids = mq.fetch("mergingEntries").fetch("edges").map { |edge| edge.fetch("node").fetch("id") } - puts "**", "Also check out: https://heaven.githubapp.com/apps/#{File.basename(nwo)}", "**", "" + unless oneline + puts "**", "Also check out: https://heaven.githubapp.com/apps/#{File.basename(nwo)}", "**", "" + end next_merge_time = mq.fetch("nextEntryEstimatedTimeToMerge") entries = mq.fetch("entries").fetch("edges") @@ -53,9 +55,10 @@ def main(nwo:, token:, user: nil) pr_url = entry.fetch("pullRequest").fetch("url") commit_url = entry.dig("headCommit", "url") - printf "%3d. %s @%s [%d] %s\n %s\n", - position, pretty_state(state), enqueued_by, pr_number, pr_title, pr_url - if state != "MERGEABLE" + printf "%3d. %s @%s [%d] %s\n", + position, pretty_state(state), enqueued_by, pr_number, pr_title + unless oneline + printf " %s\n", pr_url printf " %s\n", commit_url || "(no commit URL)" end end @@ -182,6 +185,8 @@ while arg = ARGV.shift opts[:nwo] = arg when "--user" opts[:user] = ARGV.shift + when "--oneline" + opts[:oneline] = true else usage end From b4e9b0a7be31c4022c7b08e19ac47991a658d264 Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 13:48:11 -0400 Subject: [PATCH 5/9] improve tcp-hogs --- dotfiles/bin/tcp-hogs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/dotfiles/bin/tcp-hogs b/dotfiles/bin/tcp-hogs index 83e607f..aa6689f 100755 --- a/dotfiles/bin/tcp-hogs +++ b/dotfiles/bin/tcp-hogs @@ -1,19 +1,34 @@ #!/bin/bash +#/ Usage: tcp-hogs [-n SECONDS] [-i IFACE] +#/ SECONDS defaults to 10. +#/ IFACE defaults to en0. +#/ en0 = wifi on mac laptops. +#/ en8 = usb hub on work laptop. set -e set -o nounset -# on quad: -# en0 is the wifi adapter -# en8 is the usb hub iface=en0 - sec=10 +while [ $# -gt 0 ]; do + case "$1" in + -n) + sec="$2" + shift; shift;; + -i) + iface="$2" + shift; shift;; + *) + cat "$0" | grep "^#/" | cut -c4- + exit 1;; + esac +done + t=${TMPDIR:-/tmp} pcap="${t}/tcp-hogs-$$.pcap" -#trap "test -f ${pcap} && rm -f ${pcap}" EXIT +trap "test -f ${pcap} && (set -x; rm -f ${pcap})" EXIT echo "Capturing packets for ${sec} seconds into ${pcap}..." tcpdumpargs="-G ${sec} -W 1 -w ${pcap}" From c09b0ca71b7000f2d059e83d329825e86b7ff2e5 Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 13:48:22 -0400 Subject: [PATCH 6/9] we brake for nobody --- dotfiles/config/starship.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dotfiles/config/starship.toml b/dotfiles/config/starship.toml index 924bd82..95833eb 100644 --- a/dotfiles/config/starship.toml +++ b/dotfiles/config/starship.toml @@ -1,3 +1,5 @@ +command_timeout = 100 + [[battery.display]] threshold = 30 From 39e6455b5d06a2204fe771ffa037f26236b8f8b1 Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 13:48:46 -0400 Subject: [PATCH 7/9] find a tmux window by name --- dotfiles/tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf index 1ea9f18..f26a1f7 100644 --- a/dotfiles/tmux.conf +++ b/dotfiles/tmux.conf @@ -11,6 +11,7 @@ bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R +bind -N 'find a window by name' e command-prompt -p 'window name:' 'find-window %%' bind _ clear-history From f44e420f2b6668613921ea2e0ed8e01489b43408 Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 15:07:21 -0400 Subject: [PATCH 8/9] add archiver --- script/archive-quad | 105 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100755 script/archive-quad diff --git a/script/archive-quad b/script/archive-quad new file mode 100755 index 0000000..b78977e --- /dev/null +++ b/script/archive-quad @@ -0,0 +1,105 @@ +#!/bin/bash + +set -e +set -o nounset + +# set this to false to actually run the commands. +DRYRUN=true + +TODAY="$(date +%Y-%m-%d)" +ARCHIVE_DIR="${HOME}/archive-${TODAY}" + +echo "Making archives in ${ARCHIVE_DIR}" + +backup() { + local dir="$1"; shift + local dest="${ARCHIVE_DIR}/${dir}.tar.bz2" + mkdir -p "$(dirname "$dest")" + if [ -e "${dir}/.archive-quad-excludes" ]; then + set -- "$@" --exclude-from "${dir}/.archive-quad-excludes" + fi + set -- "$@" --exclude "target" + set -- "$@" --exclude "build" + set -- "$@" --exclude "node_modules" + set -- "$@" --exclude ".bundle" + set -- "$@" --exclude "vendor/cache" + btar "$dir" "$dest" "$@" +} + +backup_home() { + local dir="$1"; shift + local dest="${ARCHIVE_DIR}/homes/${dir}.tar.bz2" + mkdir -p "$(dirname "$dest")" + btar --sudo "$dir" "$dest" "$@" +} + +btar() { + local dir="$1"; shift + local sudo= + if [ "$dir" = "--sudo" ]; then + sudo=sudo + dir="$1"; shift + fi + local dst="$1"; shift + + if [ -f "$dst" ]; then + ls -l "$dst" + elif $DRYRUN; then + echo $sudo tar "$@" -cjf "$dst" "$dir" + else + rm -f "$ARCHIVE_DIR/.tmp" + (set -x; $sudo tar "$@" -cjf "$ARCHIVE_DIR/.tmp" "$dir") + mv "$ARCHIVE_DIR/.tmp" "$dst" + ls -l "$dst" + fi +} + +cd "${HOME}" + +backup Desktop + +backup Documents --exclude Documents/VOI +backup Documents/VOI + +backup Movies + +backup Music/Sonic\ Pi + +for d in src/*; do + case "$(basename "$d")" in + github.com|ghe.io|github.ghe.com) + for dd in $d/*/*; do + case "$(basename "$dd")" in + enterprise2|github|github-bare|heaven|puppet|thehub|zoom) + ;; #skip + *) + backup "$dd" + ;; + esac + done + ;; + experiments|gist*) + for dd in $d/*; do + backup "$dd" + done + ;; + *) + backup "$d" + ;; + esac +done + +for d in dev/*; do + if [ "$d" != "dev/machines.bak" ]; then + backup "$d" + fi +done + +for d in Xcode/*; do + backup "$d" +done + +cd .. +backup_home cassandra +backup_home oliver +backup_home goldenpandas From edbf8a5d14b8281dacc96d6b74c784fbb1e02f30 Mon Sep 17 00:00:00 2001 From: Matt Burke Date: Mon, 6 May 2024 15:07:54 -0400 Subject: [PATCH 9/9] no edit --- script/archive-quad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/archive-quad b/script/archive-quad index b78977e..215b83b 100755 --- a/script/archive-quad +++ b/script/archive-quad @@ -3,8 +3,8 @@ set -e set -o nounset -# set this to false to actually run the commands. -DRYRUN=true +# "DRYRUN=false script/archive-quad" to actually run the commands. +DRYRUN="${DRYRUN:-true}" TODAY="$(date +%Y-%m-%d)" ARCHIVE_DIR="${HOME}/archive-${TODAY}"