From c332cf11dc0266f31eeae067ace5a9bda18122c6 Mon Sep 17 00:00:00 2001 From: Super User Date: Mon, 23 Mar 2026 19:09:37 +0800 Subject: flatten setup directory structure --- core/install-packages.sh | 27 +++++++++++++++++ core/packages/install_claude.sh | 8 +++++ core/packages/install_rust.sh | 7 +++++ core/ssh.sh | 12 ++++++++ core/tmux.conf | 11 +++++++ core/tmux.sh | 5 ++++ core/vim.sh | 66 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 136 insertions(+) create mode 100755 core/install-packages.sh create mode 100755 core/packages/install_claude.sh create mode 100755 core/packages/install_rust.sh create mode 100755 core/ssh.sh create mode 100644 core/tmux.conf create mode 100755 core/tmux.sh create mode 100755 core/vim.sh (limited to 'core') 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 @@ +#!/bin/bash + +# Install core packages +sudo dnf install -y epel-release +#sudo dnf group install -y "Development Tools" +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 +sudo dnf install -y xclip + +sudo dnf install -y gcc gcc-c++ openssl-devel +sudo dnf install -y java-latest-openjdk-devel +#sudo dnf install -y asio-devel boost-devel openssl-devel + +# Execute all package installation scripts +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +for script in "$SCRIPT_DIR/packages"/*.sh; do + if [ -f "$script" ]; then + "$script" + fi +done + +#install packages ml +#pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 +#pip3 install transformers + +#sudo yum install -y python3-openstackclient s3fs-fuse awscli +#pip install jupyterlab python-swiftclient +#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 @@ +#!/bin/bash +sudo dnf install -y tar +# Install Node.js via nvm and Claude Code +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" +nvm install 22 +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 @@ +#!/bin/bash + +# Install Rust and Cargo tools +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +echo '[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"' >> ~/.bashrc +source "$HOME/.cargo/env" +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 @@ +#!/bin/bash + +dnf install -y git + +echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config +echo "AllowTcpForwarding yes" | sudo tee -a /etc/ssh/sshd_config +echo "GatewayPorts yes" | sudo tee -a /etc/ssh/sshd_config +echo "AllowAgentForwarding yes" | sudo tee -a /etc/ssh/sshd_config + +git clone https://git.noml.ch/keys/ ~/keys +~/keys/add-ssh-keys.sh +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 @@ +# Vi mode for copy +setw -g mode-keys vi + +# Mouse selection +set -g mouse on + +# v to start selection, y to yank (like vim) +bind-key -T copy-mode-vi v send-keys -X begin-selection +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" +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" +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 @@ +#!/bin/bash + +cd "$(dirname "${BASH_SOURCE[0]}")" || exit + +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 @@ +#!/bin/bash + +cd "$(dirname "${BASH_SOURCE[0]}")" || exit + +VIMRC_PATH="/etc/vimrc" +[ -d /etc/vim ] && VIMRC_PATH="/etc/vim/vimrc" +CLIP_HOST="p.noml.ch" +CLIP_PORT="5023" +CLIP_CMD="openssl enc -aes-256-cbc -pbkdf2 -pass pass:YourPassword | nc -w 1 ${CLIP_HOST} ${CLIP_PORT}" + +grep -q 'netcat_clipboard' "$VIMRC_PATH" && exit 0 + +cat << EOF >> "$VIMRC_PATH" +augroup netcat_clipboard + au! + au TextYankPost * call system("echo " . shellescape(@") . " | ${CLIP_CMD} >/dev/null 2>&1 &") +augroup END + +" Enable line wrapping +set wrap + +" Optional: Make wrapped lines easier to read by indenting them +set breakindent +set breakindentopt=shift:1 + +syntax on +set mouse=a +set expandtab +set shiftwidth=4 +set softtabstop=4 +set tabstop=4 +set noautoindent +set nosmartindent +filetype plugin indent on + +set laststatus=2 " permanent status bar +set statusline=%F " shows full file path + +if (has("termguicolors")) + set termguicolors +endif + +"colorscheme murphy +colorscheme zellner + +" Ctrl+A: Move to the beginning of the line in INSERT mode +inoremap + +" Ctrl+E: Move to the end of the line in INSERT mode +inoremap + +" Ctrl+A: Move to the beginning of the line in NORMAL mode +nnoremap 0 + +" Ctrl+E: Move to the end of the line in NORMAL mode +nnoremap $ + +set number +setlocal regexpengine=2 +set paste +set foldcolumn=12 + +set noswapfile +autocmd InsertLeave * silent! update + +EOF -- cgit