/
/
/
My dotfile repo. It sets aliases and installs generic applications for my user.
1docker-nets() { docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }} {{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' | sed 's#^/##'; }
2docker-enter() { docker exec -e COLORFGBG -e TERM -ti -u root $1 bash -li ; }
3
4alias gcb='git symbolic-ref --short HEAD | grep -o "AMR-[0-9]\{1,3\}" | xargs -I % sh -c "git commit -m \"%: \$0\""'
5
6alias ls='eza --icons'
7alias ll='eza -lga --icons'
8alias cat='bat --paging=never'
9alias grep='rg'
10
11git-sub-latest() {
12 git submodule foreach '
13 default_branch=$(git remote show origin 2>/dev/null | sed -n "/HEAD branch/s/.*: //p")
14 if [ -z "$default_branch" ]; then
15 echo "$name: Could not determine default branch"
16 continue
17 fi
18
19 git fetch origin "$default_branch" >/dev/null 2>&1
20
21 tip=$(git rev-parse origin/$default_branch)
22 head=$(git rev-parse HEAD)
23
24 if [ "$tip" = "$head" ]; then
25 echo "$name: up to date ($default_branch)"
26 else
27 echo "$name: NOT up to date (HEAD $head vs origin/$default_branch $tip)"
28 fi
29 '
30}
31
32restic-list() { restic snapshots --json | jq -r '.[].paths[]' | sort -u ; }
33
34ros2s() {
35 source /opt/ros/humble/setup.zsh
36
37 if [ -f install/setup.zsh ]; then
38 source install/setup.zsh
39 else
40 echo "[ros2s] No install/setup.zsh found in current directory"
41 fi
42
43 if command -v register-python-argcomplete3 >/dev/null 2>&1; then
44 eval "$(register-python-argcomplete3 -s zsh ros2)"
45 eval "$(register-python-argcomplete3 -s zsh colcon)"
46 else
47 echo "[ros2s] register-python-argcomplete3 not found"
48 fi
49}
50