README.md
· 1.9 KiB · Markdown
Sin formato
# **Ubuntu Development Environment Setup Script**
This bash script automatically configures a comprehensive development environment on Ubuntu/Debian systems. Here's what it accomplishes:
## Installation
### Curl
```sh
curl -fsSL https://opengist.internal.willithiel.net/wthiel/032ceca594884fce86ed8a6a32726bd2/raw/HEAD/bootstrap.sh | bash
```
### wget
```sh
wget -qO- https://opengist.internal.willithiel.net/wthiel/032ceca594884fce86ed8a6a32726bd2/raw/HEAD/bootstrap.sh | bash
```
## **System Updates & Essential Tools**
- Updates package repositories
- Installs core development tools: `build-essential`, `git`, `zsh`, `htop`, `tmux`
## **Advanced Shell Configuration**
| Component | Purpose | Configuration |
|-----------|---------|---------------|
| **Oh My Zsh** | Enhanced Zsh framework | Installs from official repository |
| **Powerlevel10k** | Advanced shell theme | Custom prompt with host, directory, git status, virtualenv |
| **Syntax Highlighting** | Command syntax coloring | System package installation |
| **Auto-suggestions** | Command completion | Plugin integration |
## **Vim Editor Enhancement**
- Installs Vim with `exuberant-ctags` support
- Deploys `timss/vimconf` configuration for enhanced editing experience
- Creates symbolic links for configuration files
## **Security & Access Configuration**
- **Passwordless Sudo**: Grants the current user unrestricted sudo access without password prompts
- **SSH Key Installation**: Adds a predefined Ed25519 public key to `authorized_keys` for remote access
- Sets appropriate file permissions (700 for `.ssh`, 600 for `authorized_keys`)
## **Key Features**
- **Automated Setup**: Complete hands-off installation
- **Developer-Focused**: Tools optimized for coding and system administration
- **Security Integration**: SSH key deployment for remote access
- **Shell Customization**: Modern, feature-rich terminal experience
Ubuntu Development Environment Setup Script
This bash script automatically configures a comprehensive development environment on Ubuntu/Debian systems. Here's what it accomplishes:
Installation
Curl
curl -fsSL https://opengist.internal.willithiel.net/wthiel/032ceca594884fce86ed8a6a32726bd2/raw/HEAD/bootstrap.sh | bash
wget
wget -qO- https://opengist.internal.willithiel.net/wthiel/032ceca594884fce86ed8a6a32726bd2/raw/HEAD/bootstrap.sh | bash
System Updates & Essential Tools
- Updates package repositories
- Installs core development tools:
build-essential,git,zsh,htop,tmux
Advanced Shell Configuration
| Component | Purpose | Configuration |
|---|---|---|
| Oh My Zsh | Enhanced Zsh framework | Installs from official repository |
| Powerlevel10k | Advanced shell theme | Custom prompt with host, directory, git status, virtualenv |
| Syntax Highlighting | Command syntax coloring | System package installation |
| Auto-suggestions | Command completion | Plugin integration |
Vim Editor Enhancement
- Installs Vim with
exuberant-ctagssupport - Deploys
timss/vimconfconfiguration for enhanced editing experience - Creates symbolic links for configuration files
Security & Access Configuration
- Passwordless Sudo: Grants the current user unrestricted sudo access without password prompts
- SSH Key Installation: Adds a predefined Ed25519 public key to
authorized_keysfor remote access - Sets appropriate file permissions (700 for
.ssh, 600 forauthorized_keys)
Key Features
- Automated Setup: Complete hands-off installation
- Developer-Focused: Tools optimized for coding and system administration
- Security Integration: SSH key deployment for remote access
- Shell Customization: Modern, feature-rich terminal experience
bootstrap.sh
· 1.8 KiB · Bash
Sin formato
#!/bin/bash
# Update packages, install essentials
sudo apt update
sudo apt install -y build-essential git zsh htop tmux
# Enable mouse scrolling in tmux
echo "setw -g mouse on" >> ~/.tmux.conf
# Install: oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# Install Powerlevel10k
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"
sed -i -- 's/ZSH_THEME="robbyrussell"/plugins=(virtualenv)\nPOWERLEVEL9K_CUSTOM_LIVE_BACKGROUND="red"\nPOWERLEVEL9K_CUSTOM_LIVE_FOREGROUND="white"\nPOWERLEVEL9K_MODE="nerdfont-complete"\nPOWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_live host dir vcs virtualenv)\nPOWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs load ram disk_usage time)\nZSH_THEME="powerlevel10k\/powerlevel10k"\n/g' ~/.zshrc
# zsh-syntax-highlighting
sudo apt install zsh-syntax-highlighting
echo "source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
# zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sed -i -- 's/^plugins=(/plugins=(\n zsh-autosuggestions\n/g' ~/.zshrc
# Install: timss/vimconf (https://github.com/timss/vimconf#installation)
sudo apt install -y vim exuberant-ctags
mkdir -p ~/.vim/vimconf
git clone https://github.com/timss/vimconf.git ~/.vim/vimconf
ln -s ~/.vim/vimconf/.vimrc ~/.vimrc
# Add user to sudoers with no password
echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER
sudo chmod 440 /etc/sudoers.d/$USER
# Install public key
KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILB5bVuBHYwgtCL+ppoOkKSpu/+wmSOt80yVE/S2qU0F"
mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo "$KEY" >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys
| 1 | #!/bin/bash |
| 2 | |
| 3 | # Update packages, install essentials |
| 4 | sudo apt update |
| 5 | sudo apt install -y build-essential git zsh htop tmux |
| 6 | |
| 7 | # Enable mouse scrolling in tmux |
| 8 | echo "setw -g mouse on" >> ~/.tmux.conf |
| 9 | |
| 10 | # Install: oh-my-zsh |
| 11 | sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
| 12 | |
| 13 | # Install Powerlevel10k |
| 14 | git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" |
| 15 | sed -i -- 's/ZSH_THEME="robbyrussell"/plugins=(virtualenv)\nPOWERLEVEL9K_CUSTOM_LIVE_BACKGROUND="red"\nPOWERLEVEL9K_CUSTOM_LIVE_FOREGROUND="white"\nPOWERLEVEL9K_MODE="nerdfont-complete"\nPOWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(custom_live host dir vcs virtualenv)\nPOWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs load ram disk_usage time)\nZSH_THEME="powerlevel10k\/powerlevel10k"\n/g' ~/.zshrc |
| 16 | |
| 17 | # zsh-syntax-highlighting |
| 18 | sudo apt install zsh-syntax-highlighting |
| 19 | echo "source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc |
| 20 | |
| 21 | # zsh-autosuggestions |
| 22 | git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
| 23 | sed -i -- 's/^plugins=(/plugins=(\n zsh-autosuggestions\n/g' ~/.zshrc |
| 24 | |
| 25 | # Install: timss/vimconf (https://github.com/timss/vimconf#installation) |
| 26 | sudo apt install -y vim exuberant-ctags |
| 27 | mkdir -p ~/.vim/vimconf |
| 28 | git clone https://github.com/timss/vimconf.git ~/.vim/vimconf |
| 29 | ln -s ~/.vim/vimconf/.vimrc ~/.vimrc |
| 30 | |
| 31 | # Add user to sudoers with no password |
| 32 | echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER |
| 33 | sudo chmod 440 /etc/sudoers.d/$USER |
| 34 | |
| 35 | # Install public key |
| 36 | KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILB5bVuBHYwgtCL+ppoOkKSpu/+wmSOt80yVE/S2qU0F" |
| 37 | mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo "$KEY" >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys |
| 38 |