summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhc <hc@email.ch>2024-09-16 00:39:16 +0800
committerhc <hc@email.ch>2024-09-16 00:39:16 +0800
commit6cac00448b81bb1115abaa5d7d335c8450c9ee25 (patch)
treef58582e44076d0731dcb696b873f8e64ee8f9e18
parent00cde1e081c2a31ddc5876d52342888c0926af7a (diff)
0039
-rw-r--r--port-forward/ssh-port-forward.sh14
-rw-r--r--setup.sh15
2 files changed, 18 insertions, 11 deletions
diff --git a/port-forward/ssh-port-forward.sh b/port-forward/ssh-port-forward.sh
new file mode 100644
index 0000000..5a0d955
--- /dev/null
+++ b/port-forward/ssh-port-forward.sh
@@ -0,0 +1,14 @@
1#!/bin/bash
2
3j=$1
4HOST="p.0nom.ch"
5KEY_FILE="m"
6
7# get the process holding the specified port and kill it
8echo "cleaning management port..."
9ssh -i "$KEY_FILE" "$HOST" "ss -tunlp | grep :${j}022 | awk '{print $NF}' | sed 's/.*pid=\([^,]*\).*/\1/' | head -n1 | xargs kill -9"
10echo "cleaning attempted."
11
12j=6; ssh -i m sg1.0nom.ch $(for i in $(seq ${j}000 ${j}005); do echo "-R $i:localhost:$i"; done; echo "-R ${j}022:localhost:22")
13
14#seperate all the files
diff --git a/setup.sh b/setup.sh
index 8530667..fccfeb8 100644
--- a/setup.sh
+++ b/setup.sh
@@ -8,12 +8,12 @@ echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config
8#install packages 8#install packages
9sudo dnf install -y epel-release dnf-utils 9sudo dnf install -y epel-release dnf-utils
10sudo dnf install -y nc autossh tmux htop tar bmon gzip tree wget curl mlocate nano vim unzip net-tools git python3 python3-pip make wireguard-tools iptables usbutils yum 10sudo dnf install -y nc autossh tmux htop tar bmon gzip tree wget curl mlocate nano vim unzip net-tools git python3 python3-pip make wireguard-tools iptables usbutils yum
11sudo yum install -y python3-openstackclient s3fs-fuse awscli 11#sudo yum install -y python3-openstackclient s3fs-fuse awscli
12pip install jupyterlab python-swiftclient 12#pip install jupyterlab python-swiftclient
13sudo dnf update -y 13sudo dnf update -y
14 14
15#install nvim 15#install nvim
16sudo dnf groupinstall "Development Tools" 16sudo dnf groupinstall -y "Development Tools"
17sudo dnf install -y cmake 17sudo dnf install -y cmake
18cd ~ 18cd ~
19git clone https://github.com/neovim/neovim 19git clone https://github.com/neovim/neovim
@@ -56,14 +56,7 @@ vim.api.nvim_create_autocmd("BufWritePost", {
56}) 56})
57EOF 57EOF
58 58
59#install font for lvim 59
60curl -OL https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.tar.xz
61mkdir JetBrainsMono
62tar -xvf JetBrainsMono.tar.xz -C JetBrainsMono
63mkdir -p ~/.local/share/fonts
64mv JetBrainsMono/*.ttf ~/.local/share/fonts/
65fc-cache -f -v
66rm -rf JetBrainsMono
67 60
68 61
69# add check fro each component 62# add check fro each component