diff options
| author | hc <hc@email.ch> | 2024-10-02 08:55:26 +0800 |
|---|---|---|
| committer | hc <hc@email.ch> | 2024-10-02 08:55:26 +0800 |
| commit | 809a9229b68f4b1385915c152a49e69ebee963a7 (patch) | |
| tree | 7376437384b8557efac1fa93dc66f985437a1b80 | |
| parent | d1a8ea228181575ee5d3c4d96497c703e83800f7 (diff) | |
fix
| -rw-r--r-- | .setup.sh.swp | bin | 0 -> 12288 bytes | |||
| -rwxr-xr-x[-rw-r--r--] | port-forward/ssh-port-forward.sh | 2 | ||||
| -rwxr-xr-x | setup.sh | 19 |
3 files changed, 12 insertions, 9 deletions
diff --git a/.setup.sh.swp b/.setup.sh.swp new file mode 100644 index 0000000..6e4693c --- /dev/null +++ b/.setup.sh.swp | |||
| Binary files differ | |||
diff --git a/port-forward/ssh-port-forward.sh b/port-forward/ssh-port-forward.sh index 748c161..798949d 100644..100755 --- a/port-forward/ssh-port-forward.sh +++ b/port-forward/ssh-port-forward.sh | |||
| @@ -12,4 +12,6 @@ echo "cleaning attempted." | |||
| 12 | 12 | ||
| 13 | ssh -i $KEY_FILE $HOST $(for i in $(seq ${j}000 ${j}005); do echo "-R $i:localhost:$i"; done; echo "-R ${j}022:localhost:22") | 13 | ssh -i $KEY_FILE $HOST $(for i in $(seq ${j}000 ${j}005); do echo "-R $i:localhost:$i"; done; echo "-R ${j}022:localhost:22") |
| 14 | 14 | ||
| 15 | echo "port forward is available on port {j}00x" | ||
| 16 | |||
| 15 | #seperate all the files | 17 | #seperate all the files |
| @@ -5,21 +5,15 @@ echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config | |||
| 5 | echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config | 5 | echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config |
| 6 | 6 | ||
| 7 | sudo dnf install -y git | 7 | sudo dnf install -y git |
| 8 | git clone https://git.0nom.ch/keys ~/ | 8 | git clone https://git.0nom.ch/keys ~/keys |
| 9 | mkdir -p "~/.ssh" | 9 | ~/keys/add-ssh-keys.sh |
| 10 | touch "~/.ssh/authorized_keys" | ||
| 11 | find "~/keys" -name "*.pub" -type f -print0 | while IFS= read -r -d '' file; do | ||
| 12 | echo "Adding key from file: $file" | ||
| 13 | cat "$file" >> "~/.ssh/authorized_keys" | ||
| 14 | echo "" >> "~/.ssh/authorized_keys" # Add a newline after each key | ||
| 15 | done | ||
| 16 | 10 | ||
| 17 | #install packages | 11 | #install packages |
| 18 | sudo dnf install -y epel-release dnf-utils | 12 | sudo dnf install -y epel-release dnf-utils |
| 19 | sudo dnf install -y nc openssl autossh tmux htop tar bmon gzip tree wget curl mlocate nano vim unzip net-tools git python3 python3-pip make wireguard-tools usbutils yum | 13 | sudo dnf install -y nc openssl autossh tmux htop tar bmon gzip tree wget curl mlocate nano vim unzip net-tools git python3 python3-pip make wireguard-tools usbutils yum |
| 20 | #sudo yum install -y python3-openstackclient s3fs-fuse awscli | 14 | #sudo yum install -y python3-openstackclient s3fs-fuse awscli |
| 21 | #pip install jupyterlab python-swiftclient | 15 | #pip install jupyterlab python-swiftclient |
| 22 | sudo dnf update -y | 16 | #sudo dnf update -y |
| 23 | 17 | ||
| 24 | cat << EOF >> /etc/vimrc | 18 | cat << EOF >> /etc/vimrc |
| 25 | augroup netcat_clipboard | 19 | augroup netcat_clipboard |
| @@ -34,6 +28,7 @@ set wrap | |||
| 34 | set breakindent | 28 | set breakindent |
| 35 | set breakindentopt=shift:3 | 29 | set breakindentopt=shift:3 |
| 36 | 30 | ||
| 31 | syntax on | ||
| 37 | set autoindent | 32 | set autoindent |
| 38 | set number | 33 | set number |
| 39 | set mouse=a | 34 | set mouse=a |
| @@ -41,8 +36,14 @@ set expandtab | |||
| 41 | set shiftwidth=2 | 36 | set shiftwidth=2 |
| 42 | set softtabstop=2 | 37 | set softtabstop=2 |
| 43 | set tabstop=2 | 38 | set tabstop=2 |
| 39 | syntax on | ||
| 44 | EOF | 40 | EOF |
| 45 | 41 | ||
| 46 | # add check fro each component | 42 | # add check fro each component |
| 47 | 43 | ||
| 48 | # then git clone work directory, or git clone altogether | 44 | # then git clone work directory, or git clone altogether |
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | |||
| 49 | |||
