diff options
| author | Super User <root@p.noml.ch> | 2026-03-23 19:09:37 +0800 |
|---|---|---|
| committer | Super User <root@p.noml.ch> | 2026-03-23 19:09:37 +0800 |
| commit | c332cf11dc0266f31eeae067ace5a9bda18122c6 (patch) | |
| tree | e4934d0f83aa1c7138e9b22efea97d5bf67ad905 /core | |
| parent | dea4663f14bcb1703aa616ad05172667e452e701 (diff) | |
flatten setup directory structure
Diffstat (limited to 'core')
| -rwxr-xr-x | core/install-packages.sh | 27 | ||||
| -rwxr-xr-x | core/packages/install_claude.sh | 8 | ||||
| -rwxr-xr-x | core/packages/install_rust.sh | 7 | ||||
| -rwxr-xr-x | core/ssh.sh | 12 | ||||
| -rw-r--r-- | core/tmux.conf | 11 | ||||
| -rwxr-xr-x | core/tmux.sh | 5 | ||||
| -rwxr-xr-x | core/vim.sh | 66 |
7 files changed, 136 insertions, 0 deletions
diff --git a/core/install-packages.sh b/core/install-packages.sh new file mode 100755 index 0000000..fb0a75d --- /dev/null +++ b/core/install-packages.sh | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # Install core packages | ||
| 4 | sudo dnf install -y epel-release | ||
| 5 | #sudo dnf group install -y "Development Tools" | ||
| 6 | sudo dnf install -y nc openssl bat autossh tmux htop tar bmon gzip tree wget curl plocate nano vim unzip net-tools git python3 python3-pip make wireguard-tools usbutils yum | ||
| 7 | sudo dnf install -y xclip | ||
| 8 | |||
| 9 | sudo dnf install -y gcc gcc-c++ openssl-devel | ||
| 10 | sudo dnf install -y java-latest-openjdk-devel | ||
| 11 | #sudo dnf install -y asio-devel boost-devel openssl-devel | ||
| 12 | |||
| 13 | # Execute all package installation scripts | ||
| 14 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 15 | for script in "$SCRIPT_DIR/packages"/*.sh; do | ||
| 16 | if [ -f "$script" ]; then | ||
| 17 | "$script" | ||
| 18 | fi | ||
| 19 | done | ||
| 20 | |||
| 21 | #install packages ml | ||
| 22 | #pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 | ||
| 23 | #pip3 install transformers | ||
| 24 | |||
| 25 | #sudo yum install -y python3-openstackclient s3fs-fuse awscli | ||
| 26 | #pip install jupyterlab python-swiftclient | ||
| 27 | #sudo dnf update -y | ||
diff --git a/core/packages/install_claude.sh b/core/packages/install_claude.sh new file mode 100755 index 0000000..99a881d --- /dev/null +++ b/core/packages/install_claude.sh | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | sudo dnf install -y tar | ||
| 3 | # Install Node.js via nvm and Claude Code | ||
| 4 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash | ||
| 5 | export NVM_DIR="$HOME/.nvm" | ||
| 6 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | ||
| 7 | nvm install 22 | ||
| 8 | npm install -g @anthropic-ai/claude-code | ||
diff --git a/core/packages/install_rust.sh b/core/packages/install_rust.sh new file mode 100755 index 0000000..921a533 --- /dev/null +++ b/core/packages/install_rust.sh | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # Install Rust and Cargo tools | ||
| 4 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
| 5 | echo '[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"' >> ~/.bashrc | ||
| 6 | source "$HOME/.cargo/env" | ||
| 7 | cargo install cargo-clone-crate cargo-edit cargo-info evcxr_jupyter bacon du-dust ripgrep bandwhich | ||
diff --git a/core/ssh.sh b/core/ssh.sh new file mode 100755 index 0000000..c4454ae --- /dev/null +++ b/core/ssh.sh | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | dnf install -y git | ||
| 4 | |||
| 5 | echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config | ||
| 6 | echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config | ||
| 7 | echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config | ||
| 8 | echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config | ||
| 9 | |||
| 10 | git clone https://git.noml.ch/keys/ ~/keys | ||
| 11 | ~/keys/add-ssh-keys.sh | ||
| 12 | sudo systemctl restart sshd | ||
diff --git a/core/tmux.conf b/core/tmux.conf new file mode 100644 index 0000000..f01bf59 --- /dev/null +++ b/core/tmux.conf | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # Vi mode for copy | ||
| 2 | setw -g mode-keys vi | ||
| 3 | |||
| 4 | # Mouse selection | ||
| 5 | set -g mouse on | ||
| 6 | |||
| 7 | # v to start selection, y to yank (like vim) | ||
| 8 | bind-key -T copy-mode-vi v send-keys -X begin-selection | ||
| 9 | bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" | ||
| 10 | bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" | ||
| 11 | bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 p.noml.ch 5023 >/dev/null 2>&1" | ||
diff --git a/core/tmux.sh b/core/tmux.sh new file mode 100755 index 0000000..1e5d3db --- /dev/null +++ b/core/tmux.sh | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit | ||
| 4 | |||
| 5 | cp tmux.conf /etc/tmux.conf | ||
diff --git a/core/vim.sh b/core/vim.sh new file mode 100755 index 0000000..bd99a13 --- /dev/null +++ b/core/vim.sh | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | cd "$(dirname "${BASH_SOURCE[0]}")" || exit | ||
| 4 | |||
| 5 | VIMRC_PATH="/etc/vimrc" | ||
| 6 | [ -d /etc/vim ] && VIMRC_PATH="/etc/vim/vimrc" | ||
| 7 | CLIP_HOST="p.noml.ch" | ||
| 8 | CLIP_PORT="5023" | ||
| 9 | CLIP_CMD="openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 ${CLIP_HOST} ${CLIP_PORT}" | ||
| 10 | |||
| 11 | grep -q 'netcat_clipboard' "$VIMRC_PATH" && exit 0 | ||
| 12 | |||
| 13 | cat << EOF >> "$VIMRC_PATH" | ||
| 14 | augroup netcat_clipboard | ||
| 15 | au! | ||
| 16 | au TextYankPost * call system("echo " . shellescape(@") . " | ${CLIP_CMD} >/dev/null 2>&1 &") | ||
| 17 | augroup END | ||
| 18 | |||
| 19 | " Enable line wrapping | ||
| 20 | set wrap | ||
| 21 | |||
| 22 | " Optional: Make wrapped lines easier to read by indenting them | ||
| 23 | set breakindent | ||
| 24 | set breakindentopt=shift:1 | ||
| 25 | |||
| 26 | syntax on | ||
| 27 | set mouse=a | ||
| 28 | set expandtab | ||
| 29 | set shiftwidth=4 | ||
| 30 | set softtabstop=4 | ||
| 31 | set tabstop=4 | ||
| 32 | set noautoindent | ||
| 33 | set nosmartindent | ||
| 34 | filetype plugin indent on | ||
| 35 | |||
| 36 | set laststatus=2 " permanent status bar | ||
| 37 | set statusline=%F " shows full file path | ||
| 38 | |||
| 39 | if (has("termguicolors")) | ||
| 40 | set termguicolors | ||
| 41 | endif | ||
| 42 | |||
| 43 | "colorscheme murphy | ||
| 44 | colorscheme zellner | ||
| 45 | |||
| 46 | " Ctrl+A: Move to the beginning of the line in INSERT mode | ||
| 47 | inoremap <C-a> <Home> | ||
| 48 | |||
| 49 | " Ctrl+E: Move to the end of the line in INSERT mode | ||
| 50 | inoremap <C-e> <End> | ||
| 51 | |||
| 52 | " Ctrl+A: Move to the beginning of the line in NORMAL mode | ||
| 53 | nnoremap <C-a> 0 | ||
| 54 | |||
| 55 | " Ctrl+E: Move to the end of the line in NORMAL mode | ||
| 56 | nnoremap <C-e> $ | ||
| 57 | |||
| 58 | set number | ||
| 59 | setlocal regexpengine=2 | ||
| 60 | set paste | ||
| 61 | set foldcolumn=12 | ||
| 62 | |||
| 63 | set noswapfile | ||
| 64 | autocmd InsertLeave * silent! update | ||
| 65 | |||
| 66 | EOF | ||
