Skip to content

Instantly share code, notes, and snippets.

View wwalker's full-sized avatar

Wayne Walker wwalker

View GitHub Profile
On ut:
```
service stop postfix
i=marklehmann.com
mkdir /mnt/fast/$i
time virtualmin backup-domain --dest /mnt/fast/$i --domain $i --newformat --all-virtualmin --strftime --all-features
rsync -avPHx /mnt/fast/$i lonestar:/data/sdb1/virtualmin-imports/
```
on lonestar:
@wwalker
wwalker / 0-stolen from
Created January 3, 2020 20:44
i3 swap done right
https://www.reddit.com/r/i3wm/comments/ejjd7w/swap_two_containers/
u/vikarjramun
@wwalker
wwalker / latest TERM change
Created December 9, 2019 01:39
latest TERM change
wwalker@polonium:~/.../src/dot-files/common (master u= origin/master) ✓ $ git log -p | egrep '^(commit|Author|Date|[+-].*TERM=.*)' | grep -B3 TERM=
commit 619b2bc55329d6a1e8052a794ada0408733baf2b
Author: Wayne Walker <[email protected]>
Date: Tue Dec 1 17:54:50 2015 -0600
+ TERM=xterm-256color
@wwalker
wwalker / tmux attach acts differently
Created December 9, 2019 01:32
tmux attach acts differently
wwalker@polonium:~ ✓ $ grep TERM tmux-server-30474.log
1575853908.712755 client 0x55f889203a60 IDENTIFY_TERM xterm-256color
1575853908.716903 window_pane_spawn: environment TERM=screen
1575853908.716905 window_pane_spawn: environment TERMINAL=xterm
1575853908.719791 client 0x55f889203a60 IDENTIFY_ENVIRON TERMINAL=xterm
1575853908.719872 client 0x55f889203a60 IDENTIFY_ENVIRON TERM=xterm-256color
1575853908.721750 window_pane_spawn: environment TERM=screen-256color
1575853908.721752 window_pane_spawn: environment TERMINAL=xterm
1575853927.777034 client 0x55f8892226a0 IDENTIFY_TERM xterm-256color
1575853927.777394 client 0x55f8892226a0 IDENTIFY_ENVIRON TERMINAL=xterm
wwalker@polonium:~ ✓ $ tmux kill-server
wwalker@polonium:~ ✓ $ tmux kill-server
no server running on /tmp/tmux-1000/default
wwalker@polonium:~ ✓ $ tmux -vvvv
[exited]
wwalker@polonium:~ ✓ $ tmux kill-server
wwalker@polonium:~ ✓ $ tmux kill-server
no server running on /tmp/tmux-1000/default
wwalker@polonium:~ ✘ $ tmux -vvvv attach
[exited]
1575852350.327156 server started (17811): version 2.9a, socket /tmp/tmux-1000/default, protocol 8
1575852350.327200 on Linux 5.3.7-200.fc30.x86_64 #1 SMP Fri Oct 18 20:13:59 UTC 2019; libevent 2.1.8-stable (poll)
1575852350.327256 bind-key: argv[0]=bind
1575852350.327259 bind-key: argv[1]=C-b
1575852350.327262 bind-key: argv[2]=send-prefix
1575852350.327267 bind-key: argv[0]=bind
1575852350.327269 bind-key: argv[1]=C-o
1575852350.327271 bind-key: argv[2]=rotate-window
1575852350.327285 bind-key: argv[0]=bind
1575852350.327287 bind-key: argv[1]=C-z
1575852122.870225 server started (15884): version 2.9a, socket /tmp/tmux-1000/default, protocol 8
1575852122.870244 on Linux 5.3.7-200.fc30.x86_64 #1 SMP Fri Oct 18 20:13:59 UTC 2019; libevent 2.1.8-stable (poll)
1575852122.870280 bind-key: argv[0]=bind
1575852122.870285 bind-key: argv[1]=C-b
1575852122.870287 bind-key: argv[2]=send-prefix
1575852122.870292 bind-key: argv[0]=bind
1575852122.870294 bind-key: argv[1]=C-o
1575852122.870296 bind-key: argv[2]=rotate-window
1575852122.870300 bind-key: argv[0]=bind
1575852122.870302 bind-key: argv[1]=C-z
@wwalker
wwalker / session
Created December 9, 2019 00:29
tmux attach behaves differently than tmux
wwalker@polonium:~ ✓ $ echo $TERM
xterm-256color
wwalker@polonium:~ ✓ $ pgrep tmux
wwalker@polonium:~ ✘ $ tmux attach
[exited]
wwalker@polonium:~ ✓ $ # TERM in tmux was screen
wwalker@polonium:~ ✓ $ pgrep tmux
wwalker@polonium:~ ✘ $ tmux
[exited]
wwalker@polonium:~ ✓ $ # TERM in tmux was screen-256color
In a script I build up a lit of filters that I want to apply to the output of a program.
This list may vary (tee, sort, uniq, ts, etc.) Could be all of them or none of them or any combination.
So I built up a list in a variable (_ql_append)
So _ql_append will have something like this in it:
"ilts -S -E | tee":
then the script executes this line:
( echo "$@"; "$@" ) | $_ql_append > "$_ql_filepath" 2>&1
@wwalker
wwalker / tmux
Last active December 7, 2019 19:36
confused ssh tmux interaction
TL;DR - Solved it. $HOSTNAME isn't set in interactive shh session
wwalker@polonium:~ ✓ $ head ~/.tmux.conf
#new -s $HOSTNAME
set-hook -g session-created "rename-session $HOSTNAME"
#rename-session $HOSTNAME
# This works:
wwalker@serenity:~ ✓ $ ssh polonium
Last login: Sat Dec 7 12:20:35 2019 from 172.16.16.119