aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2023-09-18 00:26:56 +0500
committerAnton Bobov <anton@bobov.name>2023-10-03 22:10:24 +0500
commitac40e0190eaf45eea000a75f92785ec7786924b7 (patch)
tree24fc5cd638b7ac153aa976d53c513e1778ee1b9b
parenta431e7abc02df85dbb82c7c31bd948cfbaf63c23 (diff)
[ssh] Add jump syntax via forward slash
-rwxr-xr-xadd-vim-module.sh31
-rw-r--r--files/.ssh/config6
-rwxr-xr-xinstall-packages.sh8
-rwxr-xr-xinstall.sh79
-rw-r--r--packages.debian18
5 files changed, 5 insertions, 137 deletions
diff --git a/add-vim-module.sh b/add-vim-module.sh
deleted file mode 100755
index c0b28e6..0000000
--- a/add-vim-module.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-
-set -e
-
-DEFAULT_MODULE_NAME="vim/"
-DEFAULT_MODULE_PATH="files/.vim/bundle/"
-
-read -p "Enter module git source: " MODULE_SOURCE
-
-if [[ "$MODULE_SOURCE" == *"//github.com/"* ]] ; then
- DEFAULT_MODULE_NAME="$DEFAULT_MODULE_NAME${MODULE_SOURCE##*\/}"
-fi
-
-read -p "Enter module name (ex: vim/ledger): " -i "$DEFAULT_MODULE_NAME" -e MODULE_NAME
-read -p "Enter module path: " -i "$DEFAULT_MODULE_PATH${MODULE_NAME#*\/}" -e MODULE_PATH
-
-
-cat <<EOM
-Check module options:
-
- URL : $MODULE_SOURCE
- Name: $MODULE_NAME
- Path: $MODULE_PATH
-
-EOM
-
-read -p "Add module? (y/N) " -e ADD_ANSWER
-
-if [[ "$ADD_ANSWER" == "y" ]] ; then
- git submodule add --name "$MODULE_NAME" "$MODULE_SOURCE" "$MODULE_PATH"
-fi
diff --git a/files/.ssh/config b/files/.ssh/config
index 581d4b9..b474b06 100644
--- a/files/.ssh/config
+++ b/files/.ssh/config
@@ -3,7 +3,7 @@ Include ~/.ssh/*.conf
HashKnownHosts no
# Enable automatic connection multiplexing by default.
ControlMaster auto
-ControlPath ~/.ssh/.control.%n.%p.%r
+ControlPath ~/.ssh/.control.%C
ControlPersist 60m
ServerAliveInterval 60
TCPKeepAlive yes
@@ -15,6 +15,10 @@ SendEnv LANG LC_* TZ
# Automatically add new host keys to the known_hosts file
StrictHostKeyChecking accept-new
+Host */*
+ ProxyCommand ssh $(dirname %h) -W $(basename %h):%p
+ ProxyJump "$(dirname %h)"
+
Host 192.168.*.*
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
diff --git a/install-packages.sh b/install-packages.sh
deleted file mode 100755
index 10bcb12..0000000
--- a/install-packages.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-
-echo Installing base packages
-xargs -a packages.debian sudo apt-get install -y
-echo Changing shell to zsh
-[ -n "$ZSH_VERSION" ] || chsh -s $(which zsh)
diff --git a/install.sh b/install.sh
deleted file mode 100755
index 2712fba..0000000
--- a/install.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-
-set -e
-dir="$(cd "$(dirname "$0")" && pwd)"
-os=$(uname --operating-system)
-CMD=$SYSTEMROOT/System32/cmd.exe
-
-filter() {
- fname="files/$(basename "$@")"
- if [[ "$fname" == "files/." || "$fname" == "files/.." ]] ; then
- return 0
- fi
- return 1
-}
-
-create_windows_link() {
- fp=$1
- tp=$2
- opt=""
- if [ -d "$fp" ] ; then
- opt="/D"
- fi
- if [[ 1 = $OVERRIDE ]] ; then
- rm --recursive --force "$tp"
- else
- rm --force "$tp"
- fi
- $CMD /c mklink $opt $(cygpath --windows "$tp") $(cygpath --windows "$fp") >/dev/null
-}
-
-create_link() {
- while read fp tp ; do
- case "$os" in
- "Cygwin") create_windows_link "$fp" "$tp" ;;
- *) ln --symbolic --force --no-target-directory "$fp" "$tp" ;;
- esac
- done
-}
-
-check_command() {
- if ! $(which "$1" >/dev/null 2>&1) ; then
- echo "No $1." >&2
- if $(which "command-not-found" >/dev/null 2>&1) ; then
- command-not-found "$1"
- fi
- fi
-}
-
-after_install() {
- mkdir -p $HOME/tmp/vim-undo $HOME/tmp/vim-backup
- mkdir -p $HOME/.mutt/cache
- touch $HOME/.mutt/aliases
- check_command ag
- check_command fzf
-}
-
-check_override() {
- while read filename ; do
- fp=$dir/files/$filename
- tp=$HOME/$filename
- if [[ 1 != $OVERRIDE ]] ; then
- rp=$(readlink -f "$tp")
- if [[ -e "$rp" && "$rp" != "$fp" ]] ; then
- echo "Skip: $filename" >&2
- continue
- fi
- fi
- echo "$fp" "$tp"
- done
-}
-
-if [[ "-f" = "$1" ]] ; then
- OVERRIDE=1
-fi
-
-cd && \
- git -C "$dir" submodule update --init && \
- ( ls --format=single-column --almost-all "$dir/files" | check_override | create_link ) && \
- after_install
diff --git a/packages.debian b/packages.debian
deleted file mode 100644
index 35950b9..0000000
--- a/packages.debian
+++ /dev/null
@@ -1,18 +0,0 @@
-apt-listbugs
-aptitude
-aria2
-atool
-deborphan
-fd-find
-fzf
-git
-htop
-httpie
-ipython
-jq
-ncdu
-silversearcher-ag
-tldr
-tmux
-vim-nox
-zsh