Skip to content

Instantly share code, notes, and snippets.

View tbnorth's full-sized avatar

Terry Brown tbnorth

View GitHub Profile
# TNB mods
# bind -n == bind -T root == no prefix
set -g lock-after-time 0 # Seconds; 0 = never
bind -n C-Left select-window -p
bind -n C-Right select-window -n
bind -n M-S-Left swap-window -t -1
bind -n M-S-Right swap-window -t +1
bind C-a select-window -l
@tbnorth
tbnorth / citrix_i3.md
Last active February 5, 2024 21:13
Making Citrix Workspace client run in i3 window manager

Citrix Workspace client with i3 window manager

Update: works with 24.04(beta) too, and problem still exists in 24.04.

This is how I got the Citrix Workspace client to run in Ubuntu 23.10 in Jan. 2024

Prior to version 2311 Citrix client, this patch was unnecessary, but at 2311 Citrix stopped launching successfully at all in i3.

In XFCE Citrix runs with "proper" full screen support, covering three monitors but

@tbnorth
tbnorth / status_recur.sh
Last active May 10, 2023 13:27
Recursively show detailed status of git repos.
find . \( -name HEAD -o -name .git \) -print -prune \
| xargs -L1 dirname \
| xargs -IF sh -c ' \
echo; echo -n F ""; \
(cd F; git rev-parse --abbrev-ref HEAD); \
echo "$((cd F; git ls-files --others --exclude-standard) | wc -l) untracked"; \
(cd F; git remote -v) | sed "s/(.*)//" | sort -u; \
(cd F; git cherry -v 2>/dev/null); \
[ -d F/.git ] && (cd F; git -c core.fileMode=false status -uno -s) \
' \
@tbnorth
tbnorth / report_reminder.py
Last active March 15, 2023 21:08
Open a big red window when a window called r".*Reminder.*" exists. Because Outlook reminder windows get buried and fail to remind.
"""
Open a big red window when a window called r".*Reminder.*" exists.
Because Outlook reminder windows get buried and fail to remind.
Thanks to http://stackoverflow.com/q/18146596/1072212
terrynbrown@gmail.com, 2016-09-19
"""
@tbnorth
tbnorth / pywait.py
Last active March 3, 2023 15:13
pywait.py - execute arguments whenever a file changes
"""
pywait.py - execute arguments whenever a file changes
Terry N. Brown, terrynbrown@gmail.com, Mon Dec 12 10:47:49 2016
"""
import os
import sys
import time
# Fix ERROR: readlink /data/docker/overlay2/l/7M5EN7M5OUETAW42LC63NZBNJA: no such file or directory errors
docker image ls | while read row; do
image_id=$(echo $row | sed -E 's/^(\S+\s+){2}(\S+).*/\2/')
docker inspect --format='{{.GraphDriver.Data.MergedDir}}' $image_id || \
(echo -e "Broken image:\n$row"; echo docker image rm $image_id)
done
@tbnorth
tbnorth / docker.sh
Last active October 3, 2022 14:10
Docker tricks
# compact docker ps
docker ps --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"
# *** START: MAINTENANCE ******************************
# remove non-running containers
docker rm $(docker ps -a -q -f status=exited -f status=dead)
# remove untagged images, selects column {2} (zero based) from lines starting with <none>
docker images | grep '^<none>' | sed -nE 's/^(\S+\s+){2}(\S+).*/\2/; p' | xargs docker image rm
@tbnorth
tbnorth / place_window.py
Created September 21, 2016 17:24
Window placement in Windows with Python
"""
Wait 2 seconds then move the active window to the top/bottom
of the left monitor
terrynbrown@gmail.com, 2016-09-21
"""
import sys
import win32gui
import win32con
@tbnorth
tbnorth / uptag.py
Created June 14, 2022 13:04
Update tags file based on paths in tags file
#!/usr/bin/env python
"""Scans file to find folders on which ctags was originally run."""
import subprocess
from pathlib import Path
dirs = set()
for line in Path("tags").open():
if line.startswith("!"):
continue
# extract 'tests' from
"""Three ways to read data from a stream.
Suggested input:
one
three
END
one
three
END