diff --git a/.config/ranger/rc.conf b/.config/ranger/rc.conf deleted file mode 100644 index 2bf33b3..0000000 --- a/.config/ranger/rc.conf +++ /dev/null @@ -1,5 +0,0 @@ -set show_hidden true -set draw_borders outline -set mouse_enabled true -set preview_images true -set preview_images_method w3m \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index bc42215..8ab069e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,5 +32,5 @@ jobs: platforms: linux/amd64 push: true tags: | - ghcr.io/tobyscott25/toolbox:latest - ghcr.io/tobyscott25/toolbox:${{ github.sha }} \ No newline at end of file + ghcr.io/tbysctt/toolbox:latest + ghcr.io/tbysctt/toolbox:${{ github.sha }} diff --git a/.ohmyzsh/custom/aliases.zsh b/.ohmyzsh/custom/aliases.zsh deleted file mode 100644 index b3df2fd..0000000 --- a/.ohmyzsh/custom/aliases.zsh +++ /dev/null @@ -1,3 +0,0 @@ -alias dive="docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive" -alias k="kubectl" -alias vim="nvim" \ No newline at end of file diff --git a/.zshrc b/.zshrc deleted file mode 100644 index 4b5ca6a..0000000 --- a/.zshrc +++ /dev/null @@ -1,13 +0,0 @@ -export ZSH="$HOME/.oh-my-zsh" - -ZSH_THEME="robbyrussell" - -plugins=(git zsh-autosuggestions zsh-syntax-highlighting) - -source $ZSH/oh-my-zsh.sh - -export EDITOR='nvim' -export VISUAL='nvim' - -# [ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc -[ command -v kubectl &> /dev/null ] && source <(kubectl completion zsh) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 383cc7e..1958f3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,64 +1,7 @@ -FROM debian:12.11-slim +FROM alpine:3.22.2 -SHELL ["/bin/bash", "-c"] - -RUN < Note: It only supports x86 for now. ARM support will come later :) ## Quick Start ```sh # Pull the latest image -docker pull ghcr.io/tobyscott25/toolbox:latest +docker pull ghcr.io/tbysctt/toolbox:latest # Run interactively -docker run --rm -it ghcr.io/tobyscott25/toolbox:latest +docker run --rm -it ghcr.io/tbysctt/toolbox:latest # Run with host network access (useful for network debugging) -docker run --rm -it --network host ghcr.io/tobyscott25/toolbox:latest +docker run --rm -it --network host ghcr.io/tbysctt/toolbox:latest # Mount current directory for file operations -docker run --rm -it -v $(pwd):/workspace -w /workspace ghcr.io/tobyscott25/toolbox:latest +docker run --rm -it -v $(pwd):/workspace -w /workspace ghcr.io/tbysctt/toolbox:latest ``` -## Included Tools - -### Development & Editors -- **nvim** - Neovim (LazyVim distribution) -- **git** - Git VCS -- **lazygit** - Terminal UI for git commands -- **gcc** - GNU C/C++ Compiler -- **python** - Python 3 - -### Kubernetes & Container Tools -- **kubectl** - Kubernetes command-line tool - -### Network & System Debugging -- **curl/wget** - HTTP clients -- **ping** - Network connectivity testing -- **traceroute** - Network path tracing -- **tcpdump** - Network packet analyzer -- **netstat** - Network statistics (via net-tools) -- **dig/nslookup** - DNS lookup tools (via dnsutils) -- **strace** - System call tracer - -### File & Text Processing -- **rg** - Ripgrep, fast text search -- **fzf** - Fuzzy finder -- **fd** - Fast file finder -- **jq** - JSON processor -- **yq** - YAML processor -- **grep/less** - Text processing utilities - -### Shell & Terminal -- **zsh** ZSH (with Oh My Zsh including auto-suggestions and syntax highlighting plugins) -- **tmux** - Terminal multiplexer - -### System Utilities -- **ps/top** - Process utilities (via procps) -- **unzip** - Archive extraction - -## Built-in Aliases - -- `k` → `kubectl` -- `vim` → `nvim` - ## Common Use Cases ### Kubernetes Debugging ```sh # Connect to a cluster and debug -docker run --rm -it -v ~/.kube:/root/.kube ghcr.io/tobyscott25/toolbox:latest +docker run --rm -it -v ~/.kube:/root/.kube ghcr.io/tbysctt/toolbox:latest k get pods # kubectl is aliased to 'k' ``` ### Network Troubleshooting ```sh # Run with host network for network debugging -docker run --rm -it --network host ghcr.io/tobyscott25/toolbox:latest +docker run --rm -it --network host ghcr.io/tbysctt/toolbox:latest ping google.com traceroute 8.8.8.8 tcpdump -i eth0 @@ -87,7 +43,7 @@ tcpdump -i eth0 ### File Analysis & Processing ```sh # Mount directory and analyze files -docker run --rm -it -v /path/to/files:/data ghcr.io/tobyscott25/toolbox:latest +docker run --rm -it -v /path/to/files:/data ghcr.io/tbysctt/toolbox:latest cd /data rg "pattern" . # Search with ripgrep fd "*.json" . | head # Find JSON files @@ -97,7 +53,7 @@ cat file.json | jq '.' # Pretty print JSON ### Development Environment ```sh # Use as a development container -docker run --rm -it -v $(pwd):/workspace -w /workspace ghcr.io/tobyscott25/toolbox:latest +docker run --rm -it -v $(pwd):/workspace -w /workspace ghcr.io/tbysctt/toolbox:latest nvim file.py git status lazygit @@ -108,7 +64,7 @@ lazygit ### With Docker Socket Access ```sh # For Docker-in-Docker scenarios -docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/tobyscott25/toolbox:latest +docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/tbysctt/toolbox:latest dive image:tag # Analyze Docker images ``` @@ -118,7 +74,7 @@ dive image:tag # Analyze Docker images docker run --rm -it \ -v ~/.gitconfig:/root/.gitconfig:ro \ -v ~/.kube:/root/.kube:ro \ - ghcr.io/tobyscott25/toolbox:latest + ghcr.io/tbysctt/toolbox:latest ``` ### As a Sidecar Container @@ -129,7 +85,7 @@ kind: Pod spec: containers: - name: debug-toolbox - image: ghcr.io/tobyscott25/toolbox:latest + image: ghcr.io/tbysctt/toolbox:latest command: ["sleep", "infinity"] # Then: kubectl exec -it pod-name -c debug-toolbox -- zsh ``` @@ -139,7 +95,7 @@ spec: To build, run and test locally: ```sh -git clone https://github.com/tobyscott25/toolbox.git +git clone https://github.com/tbysctt/toolbox.git cd toolbox docker build -t tobystoolbox:latest --platform=linux/amd64 . docker run --rm -it tobystoolbox:latest diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..c41dd56 --- /dev/null +++ b/setup.sh @@ -0,0 +1,48 @@ +#!/bin/ash +set -eux -o pipefail + +# Install dependencies +apk add --no-cache \ + bash ca-certificates curl wget git \ + zsh tmux less ripgrep fd fzf grep \ + jq yq unzip gcc musl-dev python3 \ + iputils bind-tools net-tools procps \ + strace tcpdump traceroute luarocks stow tzdata + +# Git identity defaults +git config --global user.name "Debug User" +git config --global user.email "user@host.tld" +git config --global init.defaultBranch main + +# Clone dotfiles and stow them +git clone https://github.com/tbysctt/dotfiles ~/dotfiles +cd ~/dotfiles && stow zsh vim lazyvim tmux lf + +# Install OhMyZsh and plugins +git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh +git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions +git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting + +# Install Neovim +curl -LO "https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz" +tar -xzf nvim-linux-x86_64.tar.gz +mv nvim-linux-x86_64 /opt/nvim +ln -s /opt/nvim/bin/nvim /usr/local/bin/nvim +rm nvim-linux-x86_64.tar.gz +nvim --headless "+Lazy! sync" +qa || true + +# Install kubectl +KUBECTL_VERSION=$(curl -Ls https://dl.k8s.io/release/stable.txt) +curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" +curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256" +echo "$(cat kubectl.sha256) kubectl" | sha256sum -c - +install -m755 kubectl /usr/local/bin/ +rm kubectl kubectl.sha256 + +# Install Lazygit +LAZYGIT_VERSION=$(curl -s https://api.github.com/repos/jesseduffield/lazygit/releases/latest | grep -Po '"tag_name": *"v\K[^"]*') +curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz" +tar xf lazygit.tar.gz lazygit +install -Dm755 lazygit /usr/local/bin/lazygit +rm lazygit.tar.gz lazygit +