1
0
Fork 0

Add per-host configuration, templating, installer

main
Marissa Staib 5 years ago
parent 5d7afce571
commit 78e033427f
  1. 4
      bash_aliases.sh
  2. 0
      bash_tmux.sh
  3. 14
      inputrc
  4. 33
      install.sh
  5. 3
      per-host/.bash_aliases
  6. 1
      per-host/.bash_aliases-common
  7. 1
      per-host/.inputrc
  8. 1
      per-host/.inputrc-common
  9. 1
      per-host/.ssh/.rc-common
  10. 1
      per-host/.ssh/authorized-keys
  11. 2
      per-host/.ssh/rc
  12. 1
      per-host/.tmux.conf
  13. 1
      per-host/.tmux.conf-common
  14. 1
      per-host/.vimrc
  15. 1
      per-host/.vimrc-common
  16. 10
      per-host/blocky-cafe/.bash_aliases
  17. 1
      per-host/blocky-cafe/.bash_aliases-common
  18. 1
      per-host/blocky-cafe/.inputrc
  19. 1
      per-host/blocky-cafe/.inputrc-common
  20. 1
      per-host/blocky-cafe/.ssh/.rc-common
  21. 1
      per-host/blocky-cafe/.ssh/authorized_keys
  22. 2
      per-host/blocky-cafe/.ssh/rc
  23. 2
      per-host/blocky-cafe/.tmux.conf
  24. 1
      per-host/blocky-cafe/.tmux.conf-common
  25. 1
      per-host/blocky-cafe/.vimrc
  26. 1
      per-host/blocky-cafe/.vimrc-common
  27. 3
      per-host/template/.bash_aliases
  28. 1
      per-host/template/.bash_aliases-common
  29. 1
      per-host/template/.inputrc
  30. 1
      per-host/template/.inputrc-common
  31. 1
      per-host/template/.ssh/.rc-common
  32. 1
      per-host/template/.ssh/authorized_keys
  33. 2
      per-host/template/.ssh/rc
  34. 1
      per-host/template/.tmux.conf
  35. 1
      per-host/template/.tmux.conf-common
  36. 1
      per-host/template/.vimrc
  37. 1
      per-host/template/.vimrc-common
  38. 1
      ssh/authorized_keys
  39. 4
      ssh/rc
  40. 4
      tmux.conf
  41. 0
      tmux.need-reboot.sh
  42. 0
      tmux.screen.conf
  43. 0
      tmux.status-helpers.sh
  44. 1
      vimrc

@ -1,4 +1,6 @@
#!/bin/bash
# vim: set filetype=sh: # vim: set filetype=sh:
# link destination: $HOME/.bash_aliases
# Install EDITOR # Install EDITOR
export EDITOR='vim -X' export EDITOR='vim -X'
@ -73,4 +75,4 @@ function help ()
PS1='\[\e[1;31m\]${debian_chroot:+($debian_chroot)}\[\e[0;36m\]\u\[\e[0;33m\]@\[\e[34m\]\h\[\e[0m\]:\[\e[1;32m\]\w\[\e[0m\]\n\$ ' PS1='\[\e[1;31m\]${debian_chroot:+($debian_chroot)}\[\e[0;36m\]\u\[\e[0;33m\]@\[\e[34m\]\h\[\e[0m\]:\[\e[1;32m\]\w\[\e[0m\]\n\$ '
source "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )"/.bash_tmux source "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )"/bash_tmux.sh

@ -1,3 +1,16 @@
# link destination: $HOME/.inputrc
$include /etc/inputrc
"\C-p":history-search-backward
"\C-n":history-search-forward
set colored-stats On
set completion-ignore-case On
set completion-prefix-display-length 3
set mark-symlinked-directories On
set show-all-if-ambiguous On
set show-all-if-unmodified On
set visible-stats On
# Mac terminal keys # Mac terminal keys
"\e[5~": history-search-backward "\e[5~": history-search-backward
"\e[6~": history-search-forward "\e[6~": history-search-forward
@ -9,4 +22,3 @@
"\e[1;5D": backward-word "\e[1;5D": backward-word
"\e\e[C": forward-word "\e\e[C": forward-word
"\e\e[D": backward-word "\e\e[D": backward-word
set completion-ignore-case On

@ -0,0 +1,33 @@
#!/bin/bash
script="$( realpath -e "${BASH_SOURCE[0]}" )"
dir="$( dirname "$script" )"
hostdir="$dir"/per-host/"$(hostname)"
if [[ ! -d "$hostdir" ]]; then
echo "Copying data from template..."
cp -T -a "$dir"/per-host/template "$hostdir"
fi
if [[ ! -z "$2" ]]; then
relpath=$( realpath --no-symlinks --relative-to "$hostdir" "$2" )
fi
if [[ -z "$1" ]]; then
find "$hostdir" \
\( \
\( -type f -or -type l \) \
-execdir "$script" link '{}' \; \
\) -or \( \
-type d \
-not -samefile "$hostdir" \
-execdir "$script" mkdir '{}' \; \
\)
chmod 700 ~/.ssh
elif [[ "$1" == "link" ]]; then
ln --symbolic "$hostdir/$relpath" ~/"$relpath"
elif [[ "$1" == "mkdir" ]]; then
mkdir -p ~/"$relpath"
else
echo "unknown command $1"
fi

@ -0,0 +1,3 @@
source ~/.bash_aliases-common
auto_tmux

@ -0,0 +1 @@
../../bash_aliases.sh

@ -0,0 +1 @@
$include ~/.inputrc-common

@ -0,0 +1 @@
../../inputrc

@ -0,0 +1 @@
../../../ssh/rc

@ -0,0 +1 @@
../../../ssh/authorized-keys

@ -0,0 +1,2 @@
#!/bin/sh
source .rc-common

@ -0,0 +1 @@
source ~/.tmux.conf-common

@ -0,0 +1 @@
../../tmux.conf

@ -0,0 +1 @@
source ~/.vimrc-common

@ -0,0 +1 @@
../../vimrc

@ -0,0 +1,10 @@
source ~/.bash_aliases-common
copy_func tmux_init_main tmux_init_main_base
function tmux_init_main() {
tmux_init_main_base
tmux -2 new-window -d -t "Main Screen:1" -n "Server" "~/current-server/mark2/start; ~/current-server/mark2/attach"
}
auto_tmux

@ -0,0 +1 @@
$include ~/.inputrc-common

@ -0,0 +1 @@
../../../ssh/authorized_keys

@ -0,0 +1,2 @@
#!/bin/sh
source ~/.ssh/.rc-common

@ -0,0 +1,2 @@
source ~/.tmux.conf-common
set -g base-index 2

@ -0,0 +1 @@
source ~/.vimrc-common

@ -0,0 +1,3 @@
source ~/.bash_aliases-common
auto_tmux

@ -0,0 +1 @@
$include ~/.inputrc-common

@ -0,0 +1 @@
../../../ssh/authorized_keys

@ -0,0 +1,2 @@
#!/bin/sh
source ~/.ssh/.rc-common

@ -0,0 +1 @@
source ~/.tmux.conf-common

@ -0,0 +1 @@
source ~/.vimrc-common

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINsxWR5n8WREoU6d8diPS1tbE6VVvCOSFutgPybz8ZyW ed25519-key-20190920

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
source /etc/ssh/sshrc
if [ -n "$SSH_AUTH_SOCK" ]; then if [ -n "$SSH_AUTH_SOCK" ]; then
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
fi fi
source /etc/ssh/sshrc

@ -1,3 +1,5 @@
# link destination: $HOME/.bash_aliases
############## ##############
# Key Bindings # Key Bindings
############## ##############
@ -5,7 +7,7 @@ set-option -g status-keys emacs
set-window-option -g mode-keys vi set-window-option -g mode-keys vi
set-window-option -g xterm-keys on set-window-option -g xterm-keys on
bind-key _ split-window -v bind-key _ split-window -v
source-file $TMUX_CONF_DIR/.tmux.screen.conf source-file $TMUX_CONF_DIR/tmux.screen.conf
##################### #####################
# Terminal Properties # Terminal Properties

@ -1,3 +1,4 @@
" link destination: $HOME/.vimrc
" Enable modern Vim features not compatible with Vi spec. " Enable modern Vim features not compatible with Vi spec.
set nocompatible set nocompatible
Loading…
Cancel
Save