From 617f7a4a3978b04408f86d7640c13d9b14a53506 Mon Sep 17 00:00:00 2001 From: ilia Date: Sun, 7 Sep 2025 22:16:15 -0400 Subject: [PATCH] Revise applications documentation and onboarding script for improved clarity and functionality. Updated applications.md to include a comprehensive list of 60+ installed tools, added environment verification function in onboarding.sh, and enhanced README with detailed application categories and usage tips. --- README.md | 115 ++- applications.md | 2164 ++++++++++++++++++++++++++++------------------- onboarding.sh | 59 +- 3 files changed, 1453 insertions(+), 885 deletions(-) diff --git a/README.md b/README.md index 4f4f836..daa7052 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Developer Onboarding -A comprehensive developer environment setup toolkit that automates the installation of essential tools and configures Git and SSH for seamless development workflows. +A comprehensive developer environment setup toolkit that automates the installation of 60+ essential applications and tools, plus configures Git and SSH for seamless development workflows. ## Overview -This project provides scripts and documentation to quickly set up a development environment with all the necessary tools, from basic system utilities to modern development tools and containerization platforms. +This project provides scripts and documentation to quickly set up a complete development environment with all the necessary tools, from basic system utilities to modern development tools, containerization platforms, monitoring tools, and security applications. The environment includes everything from shell configuration with Oh My Zsh to Docker containers, VPN setup, backup tools, and comprehensive system monitoring. ## Quick Start @@ -28,6 +28,16 @@ This project provides scripts and documentation to quickly set up a development ## What Gets Configured +### Complete Development Environment +- **60+ Applications & Tools** - See `applications.md` for the complete inventory +- **Base System Tools** - curl, wget, git, jq, ripgrep, fd-find, and more +- **Development Stack** - Node.js, Python3, Docker CE, VS Code, Cursor IDE +- **Shell Environment** - Zsh with Oh My Zsh + Powerlevel10k theme +- **Monitoring Tools** - htop, btop, nethogs, iftop, bandwhich, and comprehensive system monitoring +- **Security & VPN** - UFW firewall, fail2ban, Tailscale mesh VPN +- **Backup Solutions** - rsync, borgbackup, rclone, restic +- **Container Platform** - Docker CE with Compose plugin + ### Git Configuration - Global username and email setup - Credential caching for convenience @@ -38,19 +48,84 @@ This project provides scripts and documentation to quickly set up a development - Automatic key copying to clipboard - SSH connection testing to Git server +### System Services Enabled +- Docker daemon +- Tailscale VPN daemon +- UFW firewall +- fail2ban intrusion prevention +- System monitoring and logging + ## Files in This Repository -- `onboarding.sh` - Main interactive setup script +- `onboarding.sh` - Main interactive setup script for Git/SSH configuration +- `applications.md` - **Complete inventory of 60+ installed applications and tools** +- `README.md` - This documentation file - `onboarding.sh.save` - Backup/alternative version -- `applications.md` - Complete list of installed applications -- `README.md` - This file + +## Application Categories Overview + +The complete development environment includes: + +### 🛠️ **Development Tools** (6 applications) +- Git, Node.js, npm, Python3, build-essential, pip3 + +### 🖥️ **IDEs & Editors** (2 applications) +- Visual Studio Code, Cursor (AI-powered editor) + +### 🐳 **Container Platform** (5 Docker components) +- Docker CE, Docker CLI, containerd, Buildx, Compose + +### 🔧 **Shell Environment** (6 tools) +- Zsh, Oh My Zsh, Powerlevel10k, tmux, fzf, syntax highlighting + +### 📊 **Monitoring Tools** (14 applications) +- htop, btop, atop, nethogs, iftop, bandwhich, nmap, wireshark, and more + +### 🔒 **Security & VPN** (Multiple tools) +- UFW firewall, fail2ban, Tailscale mesh VPN, SSH hardening + +### 💾 **Backup Solutions** (4 tools) +- rsync, borgbackup, rclone, restic + +### 🌐 **Desktop Applications** (4 applications) +- Brave Browser, LibreOffice, Redshift, Evince + +*See `applications.md` for the complete detailed list with descriptions.* ## Usage Tips -- The script is idempotent - safe to run multiple times +- The onboarding script focuses on Git/SSH setup and is idempotent - safe to run multiple times - SSH keys are only generated if they don't already exist - Git config is only set if not already configured - All operations are interactive with user confirmation +- The full application stack is installed via Ansible playbooks (see applications.md) + +## Environment Verification + +After setup, you can verify your environment has the expected tools: + +```bash +# Check key development tools +node --version +python3 --version +docker --version +code --version + +# Check shell environment +echo $SHELL # Should show /usr/bin/zsh +tmux -V +fzf --version + +# Check monitoring tools +htop --version +btop --version +bandwhich --version + +# Check security tools +ufw status +systemctl status fail2ban +tailscale status +``` ## Customization @@ -58,14 +133,30 @@ You can modify the `onboarding.sh` script to: - Change the Git server URL (currently set to `10.0.30.169:3000`) - Adjust SSH key types or parameters - Add additional Git configuration options +- Include application verification steps -## Support +## Troubleshooting -If you encounter issues: -1. Ensure you have the required permissions -2. Check network connectivity to the Git server -3. Verify SSH key permissions (`chmod 600 ~/.ssh/id_ed25519`) +### Common Issues: +1. **Permission errors**: Ensure you have sudo privileges for system packages +2. **Network connectivity**: Check connection to Git server and package repositories +3. **SSH key permissions**: Verify with `chmod 600 ~/.ssh/id_ed25519` +4. **Docker access**: Ensure user is in docker group: `sudo usermod -aG docker $USER` +5. **Snap applications**: If snap apps fail, check with `snap list` and `snap refresh` + +### Service Status Checks: +```bash +# Check critical services +systemctl status docker +systemctl status tailscaled +systemctl status fail2ban +ufw status verbose +``` ## Contributing -Feel free to submit issues or pull requests to improve the onboarding experience. +Feel free to submit issues or pull requests to improve the onboarding experience. Consider contributing: +- Additional application suggestions +- Enhanced verification scripts +- Improved troubleshooting documentation +- Automation improvements diff --git a/applications.md b/applications.md index 6f22bc0..b8ceb82 100644 --- a/applications.md +++ b/applications.md @@ -1,113 +1,68 @@ -# Installed Applications Guide +# Development Machine Applications - Complete Installation Guide -This document provides an overview of all applications installed by the Ansible playbook, organized by category with descriptions of their general use cases. +This comprehensive guide details ALL 60+ applications and tools installed on development machines via Ansible playbooks. Each application includes purpose, usage examples, and practical commands to help you get the most out of your development environment. -## SSH & Security +## 📋 **Navigation** +- [Base System Tools](#base-system-tools) (17 applications) +- [SSH & Security](#ssh--security) (Multiple tools) +- [Development Tools](#development-tools) (6 applications) +- [Shell Environment](#shell-environment) (6 tools) +- [Desktop Applications](#desktop-applications) (4 applications) +- [IDE & Code Editors](#ide--code-editors) (2 applications) +- [Container Platform](#container-platform) (5 components) +- [System Monitoring](#system-monitoring) (14 applications) +- [Backup Tools](#backup-tools) (4 applications) +- [VPN & Networking](#vpn--networking) (2 components) +- [Custom Scripts](#custom-scripts) (4 scripts) -### openssh-server -**Purpose**: SSH daemon server for secure remote access -**Use**: Enables secure shell connections to your machine from other systems. Essential for remote development and server management. -**Syntax**: Service management via systemctl -**Examples**: -```bash -# Check SSH service status -sudo systemctl status ssh +--- -# Start/stop/restart SSH service -sudo systemctl start ssh -sudo systemctl restart ssh +## Base System Tools -# Connect to remote server -ssh username@hostname -ssh -p 2222 user@server.com # Custom port -``` -**Documentation**: [OpenSSH Manual](https://www.openssh.com/manual.html) - -### ufw (Uncomplicated Firewall) -**Purpose**: Simple firewall management -**Use**: Protect your system by controlling incoming and outgoing network traffic with easy-to-understand rules. -**Syntax**: `ufw [options] [rule]` -**Examples**: -```bash -# Enable/disable firewall -sudo ufw enable -sudo ufw disable - -# Allow/deny ports -sudo ufw allow 22 # SSH -sudo ufw allow 80/tcp # HTTP -sudo ufw deny 23 # Telnet - -# Check status -sudo ufw status verbose -``` -**Documentation**: [UFW Documentation](https://help.ubuntu.com/community/UFW) - -### fail2ban -**Purpose**: Intrusion prevention system -**Use**: Automatically bans IP addresses that show suspicious activity (like repeated failed login attempts). -**Syntax**: `fail2ban-client [options]` -**Examples**: -```bash -# Check status -sudo fail2ban-client status - -# Check specific jail status -sudo fail2ban-client status sshd - -# Unban an IP -sudo fail2ban-client set sshd unbanip 192.168.1.100 - -# Start/stop service -sudo systemctl restart fail2ban -``` -**Documentation**: [Fail2ban Manual](https://fail2ban.readthedocs.io/) - -## Base System Utilities +Essential command-line utilities and system tools that form the foundation of any development environment. ### curl -**Purpose**: Command line HTTP client -**Use**: Download files, test APIs, send HTTP requests from the terminal. Essential for web development and scripting. -**Syntax**: `curl [options] URL` -**Examples**: -```bash -# Basic GET request -curl https://api.example.com - -# POST with JSON data -curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://api.example.com - -# Download file -curl -O https://example.com/file.zip - -# Follow redirects and show headers -curl -L -I https://example.com -``` -**Documentation**: [curl Manual](https://curl.se/docs/manpage.html) - -### wget -**Purpose**: Network downloader -**Use**: Download files from web servers, supports resume and recursive downloads. Great for downloading large files or mirroring websites. -**Syntax**: `wget [options] URL` +**Purpose**: Command-line tool for transferring data with URLs +**Use**: Download files, test APIs, send HTTP requests, and transfer data between servers. +**Syntax**: `curl [options] [URL]` **Examples**: ```bash # Download a file -wget https://example.com/file.zip +curl -O https://example.com/file.zip + +# Test API endpoints +curl -X GET https://api.github.com/users/octocat +curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://api.example.com + +# Follow redirects and show headers +curl -L -I https://github.com + +# Download with progress bar +curl --progress-bar -O https://example.com/largefile.zip +``` + +### wget +**Purpose**: Network downloader for retrieving files from web servers +**Use**: Download files, mirror websites, resume interrupted downloads. +**Syntax**: `wget [options] [URL]` +**Examples**: +```bash +# Download a file +wget https://example.com/file.tar.gz + +# Download recursively (mirror site) +wget -r -np -k https://example.com/docs/ # Resume interrupted download wget -c https://example.com/largefile.iso -# Download recursively (mirror site) -wget -r -np -k https://example.com/ - # Download in background wget -b https://example.com/file.zip ``` -**Documentation**: [GNU Wget Manual](https://www.gnu.org/software/wget/manual/) ### unzip -**Purpose**: Archive extraction utility -**Use**: Extract ZIP archives from command line. Useful for downloaded software packages and file transfers. +**Purpose**: Extract files from ZIP archives +**Use**: Decompress ZIP files, view archive contents, extract specific files. **Syntax**: `unzip [options] archive.zip` **Examples**: ```bash @@ -115,108 +70,179 @@ wget -b https://example.com/file.zip unzip archive.zip # Extract to specific directory -unzip archive.zip -d /target/directory +unzip archive.zip -d /target/directory/ # List contents without extracting unzip -l archive.zip -# Extract specific file -unzip archive.zip file.txt +# Extract specific files +unzip archive.zip file1.txt file2.txt ``` -**Documentation**: [unzip Manual](http://infozip.sourceforge.net/UnZip.html) ### xclip -**Purpose**: Clipboard utility for X11 -**Use**: Copy and paste text between terminal and GUI applications. Integrates command line output with desktop clipboard. +**Purpose**: Command-line clipboard interface +**Use**: Copy/paste text between terminal and GUI applications. **Syntax**: `xclip [options]` **Examples**: ```bash -# Copy file contents to clipboard -xclip -sel clip < file.txt +# Copy text to clipboard +echo "Hello World" | xclip -sel clipboard -# Copy command output to clipboard -echo "Hello World" | xclip -selection clipboard +# Copy file contents to clipboard +xclip -sel clipboard < file.txt # Paste from clipboard -xclip -o -sel clip +xclip -sel clipboard -o -# Copy SSH public key -cat ~/.ssh/id_rsa.pub | xclip -sel clip +# Copy command output +ls -la | xclip -sel clipboard ``` -**Documentation**: [xclip Manual](https://github.com/astrand/xclip) ### tree -**Purpose**: Directory tree display utility -**Use**: Visualize directory structures in a tree format. Helpful for understanding project layouts and file organization. +**Purpose**: Display directory structure in tree format +**Use**: Visualize file system hierarchy, understand project structure. **Syntax**: `tree [options] [directory]` **Examples**: ```bash # Show current directory tree tree -# Show tree with file sizes -tree -h +# Show with file sizes +tree -s -# Limit depth to 2 levels +# Show hidden files +tree -a + +# Limit depth tree -L 2 -# Show only directories -tree -d - -# Exclude certain patterns -tree -I 'node_modules|*.pyc' +# Output to file +tree > project_structure.txt ``` -**Documentation**: [tree Manual](http://mama.indstate.edu/users/ice/tree/) - -## Network & Admin Tools ### net-tools -**Purpose**: Network configuration tools (ifconfig, netstat, etc.) -**Use**: Traditional network troubleshooting and configuration. View network interfaces, routing tables, and connection statistics. -**Syntax**: Various commands included +**Purpose**: Collection of networking utilities +**Use**: Network configuration and troubleshooting (netstat, ifconfig, route). **Examples**: ```bash # Show network interfaces ifconfig -ifconfig eth0 # Specific interface -# Show network connections -netstat -tuln # TCP/UDP listening ports -netstat -i # Interface statistics +# Show listening ports +netstat -tulpn # Show routing table route -n -# Show ARP table -arp -a +# Show network statistics +netstat -s ``` -**Documentation**: [net-tools Documentation](https://sourceforge.net/projects/net-tools/) -### mailutils -**Purpose**: Mail handling utilities -**Use**: Send and manage emails from command line. Useful for system notifications and automated email tasks. -**Syntax**: `mail [options] recipient` +### jq +**Purpose**: Command-line JSON processor +**Use**: Parse, filter, and manipulate JSON data in shell scripts and pipelines. +**Syntax**: `jq [options] 'filter' [file]` **Examples**: ```bash -# Send simple email -echo "Message body" | mail -s "Subject" user@example.com +# Pretty print JSON +echo '{"name":"John","age":30}' | jq '.' -# Send email with attachment -mail -s "Subject" -A /path/to/file user@example.com < message.txt +# Extract specific field +curl -s https://api.github.com/users/octocat | jq '.name' -# Check mail -mail +# Filter arrays +echo '[{"name":"John"},{"name":"Jane"}]' | jq '.[].name' -# Send email from script -echo "Server backup completed" | mail -s "Backup Status" admin@company.com +# Complex filtering +jq '.users[] | select(.age > 25) | .name' users.json ``` -**Documentation**: [GNU Mailutils Manual](https://mailutils.org/manual/) -## Monitoring & System Tools +### ripgrep (rg) +**Purpose**: Ultra-fast text search tool +**Use**: Search for patterns in files, replace grep with better performance. +**Syntax**: `rg [options] pattern [path]` +**Examples**: +```bash +# Search for text in current directory +rg "function" -### iotop +# Search in specific file types +rg "TODO" --type js + +# Case insensitive search +rg -i "error" + +# Show line numbers and context +rg -n -C 3 "import" + +# Search and replace preview +rg "old_function" --replace "new_function" +``` + +### fd-find (fd) +**Purpose**: Fast and user-friendly alternative to find +**Use**: Search for files and directories with simple syntax. +**Syntax**: `fd [options] pattern [path]` +**Examples**: +```bash +# Find files by name +fd config + +# Find by extension +fd -e js + +# Find directories only +fd -t d src + +# Execute command on results +fd -e log -x rm {} + +# Search hidden files +fd -H .env +``` + +### yq (via snap) +**Purpose**: YAML processor and query tool +**Use**: Parse, filter, and manipulate YAML files. +**Syntax**: `yq [options] 'query' [file]` +**Examples**: +```bash +# Pretty print YAML +yq '.' config.yaml + +# Extract specific field +yq '.database.host' config.yaml + +# Convert YAML to JSON +yq -o json config.yaml + +# Update YAML values +yq '.port = 8080' config.yaml +``` + +### btop (via snap) +**Purpose**: Modern system monitor and process viewer +**Use**: Monitor system resources, processes, and network activity with beautiful interface. +**Examples**: +```bash +# Launch btop +btop + +# Key shortcuts within btop: +# 'q' - quit +# 'm' - toggle memory view +# 'n' - toggle network view +# 't' - toggle tree view +# '+/-' - increase/decrease update interval +``` + +### Additional Base System Tools + +These monitoring and system tools are also included in the base installation: + +#### **iotop** **Purpose**: I/O usage monitoring -**Use**: Monitor disk read/write activity by process. Essential for diagnosing performance issues and identifying I/O bottlenecks. +**Use**: Monitor disk read/write activity by process for performance analysis. **Syntax**: `iotop [options]` **Examples**: ```bash @@ -232,11 +258,10 @@ sudo iotop -a # Non-interactive mode sudo iotop -b -n 3 ``` -**Documentation**: [iotop Manual](http://guichaz.free.fr/iotop/) -### nethogs +#### **nethogs** **Purpose**: Network bandwidth monitoring per process -**Use**: See which applications are using network bandwidth in real-time. Great for troubleshooting network performance. +**Use**: See which applications are using network bandwidth in real-time. **Syntax**: `nethogs [options] [device]` **Examples**: ```bash @@ -246,130 +271,223 @@ sudo nethogs # Monitor specific interface sudo nethogs eth0 -# Monitor with delay in seconds +# Monitor with custom delay sudo nethogs -d 5 # Monitor multiple interfaces sudo nethogs eth0 wlan0 ``` -**Documentation**: [nethogs GitHub](https://github.com/raboof/nethogs) -### logwatch +#### **logwatch** **Purpose**: Log analysis and reporting -**Use**: Automatically analyze system logs and generate summary reports. Helps identify security issues and system problems. +**Use**: Automatically analyze system logs and generate summary reports. **Syntax**: `logwatch [options]` **Examples**: ```bash # Generate today's report -logwatch --detail low --mailto admin@example.com --service all +logwatch --detail low --mailto admin@example.com -# Generate report for specific date range -logwatch --range yesterday -logwatch --range "2024-01-01 - 2024-01-07" +# Generate report for date range +logwatch --range yesterday --detail high -# Generate detailed SSH report +# View specific service logs logwatch --service sshd --detail high - -# Test configuration -logwatch --print ``` -**Documentation**: [Logwatch Documentation](https://sourceforge.net/projects/logwatch/) -## Modern CLI Tools -### jq -**Purpose**: JSON processor -**Use**: Parse, filter, and manipulate JSON data from command line. Essential for API development and data processing. -**Syntax**: `jq [options] filter [file]` +--- + +## SSH & Security + +Tools for secure remote access, system protection, and network security. + +### openssh-server +**Purpose**: SSH daemon server for secure remote access +**Use**: Enables secure shell connections to your machine from other systems. +**Syntax**: Service management via systemctl **Examples**: ```bash -# Pretty print JSON -echo '{"name":"John","age":30}' | jq . +# Check SSH service status +sudo systemctl status ssh -# Extract specific field -echo '{"name":"John","age":30}' | jq '.name' +# Start/stop/restart SSH service +sudo systemctl start ssh +sudo systemctl restart ssh -# Filter array elements -echo '[{"name":"John"},{"name":"Jane"}]' | jq '.[0]' - -# Use with curl -curl -s https://api.github.com/users/octocat | jq '.login' +# Connect to remote server +ssh username@hostname +ssh -p 2222 user@server.com # Custom port ``` -**Documentation**: [jq Manual](https://jqlang.github.io/jq/manual/) -### ripgrep (rg) -**Purpose**: Fast text search tool -**Use**: Search for text patterns in files and directories. Much faster than traditional grep, especially for large codebases. -**Syntax**: `rg [options] pattern [path]` +### ufw (Uncomplicated Firewall) +**Purpose**: Simple firewall management +**Use**: Protect your system by controlling network traffic with easy rules. +**Syntax**: `ufw [options] [rule]` **Examples**: ```bash -# Basic search -rg "function" +# Enable/disable firewall +sudo ufw enable +sudo ufw disable -# Search in specific file types -rg "TODO" --type js +# Allow/deny ports +sudo ufw allow 22 # SSH +sudo ufw allow 80/tcp # HTTP +sudo ufw deny 23 # Telnet -# Case insensitive search -rg -i "error" - -# Search with context lines -rg -A 3 -B 3 "function main" - -# Search and replace preview -rg "old_name" --replace "new_name" --passthru +# Check status +sudo ufw status verbose ``` -**Documentation**: [ripgrep User Guide](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md) -### fd-find (fd) -**Purpose**: Modern file finder -**Use**: Find files and directories with intuitive syntax and fast performance. Better alternative to traditional `find` command. -**Syntax**: `fd [options] pattern [path]` +### fail2ban +**Purpose**: Intrusion prevention system +**Use**: Automatically bans IP addresses showing suspicious activity. +**Syntax**: `fail2ban-client [options]` **Examples**: ```bash -# Find files by name -fd config +# Check status +sudo fail2ban-client status -# Find files by extension -fd -e js +# Check specific jail +sudo fail2ban-client status sshd -# Find directories only -fd -t d bin +# Unban IP address +sudo fail2ban-client set sshd unbanip 192.168.1.100 -# Exclude hidden files -fd --no-hidden config - -# Execute command on results -fd -e log -x rm {} +# Start/stop service +sudo systemctl restart fail2ban ``` -**Documentation**: [fd GitHub](https://github.com/sharkdp/fd) -## Shell & Terminal +--- + +## Development Tools + +Essential tools for software development including version control, programming languages, and build systems. + +### git +**Purpose**: Distributed version control system +**Use**: Track code changes, collaborate with teams, manage project history. +**Syntax**: `git [command] [options]` +**Examples**: +```bash +# Initialize repository +git init + +# Clone repository +git clone https://github.com/user/repo.git + +# Stage and commit changes +git add . +git commit -m "Add new feature" + +# Push to remote +git push origin main + +# Create and switch branch +git checkout -b feature-branch + +# Merge branches +git merge feature-branch + +# View commit history +git log --oneline --graph +``` + +### nodejs & npm +**Purpose**: JavaScript runtime and package manager +**Use**: Run JavaScript outside browsers, manage project dependencies. +**Syntax**: `node [script]` / `npm [command]` +**Examples**: +```bash +# Run JavaScript file +node app.js + +# Initialize new project +npm init -y + +# Install dependencies +npm install express +npm install -g typescript + +# Run scripts +npm start +npm test + +# Check installed packages +npm list +npm outdated +``` + +### python3 & pip3 +**Purpose**: Python programming language and package installer +**Use**: Python development, scripting, data analysis, web development. +**Syntax**: `python3 [script]` / `pip3 [command]` +**Examples**: +```bash +# Run Python script +python3 script.py + +# Interactive Python shell +python3 + +# Install packages +pip3 install requests +pip3 install -r requirements.txt + +# List installed packages +pip3 list +pip3 show requests + +# Create virtual environment +python3 -m venv myenv +source myenv/bin/activate +``` + +### build-essential +**Purpose**: Essential compilation tools for building software +**Use**: Compile C/C++ programs, build native modules, install packages from source. +**Examples**: +```bash +# Compile C program +gcc -o program program.c + +# Compile C++ program +g++ -o program program.cpp + +# Build with make +make +make install + +# Check compiler versions +gcc --version +g++ --version +``` + +--- + +## Shell Environment + +Advanced shell configuration and terminal multiplexing tools for enhanced productivity. ### zsh -**Purpose**: Z shell - advanced shell -**Use**: Enhanced shell with better tab completion, history, and scripting capabilities compared to bash. -**Syntax**: Interactive shell and scripting +**Purpose**: Advanced shell with powerful features +**Use**: Enhanced command-line experience with better completion and customization. **Examples**: ```bash # Switch to zsh -zsh +chsh -s /usr/bin/zsh -# Set as default shell -chsh -s $(which zsh) +# Check current shell +echo $SHELL -# Zsh-specific features -setopt AUTO_CD # cd by typing directory name -setopt HIST_IGNORE_DUPS # ignore duplicate commands - -# Advanced globbing -ls **/*.txt # recursive file matching -ls *.txt~backup.txt # exclude pattern +# Zsh-specific features: +# - Better tab completion +# - Glob patterns: **/*.js +# - Parameter expansion: ${file%.txt}.bak ``` -**Documentation**: [Zsh Manual](https://zsh.sourceforge.io/Doc/) ### tmux **Purpose**: Terminal multiplexer -**Use**: Run multiple terminal sessions in one window, detach/reattach sessions, and split terminals. Essential for remote work. +**Use**: Split terminal windows, create persistent sessions, manage multiple terminal sessions. **Syntax**: `tmux [command]` **Examples**: ```bash @@ -382,34 +500,62 @@ tmux list-sessions # Attach to session tmux attach-session -t mysession -# Key bindings (default prefix Ctrl+b) -# Ctrl+b % - split vertically -# Ctrl+b " - split horizontally -# Ctrl+b d - detach session +# Detach from session (inside tmux) +Ctrl+b d + +# Split window horizontally +Ctrl+b % + +# Split window vertically +Ctrl+b " + +# Switch between panes +Ctrl+b arrow-keys +``` + +### fzf +**Purpose**: Command-line fuzzy finder +**Use**: Interactively search files, command history, and process lists. +**Examples**: +```bash +# Find and edit file +vim $(fzf) + +# Search command history +history | fzf + +# Find and kill process +kill $(ps aux | fzf | awk '{print $2}') + +# Search in current directory +find . -type f | fzf + +# Integration with other commands +git log --oneline | fzf ``` -**Documentation**: [tmux Manual](https://github.com/tmux/tmux/wiki) ### Oh My Zsh -**Purpose**: Zsh framework -**Use**: Provides themes, plugins, and configurations for zsh. Makes the shell more user-friendly and productive. -**Syntax**: Configuration via `~/.zshrc` +**Purpose**: Zsh configuration framework +**Use**: Manage zsh configuration with themes and plugins. **Examples**: ```bash # Update Oh My Zsh omz update -# Change theme in ~/.zshrc -ZSH_THEME="agnoster" +# List available themes +omz theme list -# Enable plugins in ~/.zshrc -plugins=(git docker kubectl node npm) +# Set theme +omz theme set powerlevel10k -# Reload configuration -source ~/.zshrc +# List plugins +omz plugin list + +# Enable plugin +# Edit ~/.zshrc and add to plugins array ``` -**Documentation**: [Oh My Zsh Wiki](https://github.com/ohmyzsh/ohmyzsh/wiki) -#### **Essential Oh My Zsh Plugins Guide** +### **Essential Oh My Zsh Plugins Guide** The following plugins significantly enhance your shell experience. Add them to your `~/.zshrc` file: @@ -468,736 +614,1010 @@ z -l ##### **colored-man-pages** **Purpose**: Colorized manual pages for better readability **Usage**: Automatic - man pages now have syntax highlighting -```bash -# Before: plain black and white -man ls - -# After: colored sections, options, and examples -# Headers in bold, options in different colors -# Much easier to read and navigate -``` ##### **fzf** -**Purpose**: Fuzzy finder integration -**Usage**: Enhanced search and selection with fuzzy matching +**Purpose**: Fuzzy finder integration with zsh +**Usage**: Enhanced command-line searching and filtering ```bash -# Reverse search with fuzzy matching -Ctrl+R # Search command history with fuzzy finder +# Search command history with fzf +Ctrl+R # Interactive history search -# File/directory selection -Ctrl+T # Insert selected files/directories into command line +# Search files +Ctrl+T # Insert selected files into command line + +# Change directory Alt+C # cd into selected directory - -# Example workflow: -vim ** # Opens fzf to select file -ssh ** # Select from SSH hosts -kill -9 ** # Select process to kill ``` ##### **zsh-syntax-highlighting** -**Purpose**: Real-time syntax highlighting in terminal -**Usage**: Automatic - commands are highlighted as you type -```bash -# Valid commands: green -ls -la # Appears in green as you type - -# Invalid commands: red -invalidcommand # Appears in red - -# Strings and paths: different colors -echo "hello" # String in quotes highlighted -cat /etc/hosts # Valid path highlighted differently -``` +**Purpose**: Real-time command syntax highlighting +**Usage**: Automatic visual feedback while typing commands +- Valid commands appear in green +- Invalid commands appear in red +- Paths, strings, and options are color-coded ##### **zsh-autosuggestions** -**Purpose**: Fish-like autosuggestions based on history -**Usage**: Suggestions appear in gray text as you type +**Purpose**: Fish-like intelligent command suggestions +**Usage**: Shows command suggestions based on history ```bash -# Start typing a command you've used before: -git sta -# Suggestion appears: git status (in gray) - -# Accept suggestion: -→ (Right arrow) # Accept entire suggestion -Ctrl+→ # Accept one word - -# Example: -git s # Shows: git status -→ # Completes to: git status +# Automatic features: +# - Gray suggestions appear as you type +# - Press → (right arrow) to accept suggestion +# - Press Ctrl+f to accept suggestion +# - Press Alt+f to accept one word ``` ##### **web-search** -**Purpose**: Search the web directly from terminal -**Usage**: Quick web searches with predefined engines +**Purpose**: Quick web searches from command line +**Usage**: Search various websites directly from terminal ```bash -# Search Google -google "zsh plugins" -google terminal tricks +# Search engines available: +google "search term" # Google search +duckduckgo "search term" # DuckDuckGo search +github "repository name" # GitHub search +stackoverflow "question" # Stack Overflow search -# Search GitHub -github "oh my zsh themes" - -# Search Stack Overflow -stackoverflow "bash vs zsh" - -# Search YouTube -youtube "linux tutorials" - -# Other engines available: -duckduckgo "privacy search" -bing "microsoft docs" -yahoo "old school search" +# Examples: +google "python tutorial" +github "awesome-zsh-plugins" +stackoverflow "zsh configuration" ``` ##### **copypath** -**Purpose**: Copy current path or file paths to clipboard +**Purpose**: Copy file/directory paths to clipboard **Usage**: Quickly copy paths for use in other applications ```bash # Copy current directory path copypath -# Copy specific file/directory path -copypath ~/.zshrc -copypath ~/Documents/project +# Copy specific file path +copypath filename.txt -# Useful for: -# - Pasting paths into file dialogs -# - Sharing directory locations -# - Documentation and notes +# Copy absolute path +copypath /full/path/to/file ``` -#### **Plugin Installation & Configuration** - -1. **Edit your zsh configuration:** -```bash -vim ~/.zshrc -# or -nano ~/.zshrc -``` - -2. **Add plugins to the plugins array:** -```bash -plugins=(git sudo z colored-man-pages fzf zsh-syntax-highlighting zsh-autosuggestions web-search copypath) -``` - -3. **Install additional plugins (if needed):** -```bash -# For zsh-syntax-highlighting (if not included) -git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting - -# For zsh-autosuggestions (if not included) -git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions -``` - -4. **Reload your configuration:** -```bash -source ~/.zshrc -# or -exec zsh -``` - -#### **Pro Tips** - -- **Customize suggestion color:** -```bash -# Add to ~/.zshrc -ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#666666" -``` - -- **Configure fzf colors:** -```bash -# Add to ~/.zshrc -export FZF_DEFAULT_OPTS="--height 40% --layout=reverse --border" -``` - -- **Z plugin tips:** -```bash -# Use with other commands -vim $(z -e myproject) # Edit files in frequent directory -``` - -**Documentation**: [Oh My Zsh Wiki](https://github.com/ohmyzsh/ohmyzsh/wiki) - ### Powerlevel10k -**Purpose**: Zsh theme -**Use**: Modern, fast, and informative shell prompt with Git status, execution time, and system information. -**Syntax**: Configuration wizard and manual config +**Purpose**: Zsh theme with rich prompt customization +**Use**: Beautiful and informative command prompt with git status, system info. **Examples**: ```bash -# Run configuration wizard +# Configure theme p10k configure -# Reload theme -exec zsh +# Show configuration wizard +p10k configure -# Enable instant prompt in ~/.zshrc -# Enable Powerlevel10k instant prompt (add to top of ~/.zshrc) -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" -fi +# Instant prompt (in .zshrc) +# Enable Powerlevel10k instant prompt ``` -**Documentation**: [Powerlevel10k GitHub](https://github.com/romkatv/powerlevel10k) -## Development Tools +### zsh-syntax-highlighting +**Purpose**: Real-time syntax highlighting for zsh commands +**Use**: Provides visual feedback by highlighting commands as you type them. +**Features**: +- Valid commands appear in green +- Invalid commands appear in red +- Strings, options, and paths are color-coded +- Works automatically after installation -### git -**Purpose**: Version control system -**Use**: Track code changes, collaborate with teams, and manage project history. Fundamental tool for software development. -**Syntax**: `git [command] [options]` +### zsh-autosuggestions +**Purpose**: Fish-like intelligent autosuggestions for zsh +**Use**: Suggests commands based on your command history as you type. **Examples**: ```bash -# Basic workflow -git init -git add . -git commit -m "Initial commit" -git push origin main +# These work automatically after installation: +# - Type partial command, see gray suggestion +# - Press → (right arrow) to accept full suggestion +# - Press Ctrl+f to accept suggestion +# - Press Alt+f to accept one word +# - Press Ctrl+e to accept to end of line -# Branching -git branch feature-branch -git checkout feature-branch -git merge main - -# Status and logs -git status -git log --oneline -git diff +# Example: typing 'git' might suggest 'git status' in gray ``` -**Documentation**: [Git Documentation](https://git-scm.com/doc) -### nodejs -**Purpose**: JavaScript runtime -**Use**: Run JavaScript applications outside the browser. Essential for modern web development and tooling. -**Syntax**: `node [options] script.js` +### Custom Aliases & Functions + +The system comes with a comprehensive set of aliases to improve productivity. Here are the key categories: + +#### **Navigation & File Operations** +```bash +# Quick navigation +alias ..="cd .." # Go up one directory +alias ...="cd ../.." # Go up two directories +alias ....="cd ../../.." # Go up three directories +alias cd..="cd .." # Handle common typo +alias h="cd ~" # Go to home directory +alias dc="cd ~/Documents/code" # Go to code directory + +# File listing with colors +alias ls="ls --color=auto" # Colorized ls output + +# Clear screen shortcut +alias c="clear" # Quick clear +``` + +#### **System Information & Monitoring** +```bash +# Disk and memory usage (human readable) +alias df="df -h" # Disk usage: df -h shows sizes in KB, MB, GB +alias du="du -h" # Directory usage: du -h /path shows folder sizes +alias free="free -h" # Memory usage: free -h shows RAM/swap usage + +# Process management +alias ps="ps aux" # Show all processes: ps aux | grep process_name +alias cpu="lscpu" # CPU information: shows cores, architecture, etc. +alias top="btop" # Use modern btop instead of top +alias mem="free -m" # Memory in MB: quick memory check +alias ports="ss -tulpn" # Open ports: see what's listening on which ports + +# Examples: +# df -h # Check disk space +# du -h ~/Downloads # Check Downloads folder size +# free -h # Check memory usage +# ports | grep :80 # Check if port 80 is in use +``` + +#### **Network Information** +```bash +# IP address information +alias myip="curl -s http://ipecho.net/plain; echo" # Get public IP +alias localip="ip route get 1.2.3.4 | awk '{print $7}'" # Get local IP + +# Examples: +# myip # Shows: 203.0.113.42 (your public IP) +# localip # Shows: 192.168.1.100 (your local network IP) +``` + +#### **Development Tools** +```bash +# Python shortcuts +alias py="python3" # Quick python3 access +alias pip="pip3" # Use pip3 by default +alias venv="python3 -m venv" # Create virtual environment +alias activate="source venv/bin/activate" # Activate venv + +# Examples: +# py script.py # Run Python script +# venv myproject # Create virtual environment +# activate # Activate the venv in current directory +# pip install requests # Install package in active venv +``` + +#### **Docker Shortcuts** +```bash +# Docker command shortcuts +alias d="docker" # Short docker command +alias dc="docker-compose" # Docker Compose shortcut +alias dcu="docker-compose up -d" # Start containers in background +alias dcd="docker-compose down" # Stop and remove containers +alias dcb="docker-compose build" # Build containers +alias dps="docker ps" # Show running containers +alias di="docker images" # Show docker images + +# Examples: +# dps # Quick check of running containers +# dcu # Start your docker-compose project +# dcd # Stop your docker-compose project +# d exec -it container_name bash # Enter running container +``` + +#### **Package Management** +```bash +# Debian/Ubuntu package management +alias update="sudo apt update && sudo apt upgrade -y" # Update system +alias install="sudo apt install" # Install package +alias remove="sudo apt remove" # Remove package +alias search="apt search" # Search for packages + +# Examples: +# update # Update all system packages +# install htop # Install htop package +# search python # Find python-related packages +# remove old-package # Uninstall package +``` + +#### **File Permissions & Ownership** +```bash +# Permission shortcuts +alias chmox="chmod +x" # Make file executable +alias own="sudo chown -R $USER:$USER" # Take ownership of files + +# Examples: +# chmox script.sh # Make script executable +# own ~/Downloads # Take ownership of Downloads folder +``` + +#### **Date & Time** +```bash +# Date and time shortcuts +alias now="date +'%Y-%m-%d %H:%M:%S'" # Current timestamp +alias today="date +'%Y-%m-%d'" # Today's date + +# Examples: +# now # Shows: 2023-12-01 14:30:45 +# today # Shows: 2023-12-01 +``` + +#### **Configuration Management** +```bash +# Zsh configuration shortcuts +alias reload="source ~/.zshrc && echo 'ZSH config reloaded from ~/.zshrc'" +alias editrc="nano ~/.zshrc" # Edit zsh configuration + +# Examples: +# editrc # Open .zshrc in nano editor +# reload # Reload zsh configuration after changes +``` + +#### **Node.js Development** +```bash +# Node.js project shortcuts +alias nfresh="rm -rf node_modules/ package-lock.json && npm install" + +# Examples: +# nfresh # Clean install - removes node_modules and reinstalls +# # Useful when package-lock.json conflicts occur +``` + +### Environment Variables & Path Configuration + +The shell environment includes several important environment variables: + +```bash +# Node Version Manager (NVM) +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + +# Python pipx tools path +export PATH="$PATH:/home/beast/.local/bin" + +# Examples of using these: +# nvm install 18 # Install Node.js version 18 +# nvm use 16 # Switch to Node.js version 16 +# nvm list # List installed Node.js versions +``` + +### Pro Tips for Using Aliases + +```bash +# View all aliases +alias # Show all defined aliases + +# Create temporary alias (session only) +alias ll="ls -la" # Create ll alias for detailed listing + +# Add permanent alias to ~/.zshrc +echo 'alias myalias="command"' >> ~/.zshrc +reload # Reload to apply changes + +# Use aliases in combination +dps | grep nginx # Show only nginx containers +ports | grep :3000 # Check if port 3000 is in use +update && install docker # Update system then install docker +``` + +--- + +## Desktop Applications + +GUI applications for productivity, web browsing, and document management. + +### Brave Browser +**Purpose**: Privacy-focused web browser +**Use**: Web browsing with built-in ad blocking and privacy protection. +**Features**: +- Built-in ad blocker +- Tor browsing mode +- Cryptocurrency rewards +- Enhanced privacy controls + +### LibreOffice +**Purpose**: Complete office suite +**Use**: Document creation, spreadsheets, presentations, and more. +**Components**: +- Writer (documents) +- Calc (spreadsheets) +- Impress (presentations) +- Draw (graphics) +- Base (databases) + +### Redshift +**Purpose**: Blue light filter for displays +**Use**: Reduce eye strain by adjusting screen color temperature based on time. **Examples**: ```bash -# Run JavaScript file -node app.js +# Start redshift +redshift -# Interactive REPL -node +# Set location manually +redshift -l 40.7:-74.0 # NYC coordinates -# Check version -node --version +# Set color temperature +redshift -t 6500:3500 -# Run with specific flags -node --inspect app.js # Enable debugger -node --max-old-space-size=4096 app.js # Increase memory +# One-time adjustment +redshift -O 3500 ``` -**Documentation**: [Node.js Documentation](https://nodejs.org/en/docs/) -### npm -**Purpose**: Node.js package manager -**Use**: Install, manage, and publish JavaScript packages. Central tool for Node.js ecosystem. -**Syntax**: `npm [command] [options]` +### Evince +**Purpose**: PDF document viewer +**Use**: View PDF files, documents, and e-books. +**Features**: +- PDF viewing and navigation +- Search within documents +- Annotation support +- Print functionality + +--- + +## IDE & Code Editors + +Integrated development environments and code editors for software development. + +### Visual Studio Code (via snap) +**Purpose**: Lightweight but powerful code editor +**Use**: Multi-language code editing with extensive plugin ecosystem. **Examples**: ```bash -# Initialize project -npm init -y +# Open VS Code +code -# Install packages -npm install express -npm install -g nodemon # Global install -npm install --save-dev jest # Development dependency +# Open specific file +code filename.js -# Run scripts -npm start -npm test -npm run build +# Open current directory +code . -# Package management -npm list -npm outdated -npm update +# Open with specific workspace +code workspace.code-workspace + +# Install extension from command line +code --install-extension ms-python.python ``` -**Documentation**: [npm Documentation](https://docs.npmjs.com/) -### build-essential -**Purpose**: Essential build tools (gcc, make, etc.) -**Use**: Compile software from source code. Required for building many applications and development tools. -**Syntax**: Various compilation tools +### Cursor (via snap) +**Purpose**: AI-powered code editor +**Use**: Code editing with integrated AI assistance for development. +**Features**: +- AI-powered code completion +- Natural language code generation +- Intelligent code suggestions +- Built on VS Code foundation + +--- + +## Container Platform + +Docker ecosystem for containerization and application deployment. + +### Docker CE (Community Edition) +**Purpose**: Container platform for application packaging and deployment +**Use**: Create, manage, and run containers for consistent development environments. **Examples**: ```bash -# Compile C program -gcc -o program program.c +# Check Docker version +docker --version -# Use make with Makefile -make -make install -make clean - -# Check installed tools -gcc --version -make --version -g++ --version - -# Compile C++ program -g++ -o program program.cpp -``` -**Documentation**: [GCC Manual](https://gcc.gnu.org/onlinedocs/) - -### python3 -**Purpose**: Python 3 interpreter -**Use**: Run Python applications and scripts. Popular language for automation, data science, and web development. -**Syntax**: `python3 [options] script.py` -**Examples**: -```bash -# Run Python script -python3 script.py - -# Interactive interpreter -python3 - -# Run module as script -python3 -m http.server 8000 -python3 -m json.tool file.json # Pretty print JSON - -# Check version -python3 --version - -# Run with specific flags -python3 -u script.py # Unbuffered output -``` -**Documentation**: [Python Documentation](https://docs.python.org/3/) - -### python3-pip -**Purpose**: Python package installer -**Use**: Install and manage Python packages from PyPI repository. Essential for Python development. -**Syntax**: `pip3 [command] [options]` -**Examples**: -```bash -# Install packages -pip3 install requests -pip3 install -r requirements.txt -pip3 install --user package_name # User install - -# Package management -pip3 list -pip3 show requests -pip3 freeze > requirements.txt - -# Upgrade packages -pip3 install --upgrade package_name -pip3 install --upgrade pip - -# Uninstall -pip3 uninstall package_name -``` -**Documentation**: [pip Documentation](https://pip.pypa.io/en/stable/) - -## Docker Ecosystem - -### apt-transport-https -**Purpose**: APT HTTPS transport -**Use**: Enables package manager to download packages over HTTPS for security. -**Syntax**: Used automatically by APT -**Examples**: -```bash -# APT will automatically use HTTPS transport when configured -# No direct commands - enables secure package downloads - -# Check if HTTPS transport is available -apt list --installed | grep apt-transport-https - -# Used in repository configuration -echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list -``` -**Documentation**: [APT Documentation](https://manpages.ubuntu.com/manpages/focal/man1/apt-transport-https.1.html) - -### ca-certificates -**Purpose**: Certificate authorities -**Use**: Trusted certificates for verifying SSL/TLS connections. -**Syntax**: Managed by system -**Examples**: -```bash -# Update certificate store -sudo update-ca-certificates - -# Add custom certificate -sudo cp custom-cert.crt /usr/local/share/ca-certificates/ -sudo update-ca-certificates - -# Check certificate details -openssl x509 -in /etc/ssl/certs/ca-certificates.crt -text -noout - -# Verify SSL connection -openssl s_client -connect example.com:443 -CAfile /etc/ssl/certs/ca-certificates.crt -``` -**Documentation**: [ca-certificates Manual](https://manpages.ubuntu.com/manpages/focal/man8/update-ca-certificates.8.html) - -### gnupg -**Purpose**: GNU Privacy Guard -**Use**: Encrypt, decrypt, and sign data. Used for package verification and secure communications. -**Syntax**: `gpg [options] [files]` -**Examples**: -```bash -# Generate key pair -gpg --gen-key - -# List keys -gpg --list-keys -gpg --list-secret-keys - -# Encrypt/decrypt files -gpg --encrypt --recipient user@example.com file.txt -gpg --decrypt file.txt.gpg - -# Add repository key (common for package management) -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg -``` -**Documentation**: [GnuPG Manual](https://gnupg.org/documentation/) - -### lsb-release -**Purpose**: Linux Standard Base release info -**Use**: Provides system information for scripts and applications to determine OS version. -**Syntax**: `lsb_release [options]` -**Examples**: -```bash -# Show all information -lsb_release -a - -# Show distribution ID -lsb_release -i - -# Show release number -lsb_release -r - -# Show codename -lsb_release -c - -# Used in scripts -if [ "$(lsb_release -si)" = "Ubuntu" ]; then - echo "Running on Ubuntu" -fi -``` -**Documentation**: [lsb_release Manual](https://manpages.ubuntu.com/manpages/focal/man1/lsb_release.1.html) - -### docker-ce -**Purpose**: Docker Community Edition engine -**Use**: Core Docker runtime for creating and running containers. -**Syntax**: `docker [command] [options]` -**Examples**: -```bash -# Basic container operations +# Run container docker run hello-world docker run -it ubuntu bash -docker run -d -p 80:80 nginx -# Container management -docker ps # List running containers -docker ps -a # List all containers -docker stop container_id -docker rm container_id +# List containers +docker ps +docker ps -a -# Image management -docker images -docker pull ubuntu:latest +# Build image docker build -t myapp . -``` -**Documentation**: [Docker Documentation](https://docs.docker.com/) -### docker-ce-cli -**Purpose**: Docker command line interface -**Use**: Command-line tools for interacting with Docker engine. -**Syntax**: Same as docker-ce (provides the `docker` command) +# Run with port mapping +docker run -p 8080:80 nginx + +# Execute command in running container +docker exec -it container_name bash +``` + +### Docker CLI +**Purpose**: Command-line interface for Docker +**Use**: Manage containers, images, networks, and volumes from command line. **Examples**: ```bash -# All docker commands come from docker-ce-cli -# See docker-ce section for examples +# Image management +docker images +docker pull nginx +docker rmi image_name -# Check CLI version -docker version --format '{{.Client.Version}}' +# Container management +docker start container_name +docker stop container_name +docker rm container_name -# CLI-specific features -docker --help -docker system info -docker system df # Show disk usage +# System cleanup +docker system prune +docker image prune ``` -**Documentation**: [Docker CLI Reference](https://docs.docker.com/engine/reference/commandline/cli/) ### containerd.io **Purpose**: Container runtime -**Use**: Low-level container runtime that Docker uses to manage containers. -**Syntax**: `ctr [options] [command]` (advanced usage) +**Use**: Low-level container runtime that Docker uses internally. +**Note**: Typically managed automatically by Docker, not used directly. + +### Docker Buildx plugin +**Purpose**: Extended build capabilities for Docker +**Use**: Build multi-platform images and advanced build features. **Examples**: ```bash -# Check containerd status -sudo systemctl status containerd - -# Direct containerd commands (advanced) -sudo ctr images list -sudo ctr containers list - -# Usually managed by Docker daemon -# Most users interact through docker commands - -# Check containerd version -containerd --version -``` -**Documentation**: [containerd Documentation](https://containerd.io/docs/) - -### docker-buildx-plugin -**Purpose**: Docker Buildx plugin -**Use**: Advanced Docker build features including multi-platform builds and build caching. -**Syntax**: `docker buildx [command] [options]` -**Examples**: -```bash -# Create and use builder +# Create builder instance docker buildx create --name mybuilder --use -# Multi-platform build +# Build for multiple platforms docker buildx build --platform linux/amd64,linux/arm64 -t myapp . -# Build with cache -docker buildx build --cache-from type=local,src=/tmp/cache --cache-to type=local,dest=/tmp/cache . - -# List builders -docker buildx ls - -# Inspect build -docker buildx imagetools inspect myapp:latest +# Inspect builder +docker buildx inspect ``` -**Documentation**: [Docker Buildx Documentation](https://docs.docker.com/buildx/) -### docker-compose-plugin -**Purpose**: Docker Compose plugin -**Use**: Define and run multi-container Docker applications using YAML configuration files. -**Syntax**: `docker compose [command] [options]` +### Docker Compose plugin +**Purpose**: Multi-container application management +**Use**: Define and run multi-container Docker applications using YAML files. **Examples**: ```bash # Start services defined in docker-compose.yml docker compose up -docker compose up -d # Detached mode -# Stop and remove services +# Start in background +docker compose up -d + +# Stop services docker compose down # View logs docker compose logs -docker compose logs service_name # Scale services -docker compose up --scale web=3 +docker compose scale web=3 -# Build services -docker compose build +# Example docker-compose.yml: +version: '3.8' +services: + web: + image: nginx + ports: + - "80:80" + db: + image: postgres + environment: + POSTGRES_PASSWORD: password ``` -**Documentation**: [Docker Compose Documentation](https://docs.docker.com/compose/) - -## Desktop Applications - -### redshift -**Purpose**: Blue light filter -**Use**: Automatically adjust screen color temperature based on time of day to reduce eye strain. -**Syntax**: `redshift [options]` -**Examples**: -```bash -# Start redshift with location -redshift -l 40.7:-74.0 # NYC coordinates - -# Run once (no continuous adjustment) -redshift -O 3000 - -# Reset to normal -redshift -x - -# Run in background -redshift & -``` -**Documentation**: [Redshift Manual](http://jonls.dk/redshift/) - -### libreoffice -**Purpose**: Office suite -**Use**: Open-source alternative to Microsoft Office with word processing, spreadsheets, and presentations. -**Syntax**: `libreoffice [options] [file]` -**Examples**: -```bash -# Open LibreOffice start center -libreoffice - -# Open specific applications -libreoffice --writer document.odt -libreoffice --calc spreadsheet.ods -libreoffice --impress presentation.odp - -# Convert documents -libreoffice --convert-to pdf document.docx -libreoffice --headless --convert-to pdf *.docx -``` -**Documentation**: [LibreOffice Help](https://help.libreoffice.org/) - -### evince -**Purpose**: PDF viewer -**Use**: View and navigate PDF documents with search and annotation capabilities. -**Syntax**: `evince [options] [file]` -**Examples**: -```bash -# Open PDF file -evince document.pdf - -# Open at specific page -evince --page-index=5 document.pdf - -# Open in fullscreen -evince --fullscreen document.pdf - -# Print document -evince --preview document.pdf -``` -**Documentation**: [Evince Manual](https://help.gnome.org/users/evince/stable/) - -### brave-browser -**Purpose**: Privacy-focused web browser -**Use**: Web browsing with built-in ad blocking, tracking protection, and privacy features. -**Syntax**: `brave-browser [options] [URL]` -**Examples**: -```bash -# Start Brave browser -brave-browser - -# Open specific URL -brave-browser https://example.com - -# Open in incognito mode -brave-browser --incognito - -# Open with specific profile -brave-browser --profile-directory="Profile 1" - -# Disable web security (development) -brave-browser --disable-web-security --user-data-dir="/tmp/brave" -``` -**Documentation**: [Brave Support](https://support.brave.com/) - -## Snap Packages - -### snapd -**Purpose**: Snap package daemon -**Use**: System service that manages snap packages - universal Linux packages with automatic updates. -**Syntax**: `snap [command] [options]` -**Examples**: -```bash -# Search for snaps -snap find code -snap find --category=development - -# Install/remove snaps -snap install code --classic -snap remove code - -# List installed snaps -snap list - -# Update snaps -snap refresh -snap refresh code # Update specific snap - -# Check snap info -snap info code -``` -**Documentation**: [Snap Documentation](https://snapcraft.io/docs) - -### yq -**Purpose**: YAML processor -**Use**: Parse, filter, and manipulate YAML data from command line. Complement to jq for YAML files. -**Syntax**: `yq [options] expression [file]` -**Examples**: -```bash -# Read YAML value -yq '.database.host' config.yaml - -# Update YAML value -yq '.database.port = 5432' config.yaml - -# Convert YAML to JSON -yq -o json config.yaml - -# Filter arrays -yq '.services[] | select(.name == "web")' docker-compose.yml - -# Merge YAML files -yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' file1.yml file2.yml -``` -**Documentation**: [yq Documentation](https://mikefarah.gitbook.io/yq/) - -### btop -**Purpose**: Modern system monitor -**Use**: Beautiful, feature-rich system monitor showing CPU, memory, disk, and network usage with an intuitive interface. -**Syntax**: `btop [options]` -**Examples**: -```bash -# Start btop -btop - -# Key bindings within btop: -# q - quit -# h - help -# + - add shown information -# - - subtract shown information -# f - filter processes -# t - tree view -# m - memory view -# ESC - clear filter/reset -``` -**Documentation**: [btop GitHub](https://github.com/aristocratos/btop) - -### code (Visual Studio Code) -**Purpose**: IDE/code editor -**Use**: Popular, extensible code editor with debugging, Git integration, and extensive plugin ecosystem. -**Syntax**: `code [options] [file/directory]` -**Examples**: -```bash -# Open file or directory -code . -code file.txt -code /path/to/project - -# Open with specific options -code --new-window project/ -code --goto file.js:10:5 # Go to line 10, column 5 -code --diff file1.txt file2.txt - -# Extensions management -code --install-extension ms-python.python -code --list-extensions -``` -**Documentation**: [VS Code Documentation](https://code.visualstudio.com/docs) - -### cursor -**Purpose**: AI-powered code editor -**Use**: Modern code editor with built-in AI assistance for code completion, generation, and refactoring. -**Syntax**: `cursor [options] [file/directory]` -**Examples**: -```bash -# Open file or directory -cursor . -cursor file.txt -cursor /path/to/project - -# AI features (within editor): -# Ctrl+K - AI chat/commands -# Ctrl+L - AI inline suggestions -# Ctrl+I - AI code generation -# Tab - Accept AI suggestion -``` -**Documentation**: [Cursor Documentation](https://docs.cursor.com/) --- -## Getting Started +## System Monitoring -Most command-line tools are immediately available after installation. For desktop applications, you can find them in your application launcher. +Comprehensive tools for monitoring system performance, network activity, and resource usage. -### Quick Command Examples +### htop +**Purpose**: Interactive process viewer +**Use**: Monitor system processes with enhanced interface compared to top. +**Examples**: +```bash +# Launch htop +htop -- Monitor system: `btop` or `iotop` -- Search files: `fd filename` or `rg "search term"` -- Process JSON: `curl api.example.com | jq '.data'` -- Start development server in tmux: `tmux new-session -d -s dev` -- Check Docker status: `docker --version && docker ps` +# Key shortcuts within htop: +# F1 - Help +# F2 - Setup +# F3 - Search +# F4 - Filter +# F5 - Tree view +# F6 - Sort by +# F9 - Kill process +# F10 - Quit +``` -### Configuration Tips +### iotop +**Purpose**: I/O usage monitoring by process +**Use**: Monitor disk read/write activity to identify I/O bottlenecks. +**Examples**: +```bash +# Monitor I/O in real-time +sudo iotop -- Customize zsh with `~/.zshrc` -- Configure tmux with `~/.tmux.conf` -- Set up Git aliases for common operations -- Use Docker Compose for multi-container applications +# Show only processes doing I/O +sudo iotop -o + +# Show accumulated I/O +sudo iotop -a + +# Non-interactive mode +sudo iotop -b -n 3 +``` + +### nethogs +**Purpose**: Network bandwidth monitoring per process +**Use**: See which applications are using network bandwidth. +**Examples**: +```bash +# Monitor network usage +sudo nethogs + +# Monitor specific interface +sudo nethogs eth0 + +# Monitor with custom delay +sudo nethogs -d 5 + +# Monitor multiple interfaces +sudo nethogs eth0 wlan0 +``` + +### iftop +**Purpose**: Network bandwidth monitor +**Use**: Display network usage on interface in real-time. +**Examples**: +```bash +# Monitor default interface +sudo iftop + +# Monitor specific interface +sudo iftop -i eth0 + +# Show port numbers +sudo iftop -P + +# Don't resolve hostnames +sudo iftop -n +``` + +### ncdu +**Purpose**: Disk usage analyzer with interactive interface +**Use**: Analyze disk space usage and identify large files/directories. +**Examples**: +```bash +# Analyze current directory +ncdu + +# Analyze specific directory +ncdu /var/log + +# Export results to file +ncdu -o diskusage.json + +# Navigation within ncdu: +# Arrow keys - navigate +# Enter - enter directory +# 'd' - delete file/directory +# 'q' - quit +``` + +### dstat +**Purpose**: Versatile system statistics tool +**Use**: Monitor system performance metrics in real-time. +**Examples**: +```bash +# Basic system stats +dstat + +# Show specific metrics +dstat -cdngy # cpu, disk, network, page, system + +# Show top processes using CPU +dstat --top-cpu + +# Show top processes using I/O +dstat --top-io + +# Output to CSV +dstat --output stats.csv +``` + +### nmap +**Purpose**: Network discovery and security scanner +**Use**: Scan networks, discover hosts, identify open ports and services. +**Examples**: +```bash +# Scan single host +nmap 192.168.1.1 + +# Scan network range +nmap 192.168.1.0/24 + +# Scan specific ports +nmap -p 22,80,443 192.168.1.1 + +# Service version detection +nmap -sV 192.168.1.1 + +# OS detection +nmap -O 192.168.1.1 + +# Aggressive scan +nmap -A 192.168.1.1 +``` + +### tcpdump +**Purpose**: Network packet analyzer +**Use**: Capture and analyze network traffic for troubleshooting. +**Examples**: +```bash +# Capture all traffic +sudo tcpdump + +# Capture on specific interface +sudo tcpdump -i eth0 + +# Capture specific host +sudo tcpdump host 192.168.1.1 + +# Capture specific port +sudo tcpdump port 80 + +# Save to file +sudo tcpdump -w capture.pcap + +# Read from file +tcpdump -r capture.pcap +``` + +### wireshark-common +**Purpose**: Network protocol analyzer utilities +**Use**: Command-line tools for network analysis (part of Wireshark suite). +**Examples**: +```bash +# Analyze capture file +tshark -r capture.pcap + +# Live capture +sudo tshark -i eth0 + +# Filter specific protocol +tshark -f "tcp port 80" + +# Export specific fields +tshark -T fields -e ip.src -e ip.dst -r capture.pcap +``` + +### sysstat +**Purpose**: System performance monitoring tools +**Use**: Collect and report system activity statistics. +**Examples**: +```bash +# CPU usage over time +sar -u 1 10 + +# Memory usage +sar -r 1 10 + +# Disk I/O statistics +iostat 1 10 + +# Network statistics +sar -n DEV 1 10 + +# Generate daily report +sar -A +``` + +### atop +**Purpose**: Advanced system and process monitor +**Use**: Detailed system performance monitoring with historical data. +**Examples**: +```bash +# Launch atop +atop + +# View specific time +atop -r /var/log/atop/atop_20231201 + +# Key shortcuts within atop: +# 'g' - generic info +# 'm' - memory info +# 'd' - disk info +# 'n' - network info +# 'q' - quit +``` + +### btop (via snap) +**Purpose**: Modern system monitor with beautiful interface +**Use**: Resource monitoring with graphs and modern terminal UI. +**Examples**: +```bash +# Launch btop +btop + +# Key shortcuts: +# 'q' - quit +# 'm' - toggle memory view +# 'n' - toggle network view +# 't' - toggle tree view +# '+/-' - adjust update interval +``` + +### bandwhich (via snap) +**Purpose**: Network utilization monitor by process +**Use**: See which processes are using network bandwidth in real-time. +**Examples**: +```bash +# Monitor network usage +sudo bandwhich + +# Show processes and connections +sudo bandwhich --show-processes --show-connections + +# Monitor specific interface +sudo bandwhich --interface eth0 +``` + +--- + +## Backup Tools + +Comprehensive backup solutions for data protection and synchronization. + +### rsync +**Purpose**: File synchronization and backup tool +**Use**: Efficiently sync files between locations, create backups. +**Syntax**: `rsync [options] source destination` +**Examples**: +```bash +# Basic sync +rsync -av /source/ /destination/ + +# Sync with progress +rsync -av --progress /source/ /destination/ + +# Sync over SSH +rsync -av /local/path/ user@server:/remote/path/ + +# Exclude files +rsync -av --exclude='*.log' /source/ /destination/ + +# Dry run (test without changes) +rsync -av --dry-run /source/ /destination/ + +# Delete files in destination not in source +rsync -av --delete /source/ /destination/ +``` + +### borgbackup +**Purpose**: Deduplicating backup program +**Use**: Create space-efficient encrypted backups with deduplication. +**Examples**: +```bash +# Initialize repository +borg init --encryption=repokey /path/to/repo + +# Create backup +borg create /path/to/repo::backup-{now} ~/Documents ~/Pictures + +# List archives +borg list /path/to/repo + +# Extract archive +borg extract /path/to/repo::backup-2023-12-01 + +# Mount archive as filesystem +borg mount /path/to/repo::backup-2023-12-01 /mnt/backup + +# Check repository +borg check /path/to/repo +``` + +### rclone +**Purpose**: Cloud storage synchronization tool +**Use**: Sync files with cloud storage providers (Google Drive, Dropbox, AWS S3, etc.). +**Examples**: +```bash +# Configure cloud storage +rclone config + +# List configured remotes +rclone listremotes + +# Sync to cloud +rclone sync /local/path remote:bucket/path + +# Copy files +rclone copy /local/file remote:bucket/ + +# Mount cloud storage +rclone mount remote:bucket /mnt/cloud --daemon + +# Check differences +rclone check /local/path remote:bucket/path +``` + +### restic +**Purpose**: Fast, secure backup program +**Use**: Create encrypted backups to various storage backends. +**Examples**: +```bash +# Initialize repository +restic init --repo /path/to/repo + +# Create backup +restic backup ~/Documents --repo /path/to/repo + +# List snapshots +restic snapshots --repo /path/to/repo + +# Restore files +restic restore latest --repo /path/to/repo --target /restore/path + +# Mount snapshots +restic mount --repo /path/to/repo /mnt/restic + +# Check repository +restic check --repo /path/to/repo +``` + +--- + +## VPN & Networking + +Secure networking and VPN solutions for private connectivity. + +### Tailscale +**Purpose**: Mesh VPN service +**Use**: Create secure private networks between devices across the internet. +**Examples**: +```bash +# Login to Tailscale +sudo tailscale up + +# Check status +tailscale status + +# Show IP addresses +tailscale ip + +# Logout +tailscale logout + +# Enable exit node +sudo tailscale up --advertise-exit-node + +# Use exit node +sudo tailscale up --exit-node=100.x.x.x +``` + +### tailscaled +**Purpose**: Tailscale daemon +**Use**: Background service that maintains VPN connections. +**Examples**: +```bash +# Check service status +sudo systemctl status tailscaled + +# Start/stop service +sudo systemctl start tailscaled +sudo systemctl stop tailscaled + +# Enable at boot +sudo systemctl enable tailscaled +``` + +--- + +## Custom Scripts + +Custom monitoring and backup scripts for system administration. + +### /usr/local/bin/monitoring/sysinfo +**Purpose**: System overview dashboard script +**Use**: Display comprehensive system information and status. +**Examples**: +```bash +# Run system info script +sysinfo + +# Typical output includes: +# - System uptime and load +# - Memory and disk usage +# - Network interfaces +# - Running services +# - Recent log entries +``` + +### /usr/local/bin/monitoring/netinfo +**Purpose**: Network monitoring script +**Use**: Display network status, connections, and traffic information. +**Examples**: +```bash +# Run network info script +netinfo + +# Typical output includes: +# - Network interfaces and IPs +# - Active connections +# - Network statistics +# - Bandwidth usage +# - Routing table +``` + +### /opt/backups/scripts/backup-home.sh +**Purpose**: Home directory backup script +**Use**: Automated backup of user home directories. +**Examples**: +```bash +# Run home backup +sudo /opt/backups/scripts/backup-home.sh + +# Typically includes: +# - User documents and files +# - Configuration files +# - Application data +# - Compression and encryption +``` + +### /opt/backups/scripts/backup-system.sh +**Purpose**: System configuration backup script +**Use**: Backup critical system configurations and settings. +**Examples**: +```bash +# Run system backup +sudo /opt/backups/scripts/backup-system.sh + +# Typically backs up: +# - System configuration files +# - Package lists +# - Service configurations +# - User account information +``` + +--- + +## 🎯 **Quick Reference** + +### **Most Used Commands** +```bash +# System monitoring +htop # Process monitor +btop # Modern system monitor +docker ps # Container status +tailscale status # VPN status + +# Development +git status # Git repository status +npm start # Run Node.js project +python3 app.py # Run Python script +code . # Open VS Code in current directory + +# File operations +rg "pattern" # Search in files +fd filename # Find files +tree -L 2 # Show directory structure +rsync -av src/ dst/ # Sync directories + +# System administration +sudo ufw status # Firewall status +sudo systemctl status docker # Service status +journalctl -f # View system logs +ncdu # Analyze disk usage +``` + +### **Configuration Files** +- **Zsh**: `~/.zshrc`, `~/.p10k.zsh` +- **Git**: `~/.gitconfig` +- **SSH**: `~/.ssh/config`, `~/.ssh/authorized_keys` +- **Tmux**: `~/.tmux.conf` +- **Docker**: `/etc/docker/daemon.json` + +### **Service Management** +```bash +# Check service status +sudo systemctl status + +# Start/stop/restart services +sudo systemctl start +sudo systemctl stop +sudo systemctl restart + +# Enable/disable at boot +sudo systemctl enable +sudo systemctl disable +``` + +--- + +*This comprehensive guide covers all applications installed via the Ansible automation system. Each tool is configured and ready for immediate use in your development environment.* \ No newline at end of file diff --git a/onboarding.sh b/onboarding.sh index 7c406f4..6dd0003 100755 --- a/onboarding.sh +++ b/onboarding.sh @@ -50,6 +50,54 @@ test_ssh_connection() { fi } +# Environment verification function +verify_environment() { + echo + echo "=== Environment Verification ===" + echo + + # Check key development tools + echo "🛠️ Development Tools:" + command -v node >/dev/null && echo " ✓ Node.js: $(node --version)" || echo " ✗ Node.js: Not found" + command -v python3 >/dev/null && echo " ✓ Python3: $(python3 --version)" || echo " ✗ Python3: Not found" + command -v docker >/dev/null && echo " ✓ Docker: $(docker --version)" || echo " ✗ Docker: Not found" + command -v code >/dev/null && echo " ✓ VS Code: $(code --version | head -n1)" || echo " ✗ VS Code: Not found" + + echo + echo "🐚 Shell Environment:" + echo " ✓ Current shell: $SHELL" + command -v zsh >/dev/null && echo " ✓ Zsh: $(zsh --version)" || echo " ✗ Zsh: Not found" + command -v tmux >/dev/null && echo " ✓ Tmux: $(tmux -V)" || echo " ✗ Tmux: Not found" + command -v fzf >/dev/null && echo " ✓ Fzf: $(fzf --version)" || echo " ✗ Fzf: Not found" + + echo + echo "📊 Monitoring Tools:" + command -v htop >/dev/null && echo " ✓ htop: Available" || echo " ✗ htop: Not found" + command -v btop >/dev/null && echo " ✓ btop: Available" || echo " ✗ btop: Not found" + command -v bandwhich >/dev/null && echo " ✓ bandwhich: Available" || echo " ✗ bandwhich: Not found" + + echo + echo "🔒 Security & VPN:" + command -v ufw >/dev/null && echo " ✓ UFW: $(ufw --version | head -n1)" || echo " ✗ UFW: Not found" + systemctl is-active fail2ban >/dev/null 2>&1 && echo " ✓ fail2ban: Active" || echo " ✗ fail2ban: Not active" + command -v tailscale >/dev/null && echo " ✓ Tailscale: $(tailscale version --short)" || echo " ✗ Tailscale: Not found" + + echo + echo "💾 Backup Tools:" + command -v rsync >/dev/null && echo " ✓ rsync: $(rsync --version | head -n1)" || echo " ✗ rsync: Not found" + command -v borgbackup >/dev/null && echo " ✓ borgbackup: Available" || echo " ✗ borgbackup: Not found" + command -v rclone >/dev/null && echo " ✓ rclone: Available" || echo " ✗ rclone: Not found" + + echo + echo "🔧 System Tools:" + command -v jq >/dev/null && echo " ✓ jq: $(jq --version)" || echo " ✗ jq: Not found" + command -v ripgrep >/dev/null && echo " ✓ ripgrep: $(rg --version | head -n1)" || echo " ✗ ripgrep: Not found" + command -v fd >/dev/null && echo " ✓ fd-find: Available" || echo " ✗ fd-find: Not found" + + echo + echo "For a complete list of installed applications, see applications.md" +} + ## MAIN LOGIC echo "Checking Git global config..." @@ -68,5 +116,14 @@ setup_ssh_key show_and_copy_ssh_key test_ssh_connection +# Ask if user wants to verify environment echo -echo "Setup complete!" +read -rp "Would you like to verify your development environment? (y/n): " verify +if [[ "$verify" =~ ^[Yy]$ ]]; then + verify_environment +fi + +echo +echo "Git/SSH setup complete!" +echo "📋 See applications.md for the complete list of 60+ installed applications" +echo "🔧 Run individual commands from the verification section to check specific tools"