Commit
·
279efce
1
Parent(s):
550e3e7
commit
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitignore +24 -0
- README.md +43 -6
- category.html +35 -0
- commands/ai-tools/audit-local-ai-packages.md +97 -0
- commands/ai-tools/comfyui/setup-comfyui.md +75 -0
- commands/ai-tools/gpu-ai-ml-assessment.md +441 -0
- commands/ai-tools/ollama/prune-ollama.md +14 -0
- commands/ai-tools/ollama/setup-ollama.md +57 -0
- commands/ai-tools/ollama/suggest-ollama-models.md +78 -0
- commands/ai-tools/setup-speech-to-text.md +112 -0
- commands/backup/identify-backup-targets.md +109 -0
- commands/bluetooth/reset-bluetooth.md +330 -0
- commands/bluetooth/troubleshoot-bluetooth.md +300 -0
- commands/configuration/add-bash-alias.md +9 -0
- commands/configuration/check-git-config.md +103 -0
- commands/configuration/check-global-gitignore.md +145 -0
- commands/configuration/check-path.md +209 -0
- commands/configuration/debug-folder-permissions.md +234 -0
- commands/configuration/list-ssh-connections.md +91 -0
- commands/configuration/manage-api-keys.md +101 -0
- commands/configuration/manage-ssh-keys.md +91 -0
- commands/configuration/mcp/manage-mcp-servers.md +104 -0
- commands/configuration/validate-bashrc.md +99 -0
- commands/debugging/check-boot-logs.md +43 -0
- commands/debugging/diagnose-crash.md +162 -0
- commands/debugging/diagnose-slowdown.md +134 -0
- commands/debugging/failed-boot-services.md +7 -0
- commands/debugging/review-boot.md +36 -0
- commands/dev-tools/node/node-version-check.md +1 -0
- commands/dev-tools/node/npm-install.md +1 -0
- commands/dev-tools/optimize-vscode-installation.md +131 -0
- commands/dev-tools/sdk-check.md +2 -0
- commands/dev-tools/setup-docker.md +258 -0
- commands/dev-tools/suggest-ides.md +115 -0
- commands/dev-tools/yadm/check-yadm.md +51 -0
- commands/dev-tools/yadm/manually-update-yadm.md +49 -0
- commands/display/list-connected-displays.md +72 -0
- commands/display/optimize-display-scaling.md +135 -0
- commands/display/setup-multi-monitor.md +90 -0
- commands/display/switch-display-profile.md +172 -0
- commands/filesystem-organization/chunking/chunk-this-dir.md +5 -0
- commands/filesystem-organization/consolidate-folders.md +46 -0
- commands/filesystem-organization/flatten.md +7 -0
- commands/filesystem-organization/separate-by-filetype.md +3 -0
- commands/filesystem-organization/separate-photos-and-video.md +5 -0
- commands/filesystem-organization/suggest-folder-structure.md +52 -0
- commands/filesystem-organization/tidy-up/desktop-tidy.md +9 -0
- commands/filesystem-organization/tidy-up/organize-loose-files.md +32 -0
- commands/fonts/install-google-fonts.md +80 -0
- commands/fonts/list-fonts.md +79 -0
.gitignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
*.so
|
| 6 |
+
.Python
|
| 7 |
+
env/
|
| 8 |
+
venv/
|
| 9 |
+
.venv/
|
| 10 |
+
|
| 11 |
+
# IDE
|
| 12 |
+
.vscode/
|
| 13 |
+
.idea/
|
| 14 |
+
*.swp
|
| 15 |
+
*.swo
|
| 16 |
+
|
| 17 |
+
# OS
|
| 18 |
+
.DS_Store
|
| 19 |
+
Thumbs.db
|
| 20 |
+
|
| 21 |
+
# Temporary files
|
| 22 |
+
*.tmp
|
| 23 |
+
*.bak
|
| 24 |
+
*~
|
README.md
CHANGED
|
@@ -1,11 +1,48 @@
|
|
| 1 |
---
|
| 2 |
-
title: Claude Code Slash Commands
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
-
short_description:
|
| 9 |
---
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Claude Code Linux Desktop Slash Commands
|
| 3 |
+
emoji: 🖥️
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
short_description: Searchable collection of Claude Code slash commands for Linux system administration
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Claude Code Linux Desktop Slash Commands
|
| 12 |
+
|
| 13 |
+
A comprehensive, searchable collection of [Claude Code](https://claude.com/claude-code) slash commands for Linux desktop system administration and configuration tasks.
|
| 14 |
+
|
| 15 |
+
## Features
|
| 16 |
+
|
| 17 |
+
- **44 Categories** covering AI tools, system health, hardware, networking, security, and more
|
| 18 |
+
- **111+ Commands** for system administration tasks
|
| 19 |
+
- **Clean Interface** with category browsing and search functionality
|
| 20 |
+
- **Easy Copy** - One-click copying of command names
|
| 21 |
+
- **Expandable Details** - View full command documentation inline
|
| 22 |
+
- **Tag System** - Commands organized with descriptive tags
|
| 23 |
+
|
| 24 |
+
## Categories Include
|
| 25 |
+
|
| 26 |
+
- AI Tools (Ollama, ComfyUI, ML packages)
|
| 27 |
+
- System Health & Diagnostics
|
| 28 |
+
- Hardware Configuration & Optimization
|
| 29 |
+
- Network Management
|
| 30 |
+
- Package Management
|
| 31 |
+
- Python & Development Tools
|
| 32 |
+
- Security & Backup
|
| 33 |
+
- KDE & Display Configuration
|
| 34 |
+
- And many more...
|
| 35 |
+
|
| 36 |
+
## Usage
|
| 37 |
+
|
| 38 |
+
1. Browse categories on the home page
|
| 39 |
+
2. Click a category to view all commands in that category
|
| 40 |
+
3. Use search to filter commands by name or description
|
| 41 |
+
4. Click command headers to expand and view full documentation
|
| 42 |
+
5. Click "Copy" to copy the command name to clipboard
|
| 43 |
+
|
| 44 |
+
## Source
|
| 45 |
+
|
| 46 |
+
This collection is maintained at: [github.com/danielrosehill/Claude-Code-Linux-Desktop-Slash-Commands](https://github.com/danielrosehill/Claude-Code-Linux-Desktop-Slash-Commands)
|
| 47 |
+
|
| 48 |
+
Created by [Daniel Rosehill](https://danielrosehill.com)
|
category.html
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Category - Claude Code Commands</title>
|
| 7 |
+
<link rel="stylesheet" href="styles.css">
|
| 8 |
+
</head>
|
| 9 |
+
<body>
|
| 10 |
+
<header>
|
| 11 |
+
<div class="container">
|
| 12 |
+
<a href="index.html" class="back-link">← Back to Categories</a>
|
| 13 |
+
<h1 id="categoryTitle">Commands</h1>
|
| 14 |
+
</div>
|
| 15 |
+
</header>
|
| 16 |
+
|
| 17 |
+
<main class="container">
|
| 18 |
+
<div class="search-box">
|
| 19 |
+
<input type="text" id="searchInput" placeholder="Search commands in this category..." onkeyup="filterCommands()">
|
| 20 |
+
</div>
|
| 21 |
+
|
| 22 |
+
<div class="commands-list" id="commandsList">
|
| 23 |
+
<!-- Commands will be loaded here by JavaScript -->
|
| 24 |
+
</div>
|
| 25 |
+
</main>
|
| 26 |
+
|
| 27 |
+
<footer>
|
| 28 |
+
<div class="container">
|
| 29 |
+
<p>Created by Daniel Rosehill | <a href="https://github.com/danielrosehill/Claude-Code-Linux-Desktop-Slash-Commands" target="_blank">GitHub Repository</a></p>
|
| 30 |
+
</div>
|
| 31 |
+
</footer>
|
| 32 |
+
|
| 33 |
+
<script src="script.js"></script>
|
| 34 |
+
</body>
|
| 35 |
+
</html>
|
commands/ai-tools/audit-local-ai-packages.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Evaluate local AI inference packages and suggest additions
|
| 3 |
+
tags: [ai, ml, inference, packages, recommendations, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user evaluate their local AI inference setup and suggest packages to install.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check currently installed AI/ML packages**
|
| 11 |
+
|
| 12 |
+
**Python packages:**
|
| 13 |
+
- `pip list | grep -E "torch|tensorflow|transformers|diffusers|onnx"`
|
| 14 |
+
|
| 15 |
+
**System packages:**
|
| 16 |
+
- `dpkg -l | grep -E "rocm|cuda|python3-"`
|
| 17 |
+
|
| 18 |
+
**Conda environments:**
|
| 19 |
+
- `conda env list` (if conda is installed)
|
| 20 |
+
|
| 21 |
+
**Standalone tools:**
|
| 22 |
+
- Check for: Ollama, ComfyUI, LocalAI, text-generation-webui
|
| 23 |
+
- Check `~/programs/ai-ml/`
|
| 24 |
+
|
| 25 |
+
2. **Assess hardware configuration**
|
| 26 |
+
- GPU: `rocm-smi` or `nvidia-smi`
|
| 27 |
+
- RAM: `free -h`
|
| 28 |
+
- Storage: `df -h`
|
| 29 |
+
- CPU capabilities: `lscpu | grep -E "Model name|Thread|Core"`
|
| 30 |
+
|
| 31 |
+
3. **Categorize AI inference needs**
|
| 32 |
+
|
| 33 |
+
**LLM Inference:**
|
| 34 |
+
- Ollama (already covered)
|
| 35 |
+
- llama.cpp
|
| 36 |
+
- vllm
|
| 37 |
+
- text-generation-webui (oobabooga)
|
| 38 |
+
- LocalAI
|
| 39 |
+
|
| 40 |
+
**Image Generation:**
|
| 41 |
+
- ComfyUI (already covered)
|
| 42 |
+
- AUTOMATIC1111/stable-diffusion-webui
|
| 43 |
+
- InvokeAI
|
| 44 |
+
- Fooocus
|
| 45 |
+
|
| 46 |
+
**Audio/Speech:**
|
| 47 |
+
- Whisper (speech-to-text)
|
| 48 |
+
- Coqui TTS
|
| 49 |
+
- Bark
|
| 50 |
+
- MusicGen
|
| 51 |
+
|
| 52 |
+
**Video:**
|
| 53 |
+
- AnimateDiff
|
| 54 |
+
- Video generation models
|
| 55 |
+
|
| 56 |
+
**Code:**
|
| 57 |
+
- Continue.dev
|
| 58 |
+
- Tabby (local copilot)
|
| 59 |
+
- Aider
|
| 60 |
+
|
| 61 |
+
**Vector DB / RAG:**
|
| 62 |
+
- ChromaDB
|
| 63 |
+
- Qdrant
|
| 64 |
+
- FAISS
|
| 65 |
+
- LangChain
|
| 66 |
+
|
| 67 |
+
4. **Check Python ML libraries**
|
| 68 |
+
- PyTorch (with ROCm/CUDA)
|
| 69 |
+
- TensorFlow
|
| 70 |
+
- transformers (Hugging Face)
|
| 71 |
+
- diffusers
|
| 72 |
+
- accelerate
|
| 73 |
+
- bitsandbytes (quantization)
|
| 74 |
+
- ONNX Runtime
|
| 75 |
+
- optimum
|
| 76 |
+
|
| 77 |
+
5. **Suggest based on gaps**
|
| 78 |
+
- Identify what's missing for common workflows
|
| 79 |
+
- Prioritize based on hardware capabilities
|
| 80 |
+
- Consider ease of use vs. flexibility
|
| 81 |
+
|
| 82 |
+
6. **Installation recommendations**
|
| 83 |
+
- Provide commands for suggested packages
|
| 84 |
+
- Recommend conda environments for isolation
|
| 85 |
+
- Suggest Docker containers for complex setups
|
| 86 |
+
|
| 87 |
+
## Output
|
| 88 |
+
|
| 89 |
+
Provide a report showing:
|
| 90 |
+
- Currently installed AI/ML packages by category
|
| 91 |
+
- Hardware capability summary
|
| 92 |
+
- Recommended packages to install based on:
|
| 93 |
+
- User's hardware
|
| 94 |
+
- Current gaps in capabilities
|
| 95 |
+
- Popular/useful tools
|
| 96 |
+
- Installation commands for each suggestion
|
| 97 |
+
- Notes on hardware requirements
|
commands/ai-tools/comfyui/setup-comfyui.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Set up ComfyUI for AI image generation
|
| 3 |
+
tags: [ai, ml, comfyui, image-generation, setup, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user set up ComfyUI for AI image generation.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check if ComfyUI is already installed**
|
| 11 |
+
- Check in `~/programs/ai-ml/ComfyUI` (Daniel's typical location)
|
| 12 |
+
- Look for existing installation
|
| 13 |
+
|
| 14 |
+
2. **Install prerequisites**
|
| 15 |
+
- Python 3.10+ (check: `python3 --version`)
|
| 16 |
+
- Git (check: `git --version`)
|
| 17 |
+
- For AMD GPU (ROCm):
|
| 18 |
+
- Ensure ROCm is installed: `rocminfo`
|
| 19 |
+
- PyTorch with ROCm support needed
|
| 20 |
+
|
| 21 |
+
3. **Clone ComfyUI repository**
|
| 22 |
+
- Navigate to: `cd ~/programs/ai-ml/`
|
| 23 |
+
- Clone: `git clone https://github.com/comfyanonymous/ComfyUI.git`
|
| 24 |
+
- Enter directory: `cd ComfyUI`
|
| 25 |
+
|
| 26 |
+
4. **Set up Python environment**
|
| 27 |
+
- Create venv: `python3 -m venv venv`
|
| 28 |
+
- Activate: `source venv/bin/activate`
|
| 29 |
+
- Upgrade pip: `pip install --upgrade pip`
|
| 30 |
+
|
| 31 |
+
5. **Install dependencies**
|
| 32 |
+
- For AMD GPU (ROCm):
|
| 33 |
+
```bash
|
| 34 |
+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.0
|
| 35 |
+
```
|
| 36 |
+
- Install ComfyUI requirements: `pip install -r requirements.txt`
|
| 37 |
+
|
| 38 |
+
6. **Download initial models**
|
| 39 |
+
- Create model directories if needed
|
| 40 |
+
- Suggest downloading a base model (SD 1.5 or SDXL):
|
| 41 |
+
- Models go in: `ComfyUI/models/checkpoints/`
|
| 42 |
+
- VAE in: `ComfyUI/models/vae/`
|
| 43 |
+
- LoRAs in: `ComfyUI/models/loras/`
|
| 44 |
+
- Suggest civitai.com or huggingface.co for models
|
| 45 |
+
|
| 46 |
+
7. **Test ComfyUI**
|
| 47 |
+
- Run: `python main.py`
|
| 48 |
+
- Should start on `http://127.0.0.1:8188`
|
| 49 |
+
- Check logs for GPU detection
|
| 50 |
+
|
| 51 |
+
8. **Create launch script**
|
| 52 |
+
- Offer to create `~/programs/ai-ml/ComfyUI/run_comfyui.sh`:
|
| 53 |
+
```bash
|
| 54 |
+
#!/bin/bash
|
| 55 |
+
cd ~/programs/ai-ml/ComfyUI
|
| 56 |
+
source venv/bin/activate
|
| 57 |
+
python main.py
|
| 58 |
+
```
|
| 59 |
+
- Make executable: `chmod +x run_comfyui.sh`
|
| 60 |
+
|
| 61 |
+
9. **Suggest useful custom nodes**
|
| 62 |
+
- ComfyUI Manager (for easy node installation)
|
| 63 |
+
- ControlNet nodes
|
| 64 |
+
- Ultimate SD Upscale
|
| 65 |
+
- Efficiency nodes
|
| 66 |
+
|
| 67 |
+
## Output
|
| 68 |
+
|
| 69 |
+
Provide a summary showing:
|
| 70 |
+
- Installation status
|
| 71 |
+
- GPU detection status
|
| 72 |
+
- Model directory locations
|
| 73 |
+
- How to launch ComfyUI
|
| 74 |
+
- Recommended next steps (model downloads, custom nodes)
|
| 75 |
+
- Troubleshooting tips for AMD GPU
|
commands/ai-tools/gpu-ai-ml-assessment.md
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are assessing GPU driver status and AI/ML workload capabilities.
|
| 2 |
+
|
| 3 |
+
## Your Task
|
| 4 |
+
|
| 5 |
+
Evaluate the GPU's driver configuration and suitability for AI/ML workloads, including deep learning frameworks, compute capabilities, and performance optimization.
|
| 6 |
+
|
| 7 |
+
### 1. Driver Status Assessment
|
| 8 |
+
- **Installed driver**: Type (proprietary/open-source) and version
|
| 9 |
+
- **Driver source**: Distribution package, vendor installer, or compiled
|
| 10 |
+
- **Driver status**: Loaded, functioning, errors
|
| 11 |
+
- **Kernel module**: Module name and status
|
| 12 |
+
- **Driver age**: Release date and recency
|
| 13 |
+
- **Latest driver**: Compare installed vs. available
|
| 14 |
+
- **Driver compatibility**: Kernel version compatibility
|
| 15 |
+
- **Secure boot status**: Impact on driver loading
|
| 16 |
+
|
| 17 |
+
### 2. Compute Framework Support
|
| 18 |
+
- **CUDA availability**: CUDA Toolkit installation status
|
| 19 |
+
- **CUDA version**: Installed CUDA version
|
| 20 |
+
- **CUDA compatibility**: GPU compute capability vs. CUDA requirements
|
| 21 |
+
- **ROCm availability**: For AMD GPUs
|
| 22 |
+
- **ROCm version**: Installed ROCm version
|
| 23 |
+
- **OpenCL support**: OpenCL runtime and version
|
| 24 |
+
- **oneAPI**: Intel oneAPI toolkit status
|
| 25 |
+
- **Framework libraries**: cuDNN, cuBLAS, TensorRT, etc.
|
| 26 |
+
|
| 27 |
+
### 3. GPU Compute Capabilities
|
| 28 |
+
- **Compute capability**: NVIDIA CUDA compute version (e.g., 8.6, 8.9)
|
| 29 |
+
- **Architecture suitability**: Architecture generation for AI/ML
|
| 30 |
+
- **Tensor cores**: Presence and version (Gen 1/2/3/4)
|
| 31 |
+
- **RT cores**: Ray tracing acceleration (less relevant for ML)
|
| 32 |
+
- **Memory bandwidth**: Critical for ML workloads
|
| 33 |
+
- **VRAM capacity**: Memory size for model loading
|
| 34 |
+
- **FP64/FP32/FP16/INT8**: Precision support
|
| 35 |
+
- **TF32**: Tensor Float 32 support (Ampere+)
|
| 36 |
+
- **Mixed precision**: Automatic mixed precision capability
|
| 37 |
+
|
| 38 |
+
### 4. Deep Learning Framework Compatibility
|
| 39 |
+
- **PyTorch**: Installation status and CUDA/ROCm support
|
| 40 |
+
- **TensorFlow**: Installation and GPU backend
|
| 41 |
+
- **JAX**: Google JAX framework support
|
| 42 |
+
- **ONNX Runtime**: ONNX with GPU acceleration
|
| 43 |
+
- **MXNet**: Apache MXNet support
|
| 44 |
+
- **Hugging Face**: Transformers library GPU support
|
| 45 |
+
- **Framework versions**: Installed versions and compatibility
|
| 46 |
+
|
| 47 |
+
### 5. AI/ML Library Ecosystem
|
| 48 |
+
- **cuDNN**: NVIDIA Deep Neural Network library
|
| 49 |
+
- **cuBLAS**: CUDA Basic Linear Algebra Subprograms
|
| 50 |
+
- **TensorRT**: High-performance deep learning inference
|
| 51 |
+
- **NCCL**: NVIDIA Collective Communications Library (multi-GPU)
|
| 52 |
+
- **MIOpen**: AMD GPU-accelerated primitives
|
| 53 |
+
- **rocBLAS**: AMD GPU BLAS library
|
| 54 |
+
- **oneDNN**: Intel Deep Neural Network library
|
| 55 |
+
|
| 56 |
+
### 6. Performance Characteristics
|
| 57 |
+
- **Memory bandwidth**: GB/s for data transfer
|
| 58 |
+
- **Compute throughput**: TFLOPS for different precisions
|
| 59 |
+
- FP64 (double precision)
|
| 60 |
+
- FP32 (single precision)
|
| 61 |
+
- FP16 (half precision)
|
| 62 |
+
- INT8 (integer quantization)
|
| 63 |
+
- TF32 (Tensor Float 32)
|
| 64 |
+
- **Tensor core performance**: Dedicated AI acceleration
|
| 65 |
+
- **Sparse tensor support**: Structured sparsity acceleration
|
| 66 |
+
|
| 67 |
+
### 7. Model Size Compatibility
|
| 68 |
+
- **VRAM capacity**: Total GPU memory
|
| 69 |
+
- **Practical model sizes**: Estimated model capacity
|
| 70 |
+
- Small models: < 1B parameters
|
| 71 |
+
- Medium models: 1B-7B parameters
|
| 72 |
+
- Large models: 7B-70B parameters
|
| 73 |
+
- Very large models: > 70B parameters
|
| 74 |
+
- **Batch size implications**: VRAM for different batch sizes
|
| 75 |
+
- **Multi-GPU potential**: Scaling across GPUs
|
| 76 |
+
|
| 77 |
+
### 8. Container and Virtualization Support
|
| 78 |
+
- **Docker NVIDIA runtime**: nvidia-docker/NVIDIA Container Toolkit
|
| 79 |
+
- **Docker ROCm runtime**: ROCm Docker support
|
| 80 |
+
- **Podman GPU support**: GPU passthrough capability
|
| 81 |
+
- **Kubernetes GPU**: Device plugin support
|
| 82 |
+
- **GPU passthrough**: VM GPU assignment capability
|
| 83 |
+
- **vGPU support**: Virtual GPU for multi-tenancy
|
| 84 |
+
|
| 85 |
+
### 9. Monitoring and Profiling Tools
|
| 86 |
+
- **nvidia-smi**: Real-time monitoring (NVIDIA)
|
| 87 |
+
- **rocm-smi**: ROCm system management (AMD)
|
| 88 |
+
- **Nsight Systems**: NVIDIA profiling suite
|
| 89 |
+
- **Nsight Compute**: CUDA kernel profiler
|
| 90 |
+
- **nvtop/radeontop**: Terminal GPU monitoring
|
| 91 |
+
- **PyTorch profiler**: Framework-level profiling
|
| 92 |
+
- **TensorBoard**: Training visualization
|
| 93 |
+
|
| 94 |
+
### 10. Optimization Features
|
| 95 |
+
- **Automatic mixed precision**: AMP support
|
| 96 |
+
- **Gradient checkpointing**: Memory optimization
|
| 97 |
+
- **Flash Attention**: Optimized attention mechanisms
|
| 98 |
+
- **Quantization support**: INT8, INT4 inference
|
| 99 |
+
- **Model compilation**: TorchScript, XLA, TensorRT
|
| 100 |
+
- **Distributed training**: Multi-GPU training support
|
| 101 |
+
- **CUDA graphs**: Kernel launch optimization
|
| 102 |
+
|
| 103 |
+
### 11. Workload Suitability Assessment
|
| 104 |
+
- **Training capability**: Suitable for training workloads
|
| 105 |
+
- **Inference capability**: Suitable for inference
|
| 106 |
+
- **Model type suitability**:
|
| 107 |
+
- Computer vision (CNNs)
|
| 108 |
+
- Natural language processing (Transformers)
|
| 109 |
+
- Generative AI (Diffusion models, LLMs)
|
| 110 |
+
- Reinforcement learning
|
| 111 |
+
- **Performance tier**: Consumer, Professional, Data Center
|
| 112 |
+
|
| 113 |
+
### 12. Bottleneck and Limitation Analysis
|
| 114 |
+
- **Memory bottlenecks**: VRAM limitations for large models
|
| 115 |
+
- **Compute bottlenecks**: GPU power for training speed
|
| 116 |
+
- **PCIe bandwidth**: Data transfer limitations
|
| 117 |
+
- **Driver limitations**: Missing features or bugs
|
| 118 |
+
- **Power throttling**: Thermal or power constraints
|
| 119 |
+
- **Multi-GPU scaling**: Efficiency of multi-GPU setup
|
| 120 |
+
|
| 121 |
+
## Commands to Use
|
| 122 |
+
|
| 123 |
+
**GPU and driver detection:**
|
| 124 |
+
- `nvidia-smi` (NVIDIA)
|
| 125 |
+
- `rocm-smi` (AMD)
|
| 126 |
+
- `lspci | grep -i vga`
|
| 127 |
+
- `lspci -v | grep -A 20 VGA`
|
| 128 |
+
|
| 129 |
+
**NVIDIA driver details:**
|
| 130 |
+
- `nvidia-smi -q`
|
| 131 |
+
- `cat /proc/driver/nvidia/version`
|
| 132 |
+
- `modinfo nvidia`
|
| 133 |
+
- `nvidia-smi --query-gpu=driver_version --format=csv,noheader`
|
| 134 |
+
|
| 135 |
+
**AMD driver details:**
|
| 136 |
+
- `modinfo amdgpu`
|
| 137 |
+
- `rocminfo`
|
| 138 |
+
- `/opt/rocm/bin/rocm-smi --showdriverversion`
|
| 139 |
+
|
| 140 |
+
**CUDA/ROCm installation:**
|
| 141 |
+
- `nvcc --version` (CUDA compiler)
|
| 142 |
+
- `which nvcc`
|
| 143 |
+
- `ls /usr/local/cuda*/`
|
| 144 |
+
- `echo $CUDA_HOME`
|
| 145 |
+
- `hipcc --version` (ROCm)
|
| 146 |
+
- `ls /opt/rocm/`
|
| 147 |
+
|
| 148 |
+
**Compute capability:**
|
| 149 |
+
- `nvidia-smi --query-gpu=compute_cap --format=csv,noheader`
|
| 150 |
+
- `nvidia-smi -q | grep "Compute Capability"`
|
| 151 |
+
|
| 152 |
+
**Libraries check:**
|
| 153 |
+
- `ldconfig -p | grep cudnn`
|
| 154 |
+
- `ldconfig -p | grep cublas`
|
| 155 |
+
- `ldconfig -p | grep tensorrt`
|
| 156 |
+
- `ldconfig -p | grep nccl`
|
| 157 |
+
- `ls /usr/lib/x86_64-linux-gnu/ | grep -i cuda`
|
| 158 |
+
|
| 159 |
+
**Python framework check:**
|
| 160 |
+
- `python3 -c "import torch; print(f'PyTorch: {torch.__version__}, CUDA: {torch.cuda.is_available()}, Version: {torch.version.cuda}')"`
|
| 161 |
+
- `python3 -c "import tensorflow as tf; print(f'TensorFlow: {tf.__version__}, GPU: {tf.config.list_physical_devices(\"GPU\")}')"`
|
| 162 |
+
- `python3 -c "import torch; print(f'Tensor Cores: {torch.cuda.get_device_capability()}')"`
|
| 163 |
+
|
| 164 |
+
**Container runtime:**
|
| 165 |
+
- `docker run --rm --gpus all nvidia/cuda:11.8.0-base-ubuntu22.04 nvidia-smi`
|
| 166 |
+
- `which nvidia-container-cli`
|
| 167 |
+
- `nvidia-container-cli info`
|
| 168 |
+
|
| 169 |
+
**OpenCL:**
|
| 170 |
+
- `clinfo`
|
| 171 |
+
- `clinfo | grep "Device Name"`
|
| 172 |
+
|
| 173 |
+
**System libraries:**
|
| 174 |
+
- `dpkg -l | grep -i cuda`
|
| 175 |
+
- `dpkg -l | grep -i nvidia`
|
| 176 |
+
- `dpkg -l | grep -i rocm`
|
| 177 |
+
|
| 178 |
+
**Performance info:**
|
| 179 |
+
- `nvidia-smi --query-gpu=name,memory.total,memory.free,driver_version,compute_cap --format=csv`
|
| 180 |
+
- `nvidia-smi dmon -s pucvmet` (dynamic monitoring)
|
| 181 |
+
|
| 182 |
+
## Output Format
|
| 183 |
+
|
| 184 |
+
### Executive Summary
|
| 185 |
+
```
|
| 186 |
+
GPU: [model]
|
| 187 |
+
Driver: [proprietary/open] v[version] ([status])
|
| 188 |
+
Compute: [CUDA/ROCm] v[version] (Compute [capability])
|
| 189 |
+
AI/ML Readiness: [Ready/Partial/Not Ready]
|
| 190 |
+
Best For: [Training/Inference/Both]
|
| 191 |
+
Recommended Frameworks: [PyTorch, TensorFlow, etc.]
|
| 192 |
+
```
|
| 193 |
+
|
| 194 |
+
### Detailed AI/ML Assessment
|
| 195 |
+
|
| 196 |
+
**Driver Status:**
|
| 197 |
+
- Type: [Proprietary/Open Source]
|
| 198 |
+
- Version: [version number]
|
| 199 |
+
- Release Date: [date]
|
| 200 |
+
- Status: [Loaded/Error]
|
| 201 |
+
- Kernel Module: [module] ([loaded/not loaded])
|
| 202 |
+
- Latest Available: [version]
|
| 203 |
+
- Update Recommended: [Yes/No]
|
| 204 |
+
- Secure Boot: [Compatible/Issue]
|
| 205 |
+
|
| 206 |
+
**Compute Framework Availability:**
|
| 207 |
+
- CUDA Toolkit: [Installed/Not Installed] - v[version]
|
| 208 |
+
- CUDA Driver API: v[version]
|
| 209 |
+
- ROCm: [Installed/Not Installed] - v[version]
|
| 210 |
+
- OpenCL: [Available/Not Available] - v[version]
|
| 211 |
+
- Compute Capability: [X.X] ([architecture name])
|
| 212 |
+
|
| 213 |
+
**GPU Compute Specifications:**
|
| 214 |
+
- Architecture: [Turing/Ampere/Ada/RDNA3/Xe]
|
| 215 |
+
- Tensor Cores: [Yes/No] - [Generation]
|
| 216 |
+
- CUDA Cores / SPs: [count]
|
| 217 |
+
- VRAM: [GB] [memory type]
|
| 218 |
+
- Memory Bandwidth: [GB/s]
|
| 219 |
+
- Precision Support:
|
| 220 |
+
- FP64: [TFLOPS]
|
| 221 |
+
- FP32: [TFLOPS]
|
| 222 |
+
- FP16: [TFLOPS]
|
| 223 |
+
- INT8: [TOPS]
|
| 224 |
+
- TF32: [Yes/No]
|
| 225 |
+
|
| 226 |
+
**AI/ML Libraries:**
|
| 227 |
+
- cuDNN: [version] ([installed/missing])
|
| 228 |
+
- cuBLAS: [version] ([installed/missing])
|
| 229 |
+
- TensorRT: [version] ([installed/missing])
|
| 230 |
+
- NCCL: [version] ([installed/missing])
|
| 231 |
+
- MIOpen: [version] (AMD only)
|
| 232 |
+
- rocBLAS: [version] (AMD only)
|
| 233 |
+
|
| 234 |
+
**Deep Learning Framework Support:**
|
| 235 |
+
- PyTorch: [version]
|
| 236 |
+
- CUDA Enabled: [Yes/No]
|
| 237 |
+
- CUDA Version: [version]
|
| 238 |
+
- cuDNN Version: [version]
|
| 239 |
+
- TensorFlow: [version]
|
| 240 |
+
- GPU Support: [Yes/No]
|
| 241 |
+
- CUDA Version: [version]
|
| 242 |
+
- JAX: [installed/not installed]
|
| 243 |
+
- ONNX Runtime: [GPU backend available]
|
| 244 |
+
|
| 245 |
+
**Container Support:**
|
| 246 |
+
- NVIDIA Container Toolkit: [installed/not installed]
|
| 247 |
+
- Docker GPU Access: [working/not working]
|
| 248 |
+
- Podman GPU Support: [available]
|
| 249 |
+
|
| 250 |
+
**Model Capacity Estimates:**
|
| 251 |
+
- Small Models (< 1B params): [batch size X]
|
| 252 |
+
- Medium Models (1B-7B params): [batch size X]
|
| 253 |
+
- Large Models (7B-13B params): [batch size X]
|
| 254 |
+
- Very Large Models (13B-70B params): [requires multi-GPU or not possible]
|
| 255 |
+
|
| 256 |
+
Example workload estimates based on [GB] VRAM:
|
| 257 |
+
- LLaMA 7B: [inference only/training possible]
|
| 258 |
+
- Stable Diffusion: [batch size X]
|
| 259 |
+
- BERT Base: [batch size X]
|
| 260 |
+
- GPT-2: [batch size X]
|
| 261 |
+
|
| 262 |
+
**Workload Suitability:**
|
| 263 |
+
- Training:
|
| 264 |
+
- Small models: [Excellent/Good/Fair/Poor]
|
| 265 |
+
- Medium models: [rating]
|
| 266 |
+
- Large models: [rating]
|
| 267 |
+
- Inference:
|
| 268 |
+
- Real-time: [Excellent/Good/Fair/Poor]
|
| 269 |
+
- Batch: [rating]
|
| 270 |
+
- Low-latency: [rating]
|
| 271 |
+
|
| 272 |
+
**Use Case Recommendations:**
|
| 273 |
+
- Computer Vision (CNNs): [Excellent/Good/Fair/Poor]
|
| 274 |
+
- NLP (Transformers): [rating]
|
| 275 |
+
- Generative AI (LLMs): [rating]
|
| 276 |
+
- Diffusion Models: [rating]
|
| 277 |
+
- Reinforcement Learning: [rating]
|
| 278 |
+
|
| 279 |
+
**Performance Tier:**
|
| 280 |
+
- Category: [Consumer/Professional/Data Center]
|
| 281 |
+
- Training Performance: [rating]
|
| 282 |
+
- Inference Performance: [rating]
|
| 283 |
+
- Multi-GPU Scaling: [available/not available]
|
| 284 |
+
|
| 285 |
+
**Optimization Features Available:**
|
| 286 |
+
- Automatic Mixed Precision: [Yes/No]
|
| 287 |
+
- Tensor Core Utilization: [Yes/No]
|
| 288 |
+
- TensorRT Optimization: [Available]
|
| 289 |
+
- Flash Attention: [Supported]
|
| 290 |
+
- INT8 Quantization: [Supported]
|
| 291 |
+
- Multi-GPU Training: [Possible with [count] GPUs]
|
| 292 |
+
|
| 293 |
+
**Limitations and Bottlenecks:**
|
| 294 |
+
- VRAM Constraint: [assessment]
|
| 295 |
+
- Memory Bandwidth: [adequate/limited]
|
| 296 |
+
- Compute Throughput: [assessment]
|
| 297 |
+
- PCIe Bottleneck: [yes/no]
|
| 298 |
+
- Driver Limitations: [any known issues]
|
| 299 |
+
- Power/Thermal: [throttling concerns]
|
| 300 |
+
|
| 301 |
+
**Recommendations:**
|
| 302 |
+
1. [Driver update/optimization suggestions]
|
| 303 |
+
2. [Framework installation recommendations]
|
| 304 |
+
3. [Workload optimization suggestions]
|
| 305 |
+
4. [Hardware upgrade path if applicable]
|
| 306 |
+
5. [Container/virtualization setup if beneficial]
|
| 307 |
+
|
| 308 |
+
### AI/ML Readiness Scorecard
|
| 309 |
+
|
| 310 |
+
```
|
| 311 |
+
Driver Setup: [✓/✗/⚠] [details]
|
| 312 |
+
CUDA/ROCm Install: [✓/✗/⚠] [details]
|
| 313 |
+
Framework Support: [✓/✗/⚠] [details]
|
| 314 |
+
Library Ecosystem: [✓/✗/⚠] [details]
|
| 315 |
+
Container Runtime: [✓/✗/⚠] [details]
|
| 316 |
+
VRAM Capacity: [✓/✗/⚠] [details]
|
| 317 |
+
Compute Performance: [✓/✗/⚠] [details]
|
| 318 |
+
|
| 319 |
+
Overall Readiness: [Ready/Needs Setup/Limited/Not Suitable]
|
| 320 |
+
```
|
| 321 |
+
|
| 322 |
+
### AI-Readable JSON
|
| 323 |
+
|
| 324 |
+
```json
|
| 325 |
+
{
|
| 326 |
+
"driver": {
|
| 327 |
+
"type": "proprietary|open_source",
|
| 328 |
+
"version": "",
|
| 329 |
+
"status": "loaded|error",
|
| 330 |
+
"latest_available": "",
|
| 331 |
+
"update_recommended": false
|
| 332 |
+
},
|
| 333 |
+
"compute_platform": {
|
| 334 |
+
"cuda": {
|
| 335 |
+
"installed": false,
|
| 336 |
+
"version": "",
|
| 337 |
+
"compute_capability": ""
|
| 338 |
+
},
|
| 339 |
+
"rocm": {
|
| 340 |
+
"installed": false,
|
| 341 |
+
"version": ""
|
| 342 |
+
},
|
| 343 |
+
"opencl": {
|
| 344 |
+
"available": false,
|
| 345 |
+
"version": ""
|
| 346 |
+
}
|
| 347 |
+
},
|
| 348 |
+
"gpu_specs": {
|
| 349 |
+
"architecture": "",
|
| 350 |
+
"tensor_cores": false,
|
| 351 |
+
"vram_gb": 0,
|
| 352 |
+
"memory_bandwidth_gbs": 0,
|
| 353 |
+
"fp32_tflops": 0,
|
| 354 |
+
"fp16_tflops": 0,
|
| 355 |
+
"int8_tops": 0,
|
| 356 |
+
"tf32_support": false
|
| 357 |
+
},
|
| 358 |
+
"libraries": {
|
| 359 |
+
"cudnn": "",
|
| 360 |
+
"cublas": "",
|
| 361 |
+
"tensorrt": "",
|
| 362 |
+
"nccl": ""
|
| 363 |
+
},
|
| 364 |
+
"frameworks": {
|
| 365 |
+
"pytorch": {
|
| 366 |
+
"installed": false,
|
| 367 |
+
"version": "",
|
| 368 |
+
"cuda_available": false
|
| 369 |
+
},
|
| 370 |
+
"tensorflow": {
|
| 371 |
+
"installed": false,
|
| 372 |
+
"version": "",
|
| 373 |
+
"gpu_available": false
|
| 374 |
+
}
|
| 375 |
+
},
|
| 376 |
+
"container_support": {
|
| 377 |
+
"nvidia_container_toolkit": false,
|
| 378 |
+
"docker_gpu_working": false
|
| 379 |
+
},
|
| 380 |
+
"workload_suitability": {
|
| 381 |
+
"training": {
|
| 382 |
+
"small_models": "excellent|good|fair|poor",
|
| 383 |
+
"medium_models": "",
|
| 384 |
+
"large_models": ""
|
| 385 |
+
},
|
| 386 |
+
"inference": {
|
| 387 |
+
"real_time": "",
|
| 388 |
+
"batch": ""
|
| 389 |
+
}
|
| 390 |
+
},
|
| 391 |
+
"model_capacity": {
|
| 392 |
+
"vram_gb": 0,
|
| 393 |
+
"small_model_batch_size": 0,
|
| 394 |
+
"llama_7b_possible": false,
|
| 395 |
+
"stable_diffusion_batch": 0
|
| 396 |
+
},
|
| 397 |
+
"optimization_features": {
|
| 398 |
+
"amp_support": false,
|
| 399 |
+
"tensor_core_utilization": false,
|
| 400 |
+
"tensorrt_available": false,
|
| 401 |
+
"int8_quantization": false
|
| 402 |
+
},
|
| 403 |
+
"bottlenecks": {
|
| 404 |
+
"vram_limited": false,
|
| 405 |
+
"compute_limited": false,
|
| 406 |
+
"pcie_bottleneck": false
|
| 407 |
+
},
|
| 408 |
+
"ai_ml_readiness": "ready|needs_setup|limited|not_suitable"
|
| 409 |
+
}
|
| 410 |
+
```
|
| 411 |
+
|
| 412 |
+
## Execution Guidelines
|
| 413 |
+
|
| 414 |
+
1. **Identify GPU vendor first**: NVIDIA, AMD, or Intel
|
| 415 |
+
2. **Check driver installation**: Verify driver is loaded and working
|
| 416 |
+
3. **Assess compute platform**: CUDA for NVIDIA, ROCm for AMD
|
| 417 |
+
4. **Query compute capability**: Critical for framework compatibility
|
| 418 |
+
5. **Check library installation**: cuDNN, TensorRT, etc.
|
| 419 |
+
6. **Test framework access**: Try importing PyTorch/TensorFlow with GPU
|
| 420 |
+
7. **Evaluate VRAM capacity**: Estimate model sizes
|
| 421 |
+
8. **Check container support**: Important for ML workflows
|
| 422 |
+
9. **Identify bottlenecks**: VRAM, compute, or driver issues
|
| 423 |
+
10. **Provide actionable recommendations**: Setup steps or optimizations
|
| 424 |
+
|
| 425 |
+
## Important Notes
|
| 426 |
+
|
| 427 |
+
- NVIDIA GPUs have the most mature AI/ML ecosystem
|
| 428 |
+
- CUDA compute capability determines supported features
|
| 429 |
+
- cuDNN is critical for deep learning performance
|
| 430 |
+
- VRAM is often the primary bottleneck for large models
|
| 431 |
+
- Container runtimes simplify framework management
|
| 432 |
+
- AMD ROCm support is improving but less mature than CUDA
|
| 433 |
+
- Intel GPUs are emerging in AI/ML space
|
| 434 |
+
- Tensor cores provide significant speedup for mixed precision
|
| 435 |
+
- Driver version must match CUDA toolkit requirements
|
| 436 |
+
- Some features require specific GPU generations
|
| 437 |
+
- Multi-GPU setups require additional configuration
|
| 438 |
+
- Consumer GPUs can be effective for smaller workloads
|
| 439 |
+
- Professional/datacenter GPUs offer better reliability and support
|
| 440 |
+
|
| 441 |
+
Be thorough and practical - provide a clear assessment of AI/ML readiness and actionable next steps.
|
commands/ai-tools/ollama/prune-ollama.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Review the ollama models that are installed on this computer.
|
| 2 |
+
|
| 3 |
+
Your task is to prune those that I do not need to retain (but before doing so, confirm).
|
| 4 |
+
|
| 5 |
+
Pruning logic:
|
| 6 |
+
|
| 7 |
+
consider for pruning:
|
| 8 |
+
|
| 9 |
+
- Models that serve almost the same purpose and for which there is no compelling reason to keep both. Ask which I'd like to keep or suggest for deletion the slightly inferior of the two.
|
| 10 |
+
- Models that are deprecated
|
| 11 |
+
|
| 12 |
+
For example:
|
| 13 |
+
|
| 14 |
+
- If you were to find llama 3. 1 8B and llama 3.2 8B, you would reasonably suggest that I consider pruning 3.1 as it's an older model and both are quantized.
|
commands/ai-tools/ollama/setup-ollama.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Set up Ollama on the machine for local LLM inference
|
| 3 |
+
tags: [ai, ml, ollama, llm, setup, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user set up Ollama for local LLM inference.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check if Ollama is already installed**
|
| 11 |
+
- Run: `ollama --version`
|
| 12 |
+
- Check if service is running: `systemctl status ollama` or `sudo systemctl status ollama`
|
| 13 |
+
|
| 14 |
+
2. **Install Ollama if needed**
|
| 15 |
+
- Download and install: `curl -fsSL https://ollama.com/install.sh | sh`
|
| 16 |
+
- Or manual install from https://ollama.com/download
|
| 17 |
+
- Verify installation: `ollama --version`
|
| 18 |
+
|
| 19 |
+
3. **Start Ollama service**
|
| 20 |
+
- Start service: `systemctl start ollama` or `sudo systemctl start ollama`
|
| 21 |
+
- Enable on boot: `systemctl enable ollama` or `sudo systemctl enable ollama`
|
| 22 |
+
- Check status: `systemctl status ollama`
|
| 23 |
+
|
| 24 |
+
4. **Verify GPU support (for AMD on Daniel's system)**
|
| 25 |
+
- Check if ROCm is detected: `rocm-smi` or `rocminfo`
|
| 26 |
+
- Ollama should auto-detect AMD GPU
|
| 27 |
+
- Check Ollama logs for GPU recognition: `journalctl -u ollama -n 50`
|
| 28 |
+
|
| 29 |
+
5. **Configure Ollama**
|
| 30 |
+
- Check default model storage: `~/.ollama/models`
|
| 31 |
+
- Environment variables (if needed):
|
| 32 |
+
- `OLLAMA_HOST` - change port/binding
|
| 33 |
+
- `OLLAMA_MODELS` - custom model directory
|
| 34 |
+
- `OLLAMA_NUM_PARALLEL` - parallel requests
|
| 35 |
+
- Edit systemd service if needed: `/etc/systemd/system/ollama.service`
|
| 36 |
+
|
| 37 |
+
6. **Test Ollama**
|
| 38 |
+
- Pull a test model: `ollama pull llama2` (or smaller: `ollama pull tinyllama`)
|
| 39 |
+
- Run a test: `ollama run tinyllama "Hello, how are you?"`
|
| 40 |
+
- Verify GPU usage during inference
|
| 41 |
+
|
| 42 |
+
7. **Suggest initial models**
|
| 43 |
+
- Based on Daniel's hardware (AMD GPU), suggest:
|
| 44 |
+
- General: llama3.2, qwen2.5
|
| 45 |
+
- Code: codellama, deepseek-coder
|
| 46 |
+
- Fast: tinyllama, phi
|
| 47 |
+
- Vision: llava, bakllava
|
| 48 |
+
|
| 49 |
+
## Output
|
| 50 |
+
|
| 51 |
+
Provide a summary showing:
|
| 52 |
+
- Ollama installation status and version
|
| 53 |
+
- Service status
|
| 54 |
+
- GPU detection status
|
| 55 |
+
- Default configuration
|
| 56 |
+
- Recommended models to pull
|
| 57 |
+
- Next steps for usage
|
commands/ai-tools/ollama/suggest-ollama-models.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Review installed Ollama models and suggest others based on hardware
|
| 3 |
+
tags: [ai, ml, ollama, models, recommendations, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user review their Ollama models and suggest new ones based on their hardware.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check currently installed models**
|
| 11 |
+
- Run: `ollama list`
|
| 12 |
+
- Show model sizes and last modified dates
|
| 13 |
+
- Calculate total disk usage
|
| 14 |
+
|
| 15 |
+
2. **Assess hardware capabilities**
|
| 16 |
+
- Check GPU VRAM: `rocm-smi` (for AMD) or `nvidia-smi` (for NVIDIA)
|
| 17 |
+
- Check system RAM: `free -h`
|
| 18 |
+
- Determine recommended model sizes:
|
| 19 |
+
- < 8GB VRAM: 7B models and smaller
|
| 20 |
+
- 8-16GB VRAM: up to 13B models
|
| 21 |
+
- 16-24GB VRAM: up to 34B models
|
| 22 |
+
- 24GB+ VRAM: 70B+ models possible
|
| 23 |
+
|
| 24 |
+
3. **Identify user's needs**
|
| 25 |
+
- Ask about use cases:
|
| 26 |
+
- General chat
|
| 27 |
+
- Code generation
|
| 28 |
+
- Data analysis
|
| 29 |
+
- Creative writing
|
| 30 |
+
- Vision/multimodal
|
| 31 |
+
- Specialized domains
|
| 32 |
+
|
| 33 |
+
4. **Suggest models by category**
|
| 34 |
+
|
| 35 |
+
**General Purpose:**
|
| 36 |
+
- llama3.2 (3B, 8B)
|
| 37 |
+
- qwen2.5 (7B, 14B, 32B)
|
| 38 |
+
- mistral (7B)
|
| 39 |
+
- gemma2 (9B, 27B)
|
| 40 |
+
|
| 41 |
+
**Code:**
|
| 42 |
+
- codellama (7B, 13B, 34B)
|
| 43 |
+
- deepseek-coder (6.7B, 33B)
|
| 44 |
+
- starcoder2 (7B, 15B)
|
| 45 |
+
|
| 46 |
+
**Fast/Small:**
|
| 47 |
+
- tinyllama (1.1B)
|
| 48 |
+
- phi3 (3.8B)
|
| 49 |
+
|
| 50 |
+
**Multimodal:**
|
| 51 |
+
- llava (7B, 13B, 34B)
|
| 52 |
+
- bakllava (7B)
|
| 53 |
+
|
| 54 |
+
**Specialized:**
|
| 55 |
+
- meditron (medical)
|
| 56 |
+
- sqlcoder (SQL generation)
|
| 57 |
+
- wizardmath (mathematics)
|
| 58 |
+
|
| 59 |
+
5. **Consider quantization levels**
|
| 60 |
+
- Explain different quants (Q4, Q5, Q8, etc.)
|
| 61 |
+
- Suggest appropriate quant for their VRAM
|
| 62 |
+
|
| 63 |
+
6. **Cleanup suggestions**
|
| 64 |
+
- Identify duplicate models
|
| 65 |
+
- Suggest removing unused models: `ollama rm <model>`
|
| 66 |
+
- Free up space for new models
|
| 67 |
+
|
| 68 |
+
## Output
|
| 69 |
+
|
| 70 |
+
Provide a report showing:
|
| 71 |
+
- Currently installed models and total size
|
| 72 |
+
- Hardware capacity summary
|
| 73 |
+
- Recommended models based on:
|
| 74 |
+
- Available VRAM
|
| 75 |
+
- User's use cases
|
| 76 |
+
- Current gaps in model coverage
|
| 77 |
+
- Commands to install suggested models
|
| 78 |
+
- Models that could be removed to save space
|
commands/ai-tools/setup-speech-to-text.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Check installed STT apps and suggest installations including local Whisper
|
| 3 |
+
tags: [ai, stt, whisper, speech-recognition, audio, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user set up speech-to-text applications including local Whisper.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check currently installed STT apps**
|
| 11 |
+
- System packages: `dpkg -l | grep -E "whisper|speech|voice"`
|
| 12 |
+
- Python packages: `pip list | grep -E "whisper|speech|vosk"`
|
| 13 |
+
- Check `~/programs/ai-ml/` for installed apps
|
| 14 |
+
|
| 15 |
+
2. **Suggest STT installation candidates**
|
| 16 |
+
|
| 17 |
+
**Whisper (OpenAI) - Recommended:**
|
| 18 |
+
- Best quality, local inference
|
| 19 |
+
- Multiple model sizes available
|
| 20 |
+
- Multilingual support
|
| 21 |
+
|
| 22 |
+
**Other options:**
|
| 23 |
+
- Vosk - Lightweight, offline
|
| 24 |
+
- Coqui STT - Mozilla's solution
|
| 25 |
+
- SpeechNote - Simple GUI
|
| 26 |
+
- Subtitle Edit - Video subtitling
|
| 27 |
+
- Subtld - Automatic subtitles
|
| 28 |
+
|
| 29 |
+
3. **Install Whisper (local)**
|
| 30 |
+
|
| 31 |
+
**Method 1: Using pip (simple)**
|
| 32 |
+
```bash
|
| 33 |
+
pip install openai-whisper
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
**Method 2: Using conda (recommended)**
|
| 37 |
+
```bash
|
| 38 |
+
conda create -n whisper python=3.11 -y
|
| 39 |
+
conda activate whisper
|
| 40 |
+
pip install openai-whisper
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
**Install dependencies:**
|
| 44 |
+
```bash
|
| 45 |
+
# For audio processing
|
| 46 |
+
sudo apt install ffmpeg
|
| 47 |
+
pip install setuptools-rust
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
4. **Install faster-whisper (optimized)**
|
| 51 |
+
```bash
|
| 52 |
+
pip install faster-whisper
|
| 53 |
+
```
|
| 54 |
+
- Uses CTranslate2 for faster inference
|
| 55 |
+
- Lower VRAM usage
|
| 56 |
+
|
| 57 |
+
5. **Install WhisperX (advanced)**
|
| 58 |
+
```bash
|
| 59 |
+
pip install whisperx
|
| 60 |
+
```
|
| 61 |
+
- Includes alignment and diarization
|
| 62 |
+
- Better timestamps
|
| 63 |
+
|
| 64 |
+
6. **Download Whisper models**
|
| 65 |
+
- Models are downloaded automatically on first use
|
| 66 |
+
- Sizes: tiny, base, small, medium, large
|
| 67 |
+
- Suggest based on VRAM:
|
| 68 |
+
- < 4GB: tiny or base
|
| 69 |
+
- 4-8GB: small or medium
|
| 70 |
+
- 8GB+: large
|
| 71 |
+
|
| 72 |
+
7. **Test installation**
|
| 73 |
+
```bash
|
| 74 |
+
whisper audio.mp3 --model base --language en
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
8. **Install GUI options**
|
| 78 |
+
|
| 79 |
+
**Whisper Desktop:**
|
| 80 |
+
- Check if available as AppImage or Flatpak
|
| 81 |
+
|
| 82 |
+
**Subtitle Edit:**
|
| 83 |
+
```bash
|
| 84 |
+
sudo apt install subtitleeditor
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
**Custom GUI:**
|
| 88 |
+
- Suggest installing gradio-based Whisper UIs
|
| 89 |
+
|
| 90 |
+
9. **Create helper script**
|
| 91 |
+
- Offer to create `~/scripts/transcribe.sh`:
|
| 92 |
+
```bash
|
| 93 |
+
#!/bin/bash
|
| 94 |
+
whisper "$1" --model medium --language en --output_format txt
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
10. **Suggest workflows**
|
| 98 |
+
- Real-time transcription
|
| 99 |
+
- Batch processing
|
| 100 |
+
- Video subtitling
|
| 101 |
+
- Meeting transcription
|
| 102 |
+
|
| 103 |
+
## Output
|
| 104 |
+
|
| 105 |
+
Provide a summary showing:
|
| 106 |
+
- Currently installed STT applications
|
| 107 |
+
- Whisper installation status and model sizes
|
| 108 |
+
- GPU acceleration status
|
| 109 |
+
- Suggested models based on hardware
|
| 110 |
+
- Example commands for transcription
|
| 111 |
+
- GUI options available
|
| 112 |
+
- Helper scripts created
|
commands/backup/identify-backup-targets.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Identify filesystem parts to backup and suggest inclusion patterns
|
| 3 |
+
tags: [backup, filesystem, strategy, rclone, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user identify which parts of their filesystem should be backed up and create appropriate inclusion patterns.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Analyze filesystem structure**
|
| 11 |
+
- Home directory size: `du -sh ~/*` or `du -h --max-depth=1 ~ | sort -h`
|
| 12 |
+
- System directories to consider
|
| 13 |
+
- External drives/mounts
|
| 14 |
+
|
| 15 |
+
2. **Categorize data by importance**
|
| 16 |
+
|
| 17 |
+
**Critical (must backup):**
|
| 18 |
+
- Documents: `~/Documents`
|
| 19 |
+
- Development work: `~/repos`
|
| 20 |
+
- Configuration files: `~/.config`, `~/.ssh`, `~/.gnupg`
|
| 21 |
+
- Scripts: `~/scripts`, `~/.local/bin`
|
| 22 |
+
- AI documentation: `~/ai-docs`
|
| 23 |
+
|
| 24 |
+
**Important (should backup):**
|
| 25 |
+
- Pictures/Photos
|
| 26 |
+
- Videos (personal)
|
| 27 |
+
- Music (if not streaming)
|
| 28 |
+
- Downloads (selective)
|
| 29 |
+
- Email (if local)
|
| 30 |
+
|
| 31 |
+
**Optional (consider backing up):**
|
| 32 |
+
- Application data: `~/.local/share`
|
| 33 |
+
- Browser data (bookmarks, passwords)
|
| 34 |
+
- Game saves
|
| 35 |
+
|
| 36 |
+
**Exclude (don't backup):**
|
| 37 |
+
- Caches: `~/.cache`
|
| 38 |
+
- Temporary files: `/tmp`, `~/.tmp`
|
| 39 |
+
- Virtual machines/disk images
|
| 40 |
+
- Node modules: `node_modules/`
|
| 41 |
+
- Python venvs: `venv/`, `.venv/`
|
| 42 |
+
- Build artifacts: `target/`, `build/`, `dist/`
|
| 43 |
+
- Large media files (if cloud-synced elsewhere)
|
| 44 |
+
|
| 45 |
+
3. **Identify special considerations**
|
| 46 |
+
- Check for large directories: `du -h --max-depth=2 ~ | sort -h | tail -20`
|
| 47 |
+
- Look for media libraries
|
| 48 |
+
- Identify development projects with dependencies
|
| 49 |
+
- Find version-controlled repos (can skip .git if remote exists)
|
| 50 |
+
|
| 51 |
+
4. **Create inclusion/exclusion patterns**
|
| 52 |
+
|
| 53 |
+
**For rclone:**
|
| 54 |
+
```
|
| 55 |
+
# Include patterns
|
| 56 |
+
+ /Documents/**
|
| 57 |
+
+ /repos/**
|
| 58 |
+
+ /.config/**
|
| 59 |
+
+ /.ssh/**
|
| 60 |
+
+ /.gnupg/**
|
| 61 |
+
+ /scripts/**
|
| 62 |
+
+ /.local/bin/**
|
| 63 |
+
+ /ai-docs/**
|
| 64 |
+
+ /Pictures/**
|
| 65 |
+
|
| 66 |
+
# Exclude patterns
|
| 67 |
+
- /.cache/**
|
| 68 |
+
- /.local/share/Trash/**
|
| 69 |
+
- /**/node_modules/**
|
| 70 |
+
- /**/.venv/**
|
| 71 |
+
- /**/venv/**
|
| 72 |
+
- /**/__pycache__/**
|
| 73 |
+
- /**/.git/**
|
| 74 |
+
- /.thumbnails/**
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
**For rsync:**
|
| 78 |
+
```bash
|
| 79 |
+
--include='/Documents/***'
|
| 80 |
+
--include='/repos/***'
|
| 81 |
+
--exclude='**/.cache/'
|
| 82 |
+
--exclude='**/node_modules/'
|
| 83 |
+
--exclude='**/.venv/'
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
5. **Calculate backup size**
|
| 87 |
+
- Estimate total backup size based on included directories
|
| 88 |
+
- Consider compression potential
|
| 89 |
+
- Plan for growth
|
| 90 |
+
|
| 91 |
+
6. **Suggest backup frequency**
|
| 92 |
+
- Critical data: Daily or real-time sync
|
| 93 |
+
- Important data: Weekly
|
| 94 |
+
- Optional data: Monthly
|
| 95 |
+
- System configs: After changes
|
| 96 |
+
|
| 97 |
+
7. **Create backup configuration file**
|
| 98 |
+
- Offer to create `~/scripts/backup-config.txt` with patterns
|
| 99 |
+
- Create `~/scripts/backup-estimate.sh` to calculate size
|
| 100 |
+
|
| 101 |
+
## Output
|
| 102 |
+
|
| 103 |
+
Provide a report showing:
|
| 104 |
+
- Categorized list of directories to backup
|
| 105 |
+
- Size estimates for each category
|
| 106 |
+
- Recommended inclusion/exclusion patterns (rclone and rsync format)
|
| 107 |
+
- Total estimated backup size
|
| 108 |
+
- Suggested backup frequency for each category
|
| 109 |
+
- Configuration file content
|
commands/bluetooth/reset-bluetooth.md
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Reset Bluetooth
|
| 2 |
+
|
| 3 |
+
You are helping the user completely reset the Bluetooth subsystem to fix persistent issues.
|
| 4 |
+
|
| 5 |
+
## Task
|
| 6 |
+
|
| 7 |
+
**WARNING:** This will remove all paired Bluetooth devices and require re-pairing.
|
| 8 |
+
|
| 9 |
+
1. **Ask user to confirm:**
|
| 10 |
+
- This will unpair all Bluetooth devices
|
| 11 |
+
- Devices will need to be paired again
|
| 12 |
+
- Bluetooth service will be restarted
|
| 13 |
+
|
| 14 |
+
2. **Stop Bluetooth service:**
|
| 15 |
+
```bash
|
| 16 |
+
# Stop Bluetooth
|
| 17 |
+
sudo systemctl stop bluetooth
|
| 18 |
+
|
| 19 |
+
# Verify stopped
|
| 20 |
+
systemctl is-active bluetooth
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
3. **Kill any remaining Bluetooth processes:**
|
| 24 |
+
```bash
|
| 25 |
+
# Kill bluetoothd
|
| 26 |
+
sudo killall bluetoothd 2>/dev/null
|
| 27 |
+
|
| 28 |
+
# Kill bluetooth-related processes
|
| 29 |
+
ps aux | grep bluetooth | grep -v grep
|
| 30 |
+
sudo killall -9 bluez-alsa bluez-obexd 2>/dev/null
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
4. **Remove Bluetooth pairing cache:**
|
| 34 |
+
```bash
|
| 35 |
+
# Remove paired devices database
|
| 36 |
+
sudo rm -rf /var/lib/bluetooth/*
|
| 37 |
+
|
| 38 |
+
# Show what was removed
|
| 39 |
+
echo "Removed all paired device data from /var/lib/bluetooth/"
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
5. **Clear user Bluetooth cache:**
|
| 43 |
+
```bash
|
| 44 |
+
# Remove user Bluetooth cache
|
| 45 |
+
rm -rf ~/.cache/bluetooth 2>/dev/null
|
| 46 |
+
rm -rf ~/.local/share/bluetooth 2>/dev/null
|
| 47 |
+
|
| 48 |
+
echo "Cleared user Bluetooth cache"
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
6. **Reset Bluetooth modules:**
|
| 52 |
+
```bash
|
| 53 |
+
# Remove Bluetooth kernel modules
|
| 54 |
+
sudo modprobe -r bnep
|
| 55 |
+
sudo modprobe -r bluetooth
|
| 56 |
+
sudo modprobe -r btusb
|
| 57 |
+
sudo modprobe -r btintel # Intel Bluetooth
|
| 58 |
+
sudo modprobe -r btrtl # Realtek Bluetooth
|
| 59 |
+
|
| 60 |
+
echo "Bluetooth modules unloaded"
|
| 61 |
+
sleep 2
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
7. **Reload Bluetooth modules:**
|
| 65 |
+
```bash
|
| 66 |
+
# Reload modules
|
| 67 |
+
sudo modprobe bluetooth
|
| 68 |
+
sudo modprobe btusb
|
| 69 |
+
sudo modprobe bnep
|
| 70 |
+
|
| 71 |
+
# Load vendor-specific modules if needed
|
| 72 |
+
sudo modprobe btintel 2>/dev/null
|
| 73 |
+
sudo modprobe btrtl 2>/dev/null
|
| 74 |
+
|
| 75 |
+
echo "Bluetooth modules reloaded"
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
8. **Reset HCI interface:**
|
| 79 |
+
```bash
|
| 80 |
+
# Bring down Bluetooth controller
|
| 81 |
+
sudo hciconfig hci0 down 2>/dev/null
|
| 82 |
+
|
| 83 |
+
sleep 1
|
| 84 |
+
|
| 85 |
+
# Bring it back up
|
| 86 |
+
sudo hciconfig hci0 up 2>/dev/null
|
| 87 |
+
|
| 88 |
+
# Reset the controller
|
| 89 |
+
sudo hciconfig hci0 reset 2>/dev/null
|
| 90 |
+
|
| 91 |
+
echo "HCI interface reset"
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
9. **Unblock Bluetooth:**
|
| 95 |
+
```bash
|
| 96 |
+
# Unblock Bluetooth (soft and hard)
|
| 97 |
+
sudo rfkill unblock bluetooth
|
| 98 |
+
|
| 99 |
+
# Verify not blocked
|
| 100 |
+
rfkill list bluetooth
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
10. **Start Bluetooth service:**
|
| 104 |
+
```bash
|
| 105 |
+
# Start and enable Bluetooth
|
| 106 |
+
sudo systemctl start bluetooth
|
| 107 |
+
sudo systemctl enable bluetooth
|
| 108 |
+
|
| 109 |
+
# Wait for service to fully start
|
| 110 |
+
sleep 3
|
| 111 |
+
|
| 112 |
+
# Check status
|
| 113 |
+
systemctl status bluetooth --no-pager
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
11. **Power on Bluetooth controller:**
|
| 117 |
+
```bash
|
| 118 |
+
# Turn on Bluetooth
|
| 119 |
+
bluetoothctl power on
|
| 120 |
+
|
| 121 |
+
# Set as discoverable (optional)
|
| 122 |
+
bluetoothctl discoverable on
|
| 123 |
+
|
| 124 |
+
# Set pairable
|
| 125 |
+
bluetoothctl pairable on
|
| 126 |
+
|
| 127 |
+
# Show controller info
|
| 128 |
+
bluetoothctl show
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
12. **Verify Bluetooth is working:**
|
| 132 |
+
```bash
|
| 133 |
+
# Check service
|
| 134 |
+
echo "Service status: $(systemctl is-active bluetooth)"
|
| 135 |
+
|
| 136 |
+
# Check controller
|
| 137 |
+
echo "Controller powered: $(bluetoothctl show | grep Powered)"
|
| 138 |
+
|
| 139 |
+
# Check for adapters
|
| 140 |
+
hciconfig -a
|
| 141 |
+
|
| 142 |
+
# Start scanning to test
|
| 143 |
+
echo "Starting scan for 10 seconds..."
|
| 144 |
+
timeout 10 bluetoothctl scan on
|
| 145 |
+
|
| 146 |
+
bluetoothctl devices
|
| 147 |
+
```
|
| 148 |
+
|
| 149 |
+
13. **Create reset report:**
|
| 150 |
+
```bash
|
| 151 |
+
cat > /tmp/bluetooth-reset-report.txt << EOF
|
| 152 |
+
Bluetooth Reset Report
|
| 153 |
+
======================
|
| 154 |
+
Date: $(date)
|
| 155 |
+
|
| 156 |
+
=== Service Status ===
|
| 157 |
+
$(systemctl status bluetooth --no-pager)
|
| 158 |
+
|
| 159 |
+
=== Controller Info ===
|
| 160 |
+
$(bluetoothctl show)
|
| 161 |
+
|
| 162 |
+
=== Hardware Info ===
|
| 163 |
+
$(hciconfig -a)
|
| 164 |
+
|
| 165 |
+
=== RF Kill Status ===
|
| 166 |
+
$(rfkill list bluetooth)
|
| 167 |
+
|
| 168 |
+
=== Loaded Modules ===
|
| 169 |
+
$(lsmod | grep -E "bluetooth|bnep|btusb")
|
| 170 |
+
|
| 171 |
+
=== Kernel Messages (last 20) ===
|
| 172 |
+
$(dmesg | grep -i bluetooth | tail -20)
|
| 173 |
+
|
| 174 |
+
Next Steps:
|
| 175 |
+
1. Your Bluetooth has been reset
|
| 176 |
+
2. All previous pairings have been removed
|
| 177 |
+
3. Put your device in pairing mode
|
| 178 |
+
4. Use: bluetoothctl scan on
|
| 179 |
+
5. Use: bluetoothctl pair <DEVICE_MAC>
|
| 180 |
+
6. Use: bluetoothctl connect <DEVICE_MAC>
|
| 181 |
+
EOF
|
| 182 |
+
|
| 183 |
+
cat /tmp/bluetooth-reset-report.txt
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
## USB Bluetooth Adapter Reset
|
| 187 |
+
|
| 188 |
+
If using USB Bluetooth adapter:
|
| 189 |
+
```bash
|
| 190 |
+
# Find USB Bluetooth device
|
| 191 |
+
usb_bt=$(lsusb | grep -i bluetooth | head -1)
|
| 192 |
+
echo "Found: $usb_bt"
|
| 193 |
+
|
| 194 |
+
# Get bus and device numbers
|
| 195 |
+
bus=$(echo $usb_bt | awk '{print $2}')
|
| 196 |
+
dev=$(echo $usb_bt | awk '{print $4}' | tr -d ':')
|
| 197 |
+
|
| 198 |
+
# Reset USB device
|
| 199 |
+
echo "Resetting USB device: Bus $bus Device $dev"
|
| 200 |
+
sudo usb_modeswitch -v 0x$(lsusb | grep -i bluetooth | awk '{print $6}' | cut -d: -f1) \
|
| 201 |
+
-p 0x$(lsusb | grep -i bluetooth | awk '{print $6}' | cut -d: -f2) \
|
| 202 |
+
--reset-usb 2>/dev/null
|
| 203 |
+
|
| 204 |
+
# Alternative: unbind and rebind
|
| 205 |
+
device_path="/sys/bus/usb/devices/$bus-*"
|
| 206 |
+
echo "Unbinding and rebinding USB device"
|
| 207 |
+
echo "$bus-*" | sudo tee /sys/bus/usb/drivers/usb/unbind 2>/dev/null
|
| 208 |
+
sleep 2
|
| 209 |
+
echo "$bus-*" | sudo tee /sys/bus/usb/drivers/usb/bind 2>/dev/null
|
| 210 |
+
```
|
| 211 |
+
|
| 212 |
+
## Firmware Reload
|
| 213 |
+
|
| 214 |
+
If firmware issues persist:
|
| 215 |
+
```bash
|
| 216 |
+
# Check firmware files
|
| 217 |
+
ls -l /lib/firmware/ | grep -i bluetooth
|
| 218 |
+
|
| 219 |
+
# Reload firmware (device-specific)
|
| 220 |
+
# For Intel Bluetooth:
|
| 221 |
+
sudo rmmod btintel
|
| 222 |
+
sudo modprobe btintel
|
| 223 |
+
|
| 224 |
+
# For Realtek:
|
| 225 |
+
sudo rmmod btrtl
|
| 226 |
+
sudo modprobe btrtl
|
| 227 |
+
|
| 228 |
+
# Check if firmware loaded
|
| 229 |
+
dmesg | grep -i "bluetooth.*firmware" | tail -5
|
| 230 |
+
```
|
| 231 |
+
|
| 232 |
+
## Complete System Reset
|
| 233 |
+
|
| 234 |
+
Nuclear option if nothing else works:
|
| 235 |
+
```bash
|
| 236 |
+
# Stop everything
|
| 237 |
+
sudo systemctl stop bluetooth
|
| 238 |
+
sudo killall -9 bluetoothd
|
| 239 |
+
|
| 240 |
+
# Remove all data
|
| 241 |
+
sudo rm -rf /var/lib/bluetooth/*
|
| 242 |
+
rm -rf ~/.cache/bluetooth
|
| 243 |
+
rm -rf ~/.local/share/bluetooth
|
| 244 |
+
|
| 245 |
+
# Remove and reload all modules
|
| 246 |
+
sudo modprobe -r bnep bluetooth btusb btintel btrtl
|
| 247 |
+
sleep 3
|
| 248 |
+
sudo modprobe bluetooth btusb bnep
|
| 249 |
+
|
| 250 |
+
# Remove config (will regenerate)
|
| 251 |
+
sudo mv /etc/bluetooth/main.conf /etc/bluetooth/main.conf.backup
|
| 252 |
+
|
| 253 |
+
# Reboot system
|
| 254 |
+
echo "A system reboot is recommended for complete reset"
|
| 255 |
+
# sudo reboot
|
| 256 |
+
```
|
| 257 |
+
|
| 258 |
+
## Post-Reset Pairing
|
| 259 |
+
|
| 260 |
+
Guide user through pairing:
|
| 261 |
+
```bash
|
| 262 |
+
cat << 'EOF'
|
| 263 |
+
To pair a device after reset:
|
| 264 |
+
|
| 265 |
+
1. Put device in pairing mode
|
| 266 |
+
2. Start Bluetooth scan:
|
| 267 |
+
bluetoothctl scan on
|
| 268 |
+
|
| 269 |
+
3. Find your device MAC address in the list
|
| 270 |
+
|
| 271 |
+
4. Pair the device:
|
| 272 |
+
bluetoothctl pair XX:XX:XX:XX:XX:XX
|
| 273 |
+
|
| 274 |
+
5. Trust the device:
|
| 275 |
+
bluetoothctl trust XX:XX:XX:XX:XX:XX
|
| 276 |
+
|
| 277 |
+
6. Connect:
|
| 278 |
+
bluetoothctl connect XX:XX:XX:XX:XX:XX
|
| 279 |
+
|
| 280 |
+
7. Stop scanning:
|
| 281 |
+
bluetoothctl scan off
|
| 282 |
+
|
| 283 |
+
For audio devices, you may need to restart PipeWire:
|
| 284 |
+
systemctl --user restart pipewire wireplumber
|
| 285 |
+
EOF
|
| 286 |
+
```
|
| 287 |
+
|
| 288 |
+
## Troubleshooting
|
| 289 |
+
|
| 290 |
+
**Reset didn't work:**
|
| 291 |
+
```bash
|
| 292 |
+
# Try full reboot
|
| 293 |
+
sudo reboot
|
| 294 |
+
|
| 295 |
+
# Or try removing Bluetooth packages and reinstalling
|
| 296 |
+
# sudo apt remove bluez bluetooth
|
| 297 |
+
# sudo apt install bluez bluetooth
|
| 298 |
+
```
|
| 299 |
+
|
| 300 |
+
**Service won't start:**
|
| 301 |
+
```bash
|
| 302 |
+
# Check for errors
|
| 303 |
+
journalctl -u bluetooth --since "5 minutes ago" --no-pager
|
| 304 |
+
|
| 305 |
+
# Check if masked
|
| 306 |
+
sudo systemctl unmask bluetooth
|
| 307 |
+
|
| 308 |
+
# Force restart
|
| 309 |
+
sudo systemctl restart bluetooth
|
| 310 |
+
```
|
| 311 |
+
|
| 312 |
+
**No adapters found:**
|
| 313 |
+
```bash
|
| 314 |
+
# Check hardware detection
|
| 315 |
+
lsusb | grep -i bluetooth
|
| 316 |
+
lspci | grep -i bluetooth
|
| 317 |
+
|
| 318 |
+
# Check kernel modules
|
| 319 |
+
lsmod | grep bluetooth
|
| 320 |
+
```
|
| 321 |
+
|
| 322 |
+
## Notes
|
| 323 |
+
|
| 324 |
+
- Backup `/var/lib/bluetooth/` before reset if you want to preserve pairings
|
| 325 |
+
- Some devices may require specific PIN codes during pairing
|
| 326 |
+
- Audio devices may need additional PipeWire/PulseAudio configuration
|
| 327 |
+
- Bluetooth 5.0+ devices are backward compatible
|
| 328 |
+
- LE (Low Energy) devices may require special pairing procedures
|
| 329 |
+
- System reboot recommended after complete reset
|
| 330 |
+
- Check `/var/log/syslog` for detailed Bluetooth errors
|
commands/bluetooth/troubleshoot-bluetooth.md
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Troubleshoot Bluetooth
|
| 2 |
+
|
| 3 |
+
You are helping the user diagnose and fix Bluetooth connectivity issues.
|
| 4 |
+
|
| 5 |
+
## Task
|
| 6 |
+
|
| 7 |
+
1. **Check Bluetooth service status:**
|
| 8 |
+
```bash
|
| 9 |
+
# Service status
|
| 10 |
+
systemctl status bluetooth
|
| 11 |
+
|
| 12 |
+
# Is it running?
|
| 13 |
+
systemctl is-active bluetooth
|
| 14 |
+
|
| 15 |
+
# Is it enabled to start on boot?
|
| 16 |
+
systemctl is-enabled bluetooth
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
2. **Check Bluetooth hardware:**
|
| 20 |
+
```bash
|
| 21 |
+
# List Bluetooth adapters
|
| 22 |
+
hciconfig -a
|
| 23 |
+
|
| 24 |
+
# Or using rfkill
|
| 25 |
+
rfkill list bluetooth
|
| 26 |
+
|
| 27 |
+
# Check if Bluetooth is soft/hard blocked
|
| 28 |
+
rfkill list
|
| 29 |
+
|
| 30 |
+
# Detailed hardware info
|
| 31 |
+
lsusb | grep -i bluetooth
|
| 32 |
+
lspci | grep -i bluetooth
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
3. **Check Bluetooth controller status:**
|
| 36 |
+
```bash
|
| 37 |
+
# Controller info
|
| 38 |
+
bluetoothctl show
|
| 39 |
+
|
| 40 |
+
# List controllers
|
| 41 |
+
bluetoothctl list
|
| 42 |
+
|
| 43 |
+
# Check if powered on
|
| 44 |
+
bluetoothctl show | grep "Powered:"
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
4. **Check for firmware issues:**
|
| 48 |
+
```bash
|
| 49 |
+
# Look for firmware errors in journal
|
| 50 |
+
journalctl -u bluetooth | grep -i firmware
|
| 51 |
+
|
| 52 |
+
# Check dmesg for Bluetooth firmware loading
|
| 53 |
+
dmesg | grep -i "bluetooth\|firmware" | tail -20
|
| 54 |
+
|
| 55 |
+
# Check kernel modules
|
| 56 |
+
lsmod | grep bluetooth
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
5. **Common fixes - Restart Bluetooth:**
|
| 60 |
+
```bash
|
| 61 |
+
# Restart Bluetooth service
|
| 62 |
+
sudo systemctl restart bluetooth
|
| 63 |
+
|
| 64 |
+
# Reset Bluetooth controller
|
| 65 |
+
sudo hciconfig hci0 down
|
| 66 |
+
sudo hciconfig hci0 up
|
| 67 |
+
|
| 68 |
+
# Or use bluetoothctl
|
| 69 |
+
bluetoothctl power off
|
| 70 |
+
sleep 2
|
| 71 |
+
bluetoothctl power on
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
6. **Unblock Bluetooth if blocked:**
|
| 75 |
+
```bash
|
| 76 |
+
# Check if blocked
|
| 77 |
+
rfkill list bluetooth
|
| 78 |
+
|
| 79 |
+
# Unblock if soft-blocked
|
| 80 |
+
sudo rfkill unblock bluetooth
|
| 81 |
+
|
| 82 |
+
# Power on controller
|
| 83 |
+
bluetoothctl power on
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
7. **Scan for devices:**
|
| 87 |
+
```bash
|
| 88 |
+
# Start scanning
|
| 89 |
+
bluetoothctl scan on
|
| 90 |
+
|
| 91 |
+
# Wait 10 seconds
|
| 92 |
+
sleep 10
|
| 93 |
+
|
| 94 |
+
# List discovered devices
|
| 95 |
+
bluetoothctl devices
|
| 96 |
+
|
| 97 |
+
# Stop scanning
|
| 98 |
+
bluetoothctl scan off
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
8. **Check paired devices:**
|
| 102 |
+
```bash
|
| 103 |
+
# List paired devices
|
| 104 |
+
bluetoothctl paired-devices
|
| 105 |
+
|
| 106 |
+
# Show info about specific device
|
| 107 |
+
bluetoothctl info DEVICE_MAC_ADDRESS
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
9. **Remove and re-pair problematic device:**
|
| 111 |
+
```bash
|
| 112 |
+
# Ask user for device MAC address
|
| 113 |
+
# Remove device
|
| 114 |
+
bluetoothctl remove DEVICE_MAC_ADDRESS
|
| 115 |
+
|
| 116 |
+
# Scan again
|
| 117 |
+
bluetoothctl scan on
|
| 118 |
+
sleep 10
|
| 119 |
+
|
| 120 |
+
# Pair device
|
| 121 |
+
bluetoothctl pair DEVICE_MAC_ADDRESS
|
| 122 |
+
|
| 123 |
+
# Trust device
|
| 124 |
+
bluetoothctl trust DEVICE_MAC_ADDRESS
|
| 125 |
+
|
| 126 |
+
# Connect to device
|
| 127 |
+
bluetoothctl connect DEVICE_MAC_ADDRESS
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
10. **Check Bluetooth configuration:**
|
| 131 |
+
```bash
|
| 132 |
+
# Main config file
|
| 133 |
+
cat /etc/bluetooth/main.conf
|
| 134 |
+
|
| 135 |
+
# Check for problematic settings
|
| 136 |
+
grep -E "^(Name|Class|DiscoverableTimeout|AutoEnable)" /etc/bluetooth/main.conf
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
11. **Check for interference:**
|
| 140 |
+
```bash
|
| 141 |
+
# Check WiFi and Bluetooth coexistence
|
| 142 |
+
iw dev | grep -i channel
|
| 143 |
+
|
| 144 |
+
# Bluetooth operates on 2.4GHz
|
| 145 |
+
# WiFi on 2.4GHz can interfere
|
| 146 |
+
echo "Consider switching WiFi to 5GHz if available"
|
| 147 |
+
```
|
| 148 |
+
|
| 149 |
+
12. **Detailed diagnostics:**
|
| 150 |
+
```bash
|
| 151 |
+
# Bluetooth subsystem logs
|
| 152 |
+
journalctl -u bluetooth --since "1 hour ago" --no-pager
|
| 153 |
+
|
| 154 |
+
# Kernel Bluetooth messages
|
| 155 |
+
dmesg | grep -i bluetooth | tail -30
|
| 156 |
+
|
| 157 |
+
# Check for errors
|
| 158 |
+
journalctl -u bluetooth | grep -iE "error|fail|timeout"
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
13. **Audio-specific Bluetooth issues:**
|
| 162 |
+
```bash
|
| 163 |
+
# Check PulseAudio/PipeWire Bluetooth modules
|
| 164 |
+
pactl list | grep -i bluetooth
|
| 165 |
+
|
| 166 |
+
# PipeWire Bluetooth
|
| 167 |
+
pw-cli ls Device | grep -i bluetooth
|
| 168 |
+
|
| 169 |
+
# Load Bluetooth module (PulseAudio)
|
| 170 |
+
# pactl load-module module-bluetooth-discover
|
| 171 |
+
|
| 172 |
+
# Restart audio with Bluetooth
|
| 173 |
+
systemctl --user restart pipewire pipewire-pulse wireplumber
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
14. **Generate diagnostic report:**
|
| 177 |
+
```bash
|
| 178 |
+
cat > /tmp/bluetooth-diagnostic.txt << EOF
|
| 179 |
+
Bluetooth Diagnostic Report
|
| 180 |
+
===========================
|
| 181 |
+
Date: $(date)
|
| 182 |
+
|
| 183 |
+
=== Service Status ===
|
| 184 |
+
$(systemctl status bluetooth --no-pager)
|
| 185 |
+
|
| 186 |
+
=== Hardware Detection ===
|
| 187 |
+
$(rfkill list bluetooth)
|
| 188 |
+
$(hciconfig -a)
|
| 189 |
+
|
| 190 |
+
=== Controller Info ===
|
| 191 |
+
$(bluetoothctl show)
|
| 192 |
+
|
| 193 |
+
=== Paired Devices ===
|
| 194 |
+
$(bluetoothctl paired-devices)
|
| 195 |
+
|
| 196 |
+
=== Recent Bluetooth Logs ===
|
| 197 |
+
$(journalctl -u bluetooth --since "1 hour ago" --no-pager | tail -50)
|
| 198 |
+
|
| 199 |
+
=== Kernel Messages ===
|
| 200 |
+
$(dmesg | grep -i bluetooth | tail -30)
|
| 201 |
+
|
| 202 |
+
=== Loaded Modules ===
|
| 203 |
+
$(lsmod | grep bluetooth)
|
| 204 |
+
|
| 205 |
+
=== Configuration ===
|
| 206 |
+
$(grep -v "^#\|^$" /etc/bluetooth/main.conf)
|
| 207 |
+
EOF
|
| 208 |
+
|
| 209 |
+
cat /tmp/bluetooth-diagnostic.txt
|
| 210 |
+
```
|
| 211 |
+
|
| 212 |
+
## Common Issues & Solutions
|
| 213 |
+
|
| 214 |
+
**Bluetooth not starting:**
|
| 215 |
+
```bash
|
| 216 |
+
# Check if service masked
|
| 217 |
+
systemctl unmask bluetooth
|
| 218 |
+
sudo systemctl enable --now bluetooth
|
| 219 |
+
```
|
| 220 |
+
|
| 221 |
+
**Device pairs but won't connect:**
|
| 222 |
+
```bash
|
| 223 |
+
# Remove and re-pair
|
| 224 |
+
bluetoothctl remove DEVICE_MAC
|
| 225 |
+
bluetoothctl scan on
|
| 226 |
+
# Wait for device to appear
|
| 227 |
+
bluetoothctl pair DEVICE_MAC
|
| 228 |
+
bluetoothctl trust DEVICE_MAC
|
| 229 |
+
bluetoothctl connect DEVICE_MAC
|
| 230 |
+
```
|
| 231 |
+
|
| 232 |
+
**Audio stuttering or quality issues:**
|
| 233 |
+
```bash
|
| 234 |
+
# Check Bluetooth audio codec
|
| 235 |
+
pactl list | grep -i "bluetooth\|codec"
|
| 236 |
+
|
| 237 |
+
# Try different codec
|
| 238 |
+
# Edit /etc/bluetooth/main.conf
|
| 239 |
+
# [General]
|
| 240 |
+
# Enable=Source,Sink,Media,Socket
|
| 241 |
+
```
|
| 242 |
+
|
| 243 |
+
**Bluetooth adapter not found:**
|
| 244 |
+
```bash
|
| 245 |
+
# Reload Bluetooth module
|
| 246 |
+
sudo rmmod btusb
|
| 247 |
+
sudo modprobe btusb
|
| 248 |
+
|
| 249 |
+
# Or all Bluetooth modules
|
| 250 |
+
sudo rmmod bnep btusb bluetooth
|
| 251 |
+
sudo modprobe bluetooth
|
| 252 |
+
sudo modprobe btusb
|
| 253 |
+
sudo modprobe bnep
|
| 254 |
+
```
|
| 255 |
+
|
| 256 |
+
**Random disconnections:**
|
| 257 |
+
```bash
|
| 258 |
+
# Increase page timeout
|
| 259 |
+
sudo hciconfig hci0 pageto 8192
|
| 260 |
+
|
| 261 |
+
# Disable power management for USB Bluetooth
|
| 262 |
+
# Add to /etc/udev/rules.d/50-bluetooth.rules:
|
| 263 |
+
# ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="YOUR_VENDOR", ATTR{power/autosuspend}="-1"
|
| 264 |
+
```
|
| 265 |
+
|
| 266 |
+
**LE (Low Energy) devices not working:**
|
| 267 |
+
```bash
|
| 268 |
+
# Enable LE in bluetoothctl
|
| 269 |
+
bluetoothctl
|
| 270 |
+
[bluetooth]# menu scan
|
| 271 |
+
[bluetooth]# transport le
|
| 272 |
+
[bluetooth]# scan on
|
| 273 |
+
```
|
| 274 |
+
|
| 275 |
+
## Reset Bluetooth Completely
|
| 276 |
+
|
| 277 |
+
If nothing else works:
|
| 278 |
+
```bash
|
| 279 |
+
# Stop Bluetooth
|
| 280 |
+
sudo systemctl stop bluetooth
|
| 281 |
+
|
| 282 |
+
# Remove paired devices cache
|
| 283 |
+
sudo rm -rf /var/lib/bluetooth/*
|
| 284 |
+
|
| 285 |
+
# Restart Bluetooth
|
| 286 |
+
sudo systemctl start bluetooth
|
| 287 |
+
|
| 288 |
+
# Re-pair all devices
|
| 289 |
+
```
|
| 290 |
+
|
| 291 |
+
## Notes
|
| 292 |
+
|
| 293 |
+
- Most Bluetooth adapters work with btusb kernel module
|
| 294 |
+
- Firmware files typically in `/lib/firmware/`
|
| 295 |
+
- Check if kernel has Bluetooth support: `zgrep BLUETOOTH /proc/config.gz`
|
| 296 |
+
- Some devices require specific pairing codes
|
| 297 |
+
- Audio devices may need PulseAudio/PipeWire Bluetooth modules
|
| 298 |
+
- USB Bluetooth adapters: check with `usb-devices | grep -A 10 Bluetooth`
|
| 299 |
+
- Bluetooth 5.x adapters are backward compatible with older devices
|
| 300 |
+
- Distance and obstacles affect connection quality
|
commands/configuration/add-bash-alias.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
I would like to add a bash alias. I will provide the alias or ask for your suggestions as to an appropriate alias.
|
| 2 |
+
|
| 3 |
+
To come up with an appropriate alias - identify one that is unlikely to conflict with other aliases.
|
| 4 |
+
|
| 5 |
+
Either way:
|
| 6 |
+
|
| 7 |
+
Create the new bash alias(es) in ~/.bash_aliases
|
| 8 |
+
|
| 9 |
+
Then you can use sourcebash to reload the bash alias file.
|
commands/configuration/check-git-config.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Check user's basic git config and make any desired edits
|
| 3 |
+
tags: [git, configuration, settings, development, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user review and configure their git settings.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Display current git configuration**
|
| 11 |
+
- Global config: `git config --global --list`
|
| 12 |
+
- Local config (if in repo): `git config --local --list`
|
| 13 |
+
- Show config file location: `git config --global --list --show-origin`
|
| 14 |
+
|
| 15 |
+
2. **Check essential settings**
|
| 16 |
+
|
| 17 |
+
**User identity:**
|
| 18 |
+
```bash
|
| 19 |
+
git config --global user.name
|
| 20 |
+
git config --global user.email
|
| 21 |
+
```
|
| 22 |
+
- Verify these are set correctly
|
| 23 |
+
- If not set, ask user for values
|
| 24 |
+
|
| 25 |
+
**Default editor:**
|
| 26 |
+
```bash
|
| 27 |
+
git config --global core.editor
|
| 28 |
+
```
|
| 29 |
+
- Suggest: `nano`, `vim`, `code --wait`, etc.
|
| 30 |
+
|
| 31 |
+
**Default branch name:**
|
| 32 |
+
```bash
|
| 33 |
+
git config --global init.defaultBranch
|
| 34 |
+
```
|
| 35 |
+
- Recommend: `main` or `master`
|
| 36 |
+
|
| 37 |
+
3. **Suggest useful configurations**
|
| 38 |
+
|
| 39 |
+
**Color output:**
|
| 40 |
+
```bash
|
| 41 |
+
git config --global color.ui auto
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
**Credential helper:**
|
| 45 |
+
```bash
|
| 46 |
+
git config --global credential.helper store
|
| 47 |
+
# or for cache: git config --global credential.helper 'cache --timeout=3600'
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
**Push behavior:**
|
| 51 |
+
```bash
|
| 52 |
+
git config --global push.default simple
|
| 53 |
+
git config --global push.autoSetupRemote true
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
**Pull behavior:**
|
| 57 |
+
```bash
|
| 58 |
+
git config --global pull.rebase false # merge (default)
|
| 59 |
+
# or: git config --global pull.rebase true # rebase
|
| 60 |
+
# or: git config --global pull.ff only # fast-forward only
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
**Line endings:**
|
| 64 |
+
```bash
|
| 65 |
+
git config --global core.autocrlf input # Linux/Mac
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
**Diff and merge tools:**
|
| 69 |
+
```bash
|
| 70 |
+
git config --global diff.tool meld
|
| 71 |
+
git config --global merge.tool meld
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
4. **Aliases (optional but useful)**
|
| 75 |
+
Ask if user wants common aliases:
|
| 76 |
+
```bash
|
| 77 |
+
git config --global alias.st status
|
| 78 |
+
git config --global alias.co checkout
|
| 79 |
+
git config --global alias.br branch
|
| 80 |
+
git config --global alias.ci commit
|
| 81 |
+
git config --global alias.unstage 'reset HEAD --'
|
| 82 |
+
git config --global alias.last 'log -1 HEAD'
|
| 83 |
+
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
5. **GPG signing (optional)**
|
| 87 |
+
```bash
|
| 88 |
+
git config --global commit.gpgsign true
|
| 89 |
+
git config --global user.signingkey <GPG-KEY-ID>
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
6. **Show updated configuration**
|
| 93 |
+
- Display all global settings
|
| 94 |
+
- Highlight changes made
|
| 95 |
+
|
| 96 |
+
## Output
|
| 97 |
+
|
| 98 |
+
Provide a summary showing:
|
| 99 |
+
- Current git configuration
|
| 100 |
+
- Missing essential settings
|
| 101 |
+
- Recommended configurations
|
| 102 |
+
- Changes made (if any)
|
| 103 |
+
- Next steps or additional suggestions
|
commands/configuration/check-global-gitignore.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Check if user has global gitignore and create one if not
|
| 3 |
+
tags: [git, configuration, gitignore, development, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user set up a global gitignore file.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check if global gitignore exists**
|
| 11 |
+
- Run: `git config --global core.excludesfile`
|
| 12 |
+
- Check common locations:
|
| 13 |
+
- `~/.gitignore_global`
|
| 14 |
+
- `~/.gitignore`
|
| 15 |
+
- `~/.config/git/ignore`
|
| 16 |
+
|
| 17 |
+
2. **If global gitignore doesn't exist, create one**
|
| 18 |
+
- Choose location: `~/.gitignore_global`
|
| 19 |
+
- Configure git to use it:
|
| 20 |
+
```bash
|
| 21 |
+
git config --global core.excludesfile ~/.gitignore_global
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
3. **Populate with common patterns**
|
| 25 |
+
- Create comprehensive gitignore with patterns for:
|
| 26 |
+
|
| 27 |
+
**Operating System:**
|
| 28 |
+
```
|
| 29 |
+
# macOS
|
| 30 |
+
.DS_Store
|
| 31 |
+
.AppleDouble
|
| 32 |
+
.LSOverride
|
| 33 |
+
|
| 34 |
+
# Linux
|
| 35 |
+
*~
|
| 36 |
+
.directory
|
| 37 |
+
.Trash-*
|
| 38 |
+
|
| 39 |
+
# Windows
|
| 40 |
+
Thumbs.db
|
| 41 |
+
Desktop.ini
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
**IDEs and Editors:**
|
| 45 |
+
```
|
| 46 |
+
# VS Code
|
| 47 |
+
.vscode/
|
| 48 |
+
*.code-workspace
|
| 49 |
+
|
| 50 |
+
# JetBrains
|
| 51 |
+
.idea/
|
| 52 |
+
*.iml
|
| 53 |
+
|
| 54 |
+
# Vim
|
| 55 |
+
*.swp
|
| 56 |
+
*.swo
|
| 57 |
+
*~
|
| 58 |
+
|
| 59 |
+
# Emacs
|
| 60 |
+
*~
|
| 61 |
+
\#*\#
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
**Languages and Frameworks:**
|
| 65 |
+
```
|
| 66 |
+
# Python
|
| 67 |
+
__pycache__/
|
| 68 |
+
*.py[cod]
|
| 69 |
+
*$py.class
|
| 70 |
+
.venv/
|
| 71 |
+
venv/
|
| 72 |
+
ENV/
|
| 73 |
+
.Python
|
| 74 |
+
*.egg-info/
|
| 75 |
+
dist/
|
| 76 |
+
build/
|
| 77 |
+
|
| 78 |
+
# Node.js
|
| 79 |
+
node_modules/
|
| 80 |
+
npm-debug.log
|
| 81 |
+
yarn-error.log
|
| 82 |
+
.npm/
|
| 83 |
+
|
| 84 |
+
# Ruby
|
| 85 |
+
*.gem
|
| 86 |
+
.bundle/
|
| 87 |
+
vendor/bundle/
|
| 88 |
+
|
| 89 |
+
# Rust
|
| 90 |
+
target/
|
| 91 |
+
Cargo.lock
|
| 92 |
+
|
| 93 |
+
# Go
|
| 94 |
+
*.exe
|
| 95 |
+
*.test
|
| 96 |
+
*.out
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
**Build artifacts:**
|
| 100 |
+
```
|
| 101 |
+
*.o
|
| 102 |
+
*.a
|
| 103 |
+
*.so
|
| 104 |
+
*.dylib
|
| 105 |
+
*.dll
|
| 106 |
+
*.class
|
| 107 |
+
*.jar
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
**Misc:**
|
| 111 |
+
```
|
| 112 |
+
# Logs
|
| 113 |
+
*.log
|
| 114 |
+
logs/
|
| 115 |
+
|
| 116 |
+
# Temporary files
|
| 117 |
+
*.tmp
|
| 118 |
+
*.temp
|
| 119 |
+
.cache/
|
| 120 |
+
|
| 121 |
+
# Environment files
|
| 122 |
+
.env
|
| 123 |
+
.env.local
|
| 124 |
+
|
| 125 |
+
# Database files
|
| 126 |
+
*.sqlite
|
| 127 |
+
*.db
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
4. **Review existing gitignore if it exists**
|
| 131 |
+
- Read current file
|
| 132 |
+
- Suggest additions if patterns are missing
|
| 133 |
+
- Offer to back up before modifying
|
| 134 |
+
|
| 135 |
+
5. **Test the configuration**
|
| 136 |
+
- Verify config: `git config --global core.excludesfile`
|
| 137 |
+
- Show the file: `cat ~/.gitignore_global`
|
| 138 |
+
|
| 139 |
+
## Output
|
| 140 |
+
|
| 141 |
+
Provide a summary showing:
|
| 142 |
+
- Global gitignore location
|
| 143 |
+
- Whether it was created or already existed
|
| 144 |
+
- List of patterns included
|
| 145 |
+
- Verification of git configuration
|
commands/configuration/check-path.md
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Check and Analyze PATH
|
| 2 |
+
|
| 3 |
+
You are helping the user analyze what's on their PATH and suggest additions or improvements.
|
| 4 |
+
|
| 5 |
+
## Your tasks:
|
| 6 |
+
|
| 7 |
+
1. **Display current PATH:**
|
| 8 |
+
```bash
|
| 9 |
+
echo $PATH | tr ':' '\n'
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
2. **Check which paths actually exist:**
|
| 13 |
+
```bash
|
| 14 |
+
echo $PATH | tr ':' '\n' | while read p; do
|
| 15 |
+
if [ -d "$p" ]; then
|
| 16 |
+
echo "✓ $p"
|
| 17 |
+
else
|
| 18 |
+
echo "✗ $p (does not exist)"
|
| 19 |
+
fi
|
| 20 |
+
done
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
3. **Check for duplicate PATH entries:**
|
| 24 |
+
```bash
|
| 25 |
+
echo $PATH | tr ':' '\n' | sort | uniq -d
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
4. **Identify where PATH is being set:**
|
| 29 |
+
Check common locations:
|
| 30 |
+
```bash
|
| 31 |
+
grep -n "PATH" ~/.bashrc ~/.bash_profile ~/.profile /etc/environment /etc/profile 2>/dev/null
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
5. **Check for common development tool paths:**
|
| 35 |
+
|
| 36 |
+
**Programming languages:**
|
| 37 |
+
- Python user packages: `~/.local/bin`
|
| 38 |
+
- Rust cargo: `~/.cargo/bin`
|
| 39 |
+
- Go: `~/go/bin` or `$GOPATH/bin`
|
| 40 |
+
- Ruby gems: Check with `gem environment`
|
| 41 |
+
- Node/npm: Check with `npm config get prefix`
|
| 42 |
+
|
| 43 |
+
**Package managers:**
|
| 44 |
+
- Homebrew: `/home/linuxbrew/.linuxbrew/bin`
|
| 45 |
+
- SDKMAN: `~/.sdkman/candidates/*/current/bin`
|
| 46 |
+
- pipx: `~/.local/bin`
|
| 47 |
+
|
| 48 |
+
**Version managers:**
|
| 49 |
+
- pyenv: `~/.pyenv/bin`
|
| 50 |
+
- rbenv: `~/.rbenv/bin`
|
| 51 |
+
- nvm: (check ~/.nvm/)
|
| 52 |
+
- asdf: `~/.asdf/bin`
|
| 53 |
+
|
| 54 |
+
**System tools:**
|
| 55 |
+
- User binaries: `~/bin`, `~/.local/bin`
|
| 56 |
+
- Snap: `/snap/bin`
|
| 57 |
+
- Flatpak: `/var/lib/flatpak/exports/bin`
|
| 58 |
+
|
| 59 |
+
6. **Check what's installed in each PATH directory:**
|
| 60 |
+
For each directory in PATH:
|
| 61 |
+
```bash
|
| 62 |
+
echo "Contents of $dir:"
|
| 63 |
+
ls -la "$dir" | head -10
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
7. **Suggest missing common paths:**
|
| 67 |
+
Check and suggest if not in PATH:
|
| 68 |
+
|
| 69 |
+
- `~/.local/bin` (Python user packages, pipx)
|
| 70 |
+
- `~/bin` (User scripts)
|
| 71 |
+
- `~/.cargo/bin` (Rust packages)
|
| 72 |
+
- `~/go/bin` (Go packages)
|
| 73 |
+
- `/snap/bin` (Snap packages)
|
| 74 |
+
- `~/.npm-global/bin` (npm global packages)
|
| 75 |
+
|
| 76 |
+
For each missing path that has executables, suggest adding it.
|
| 77 |
+
|
| 78 |
+
8. **Check for security issues:**
|
| 79 |
+
- Warn if `.` (current directory) is in PATH
|
| 80 |
+
- Warn if world-writable directories are in PATH:
|
| 81 |
+
```bash
|
| 82 |
+
echo $PATH | tr ':' '\n' | while read p; do
|
| 83 |
+
if [ -d "$p" ] && [ -w "$p" ]; then
|
| 84 |
+
ls -ld "$p"
|
| 85 |
+
fi
|
| 86 |
+
done
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
9. **Check PATH order/precedence:**
|
| 90 |
+
Explain that earlier paths take precedence.
|
| 91 |
+
Show which binary would be executed:
|
| 92 |
+
```bash
|
| 93 |
+
which -a python python3 java gcc git node npm
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
10. **Check for conflicting tools:**
|
| 97 |
+
```bash
|
| 98 |
+
type -a python
|
| 99 |
+
type -a python3
|
| 100 |
+
type -a java
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
11. **Suggest PATH organization:**
|
| 104 |
+
Recommended order:
|
| 105 |
+
1. User binaries (`~/bin`, `~/.local/bin`)
|
| 106 |
+
2. Version managers (pyenv, rbenv, nvm)
|
| 107 |
+
3. Language-specific paths (cargo, go)
|
| 108 |
+
4. Homebrew
|
| 109 |
+
5. System binaries (`/usr/local/bin`, `/usr/bin`, `/bin`)
|
| 110 |
+
|
| 111 |
+
12. **Check environment-specific paths:**
|
| 112 |
+
|
| 113 |
+
**Python:**
|
| 114 |
+
```bash
|
| 115 |
+
python3 -m site --user-base
|
| 116 |
+
# Suggests adding $(python3 -m site --user-base)/bin
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
**Node/npm:**
|
| 120 |
+
```bash
|
| 121 |
+
npm config get prefix
|
| 122 |
+
# Suggests adding <prefix>/bin
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
**Go:**
|
| 126 |
+
```bash
|
| 127 |
+
go env GOPATH
|
| 128 |
+
# Suggests adding $GOPATH/bin
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
**Rust:**
|
| 132 |
+
```bash
|
| 133 |
+
echo $CARGO_HOME
|
| 134 |
+
# Suggests adding ~/.cargo/bin
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
13. **Generate suggested PATH setup:**
|
| 138 |
+
Based on findings, create suggested additions for ~/.bashrc:
|
| 139 |
+
|
| 140 |
+
```bash
|
| 141 |
+
# User binaries
|
| 142 |
+
export PATH="$HOME/bin:$PATH"
|
| 143 |
+
export PATH="$HOME/.local/bin:$PATH"
|
| 144 |
+
|
| 145 |
+
# Python
|
| 146 |
+
export PATH="$HOME/.local/bin:$PATH"
|
| 147 |
+
|
| 148 |
+
# Rust
|
| 149 |
+
export PATH="$HOME/.cargo/bin:$PATH"
|
| 150 |
+
|
| 151 |
+
# Go
|
| 152 |
+
export PATH="$HOME/go/bin:$PATH"
|
| 153 |
+
|
| 154 |
+
# SDKMAN
|
| 155 |
+
# Added by sdkman-init.sh
|
| 156 |
+
|
| 157 |
+
# pyenv
|
| 158 |
+
export PYENV_ROOT="$HOME/.pyenv"
|
| 159 |
+
export PATH="$PYENV_ROOT/bin:$PATH"
|
| 160 |
+
eval "$(pyenv init --path)"
|
| 161 |
+
|
| 162 |
+
# Homebrew
|
| 163 |
+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
| 164 |
+
```
|
| 165 |
+
|
| 166 |
+
14. **Check for broken symlinks in PATH:**
|
| 167 |
+
```bash
|
| 168 |
+
echo $PATH | tr ':' '\n' | while read dir; do
|
| 169 |
+
if [ -d "$dir" ]; then
|
| 170 |
+
find "$dir" -maxdepth 1 -type l ! -exec test -e {} \; -print 2>/dev/null
|
| 171 |
+
fi
|
| 172 |
+
done
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
15. **Provide recommendations:**
|
| 176 |
+
- Remove non-existent directories from PATH
|
| 177 |
+
- Add missing common paths that have executables
|
| 178 |
+
- Fix duplicate entries
|
| 179 |
+
- Correct PATH order if needed
|
| 180 |
+
- Remove security issues (`.` in PATH, world-writable dirs)
|
| 181 |
+
- Consolidate PATH modifications into one file (prefer ~/.bashrc)
|
| 182 |
+
- Document what each PATH addition is for
|
| 183 |
+
|
| 184 |
+
16. **Show how to temporarily modify PATH:**
|
| 185 |
+
```bash
|
| 186 |
+
# Add to front (takes precedence)
|
| 187 |
+
export PATH="/new/path:$PATH"
|
| 188 |
+
|
| 189 |
+
# Add to end
|
| 190 |
+
export PATH="$PATH:/new/path"
|
| 191 |
+
|
| 192 |
+
# Remove from PATH
|
| 193 |
+
export PATH=$(echo $PATH | tr ':' '\n' | grep -v "/path/to/remove" | tr '\n' ':')
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
17. **Show how to make PATH changes permanent:**
|
| 197 |
+
```bash
|
| 198 |
+
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
|
| 199 |
+
source ~/.bashrc
|
| 200 |
+
```
|
| 201 |
+
|
| 202 |
+
## Important notes:
|
| 203 |
+
- Changes to PATH only affect current shell unless made permanent
|
| 204 |
+
- Order matters - earlier paths have precedence
|
| 205 |
+
- Don't add current directory (`.`) to PATH
|
| 206 |
+
- Use absolute paths when possible
|
| 207 |
+
- Source ~/.bashrc after changes: `source ~/.bashrc`
|
| 208 |
+
- Some tools (pyenv, conda, nvm) modify PATH dynamically
|
| 209 |
+
- Check for PATH modifications in multiple files
|
commands/configuration/debug-folder-permissions.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Debug System Folder Permissions
|
| 2 |
+
|
| 3 |
+
You are helping the user debug systemwide folder permissions and ensure they are set appropriately.
|
| 4 |
+
|
| 5 |
+
## Your tasks:
|
| 6 |
+
|
| 7 |
+
1. **Gather information from user:**
|
| 8 |
+
Ask:
|
| 9 |
+
- Are they experiencing specific permission errors?
|
| 10 |
+
- Which directories or operations are affected?
|
| 11 |
+
- What user/group should have access?
|
| 12 |
+
|
| 13 |
+
2. **Check common system directories:**
|
| 14 |
+
|
| 15 |
+
**Root filesystem:**
|
| 16 |
+
```bash
|
| 17 |
+
ls -ld /
|
| 18 |
+
# Should be: drwxr-xr-x root root
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
**Essential system directories:**
|
| 22 |
+
```bash
|
| 23 |
+
ls -ld /bin /sbin /usr /usr/bin /usr/sbin /lib /lib64
|
| 24 |
+
# Should be: drwxr-xr-x root root
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
**Variable data:**
|
| 28 |
+
```bash
|
| 29 |
+
ls -ld /var /var/log /var/tmp
|
| 30 |
+
# /var: drwxr-xr-x root root
|
| 31 |
+
# /var/log: drwxrwxr-x root syslog (or root root)
|
| 32 |
+
# /var/tmp: drwxrwxrwt root root (sticky bit)
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
**Temporary directories:**
|
| 36 |
+
```bash
|
| 37 |
+
ls -ld /tmp
|
| 38 |
+
# Should be: drwxrwxrwt root root (sticky bit important!)
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
**Home directories:**
|
| 42 |
+
```bash
|
| 43 |
+
ls -ld /home /home/$USER
|
| 44 |
+
# /home: drwxr-xr-x root root
|
| 45 |
+
# /home/$USER: drwxr-xr-x $USER $USER (or drwx------ for privacy)
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
3. **Check for permission issues:**
|
| 49 |
+
|
| 50 |
+
**World-writable directories without sticky bit (security risk):**
|
| 51 |
+
```bash
|
| 52 |
+
sudo find / -type d -perm -0002 ! -perm -1000 2>/dev/null
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
**Files with SUID bit (potential security issue if unexpected):**
|
| 56 |
+
```bash
|
| 57 |
+
sudo find / -type f -perm -4000 2>/dev/null
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
**Files with SGID bit:**
|
| 61 |
+
```bash
|
| 62 |
+
sudo find / -type f -perm -2000 2>/dev/null
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
4. **Check /etc permissions:**
|
| 66 |
+
```bash
|
| 67 |
+
ls -la /etc | head -20
|
| 68 |
+
# /etc itself: drwxr-xr-x root root
|
| 69 |
+
# Most files should be 644 (rw-r--r--)
|
| 70 |
+
# Some may be 640 or 600 for security
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
**Sensitive files:**
|
| 74 |
+
```bash
|
| 75 |
+
ls -l /etc/shadow /etc/gshadow /etc/ssh/sshd_config
|
| 76 |
+
# /etc/shadow: -rw-r----- root shadow
|
| 77 |
+
# /etc/ssh/sshd_config: -rw-r--r-- root root
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
5. **Check user home directory structure:**
|
| 81 |
+
```bash
|
| 82 |
+
ls -la ~/ | grep "^d"
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
Common directories and recommended permissions:
|
| 86 |
+
- `~/.ssh`: 700 (drwx------)
|
| 87 |
+
- `~/.ssh/id_rsa`: 600 (-rw-------)
|
| 88 |
+
- `~/.ssh/id_rsa.pub`: 644 (-rw-r--r--)
|
| 89 |
+
- `~/.ssh/authorized_keys`: 600 (-rw-------)
|
| 90 |
+
- `~/.gnupg`: 700 (drwx------)
|
| 91 |
+
- `~/bin`: 755 (drwxr-xr-x)
|
| 92 |
+
- `~/.local`: 755 (drwxr-xr-x)
|
| 93 |
+
- `~/.config`: 755 (drwxr-xr-x)
|
| 94 |
+
|
| 95 |
+
6. **Check /opt and /usr/local:**
|
| 96 |
+
```bash
|
| 97 |
+
ls -ld /opt /usr/local /usr/local/bin
|
| 98 |
+
# Typically: drwxr-xr-x root root
|
| 99 |
+
# But may be group-writable for admin group
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
7. **Check mount points:**
|
| 103 |
+
```bash
|
| 104 |
+
mount | grep "^/" | awk '{print $3}' | while read mp; do
|
| 105 |
+
ls -ld "$mp"
|
| 106 |
+
done
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
8. **Check ownership of user files:**
|
| 110 |
+
Find files in home directory not owned by user:
|
| 111 |
+
```bash
|
| 112 |
+
find ~/ -not -user $USER 2>/dev/null
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
9. **Check group memberships:**
|
| 116 |
+
```bash
|
| 117 |
+
groups
|
| 118 |
+
id
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
Common groups users might need:
|
| 122 |
+
- `sudo` - for administrative access
|
| 123 |
+
- `docker` - for Docker access
|
| 124 |
+
- `video` - for video devices
|
| 125 |
+
- `audio` - for audio devices
|
| 126 |
+
- `plugdev` - for removable devices
|
| 127 |
+
- `dialout` - for serial ports
|
| 128 |
+
|
| 129 |
+
10. **Fix common issues:**
|
| 130 |
+
|
| 131 |
+
**Fix sticky bit on /tmp:**
|
| 132 |
+
```bash
|
| 133 |
+
sudo chmod 1777 /tmp
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
**Fix ~/.ssh permissions:**
|
| 137 |
+
```bash
|
| 138 |
+
chmod 700 ~/.ssh
|
| 139 |
+
chmod 600 ~/.ssh/id_rsa
|
| 140 |
+
chmod 644 ~/.ssh/id_rsa.pub
|
| 141 |
+
chmod 600 ~/.ssh/authorized_keys
|
| 142 |
+
chmod 600 ~/.ssh/config
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
**Fix ownership of home directory:**
|
| 146 |
+
```bash
|
| 147 |
+
sudo chown -R $USER:$USER ~/
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
**Fix common directories:**
|
| 151 |
+
```bash
|
| 152 |
+
chmod 755 ~/.local ~/.config ~/bin
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
11. **Check for ACL (Access Control Lists):**
|
| 156 |
+
```bash
|
| 157 |
+
getfacl /path/to/directory
|
| 158 |
+
```
|
| 159 |
+
|
| 160 |
+
If ACLs are in use (indicated by `+` in ls -l):
|
| 161 |
+
```bash
|
| 162 |
+
ls -la | grep "+"
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
12. **Check SELinux context (if enabled):**
|
| 166 |
+
```bash
|
| 167 |
+
getenforce
|
| 168 |
+
ls -Z /path/to/directory
|
| 169 |
+
```
|
| 170 |
+
|
| 171 |
+
13. **Check for immutable flags:**
|
| 172 |
+
```bash
|
| 173 |
+
lsattr /path/to/file
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
If files have `i` flag, they can't be modified even by root:
|
| 177 |
+
```bash
|
| 178 |
+
sudo chattr -i /path/to/file
|
| 179 |
+
```
|
| 180 |
+
|
| 181 |
+
14. **Specific directory recommendations:**
|
| 182 |
+
|
| 183 |
+
**/var/www (web server):**
|
| 184 |
+
```bash
|
| 185 |
+
sudo chown -R www-data:www-data /var/www
|
| 186 |
+
sudo find /var/www -type d -exec chmod 755 {} \;
|
| 187 |
+
sudo find /var/www -type f -exec chmod 644 {} \;
|
| 188 |
+
```
|
| 189 |
+
|
| 190 |
+
**/srv (service data):**
|
| 191 |
+
```bash
|
| 192 |
+
sudo chown -R root:root /srv
|
| 193 |
+
sudo chmod 755 /srv
|
| 194 |
+
```
|
| 195 |
+
|
| 196 |
+
**Shared directories:**
|
| 197 |
+
```bash
|
| 198 |
+
sudo chown root:groupname /shared/directory
|
| 199 |
+
sudo chmod 2775 /shared/directory # SGID bit for group
|
| 200 |
+
```
|
| 201 |
+
|
| 202 |
+
15. **Check logs for permission denials:**
|
| 203 |
+
```bash
|
| 204 |
+
sudo journalctl -p err | grep -i "permission denied"
|
| 205 |
+
dmesg | grep -i "permission denied"
|
| 206 |
+
sudo grep "permission denied" /var/log/syslog
|
| 207 |
+
```
|
| 208 |
+
|
| 209 |
+
16. **Report findings:**
|
| 210 |
+
Summarize:
|
| 211 |
+
- Incorrect permissions on system directories
|
| 212 |
+
- Security issues (world-writable without sticky, unexpected SUID)
|
| 213 |
+
- User home directory issues
|
| 214 |
+
- Files/directories with wrong ownership
|
| 215 |
+
- Missing group memberships
|
| 216 |
+
- ACL or SELinux issues
|
| 217 |
+
|
| 218 |
+
17. **Provide recommendations:**
|
| 219 |
+
- Fix commands for identified issues
|
| 220 |
+
- Whether to add user to specific groups
|
| 221 |
+
- Security improvements for sensitive directories
|
| 222 |
+
- Standard permission schemes for common directories
|
| 223 |
+
- Whether to use ACLs for complex permission needs
|
| 224 |
+
|
| 225 |
+
## Important notes:
|
| 226 |
+
- Always backup or test in safe environment first
|
| 227 |
+
- Changing system permissions incorrectly can break the system
|
| 228 |
+
- Use sudo carefully when fixing permissions
|
| 229 |
+
- Don't recursively chmod/chown system directories without understanding
|
| 230 |
+
- Some non-standard permissions may be intentional
|
| 231 |
+
- Check application documentation for required permissions
|
| 232 |
+
- SELinux/AppArmor may also affect access beyond traditional permissions
|
| 233 |
+
- Sticky bit on /tmp is critical for security
|
| 234 |
+
- SUID/SGID bits on unexpected files are security risks
|
commands/configuration/list-ssh-connections.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Review which SSH connection names/hosts the user has configured
|
| 3 |
+
tags: [ssh, configuration, hosts, network, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user review their SSH connection configurations.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check if SSH config exists**
|
| 11 |
+
- Look for: `~/.ssh/config`
|
| 12 |
+
- If not found, offer to create one
|
| 13 |
+
|
| 14 |
+
2. **Parse SSH config file**
|
| 15 |
+
- Read `~/.ssh/config`
|
| 16 |
+
- Extract Host entries
|
| 17 |
+
- For each host, show:
|
| 18 |
+
- Host alias
|
| 19 |
+
- HostName (IP/domain)
|
| 20 |
+
- User
|
| 21 |
+
- Port
|
| 22 |
+
- IdentityFile (SSH key)
|
| 23 |
+
- Other options
|
| 24 |
+
|
| 25 |
+
3. **Display in organized format**
|
| 26 |
+
- Present as table or list:
|
| 27 |
+
```
|
| 28 |
+
Alias: server1
|
| 29 |
+
HostName: 192.168.1.100
|
| 30 |
+
User: admin
|
| 31 |
+
Port: 22
|
| 32 |
+
Key: ~/.ssh/id_rsa
|
| 33 |
+
---
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
4. **Check system-wide SSH config**
|
| 37 |
+
- Also check `/etc/ssh/ssh_config` for global settings
|
| 38 |
+
- Note any system-wide host configurations
|
| 39 |
+
|
| 40 |
+
5. **Test connectivity (optional)**
|
| 41 |
+
- Ask if user wants to test connections
|
| 42 |
+
- For each host:
|
| 43 |
+
```bash
|
| 44 |
+
ssh -T user@host
|
| 45 |
+
# or
|
| 46 |
+
ssh -o ConnectTimeout=5 user@host "echo Connection successful"
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
6. **Identify stale connections**
|
| 50 |
+
- Look for connections to:
|
| 51 |
+
- IPs that might have changed
|
| 52 |
+
- Servers that may no longer exist
|
| 53 |
+
- Old project servers
|
| 54 |
+
|
| 55 |
+
7. **Suggest config improvements**
|
| 56 |
+
- Recommend useful SSH config options:
|
| 57 |
+
```
|
| 58 |
+
Host *
|
| 59 |
+
ServerAliveInterval 60
|
| 60 |
+
ServerAliveCountMax 3
|
| 61 |
+
TCPKeepAlive yes
|
| 62 |
+
ControlMaster auto
|
| 63 |
+
ControlPath ~/.ssh/sockets/%r@%h-%p
|
| 64 |
+
ControlPersist 600
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
8. **Offer to create new entries**
|
| 68 |
+
- If user wants to add new SSH hosts
|
| 69 |
+
- Template:
|
| 70 |
+
```
|
| 71 |
+
Host shortname
|
| 72 |
+
HostName hostname.com
|
| 73 |
+
User username
|
| 74 |
+
Port 22
|
| 75 |
+
IdentityFile ~/.ssh/id_ed25519
|
| 76 |
+
ForwardAgent yes
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
9. **Security check**
|
| 80 |
+
- Verify file permissions: `chmod 600 ~/.ssh/config`
|
| 81 |
+
- Look for insecure settings (password auth, etc.)
|
| 82 |
+
|
| 83 |
+
## Output
|
| 84 |
+
|
| 85 |
+
Provide a summary showing:
|
| 86 |
+
- List of configured SSH hosts
|
| 87 |
+
- Connection details for each
|
| 88 |
+
- Stale/inactive connections (if identified)
|
| 89 |
+
- Connectivity test results (if performed)
|
| 90 |
+
- Suggested improvements
|
| 91 |
+
- New entries added (if any)
|
commands/configuration/manage-api-keys.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Review API keys on PATH and add new ones if requested
|
| 3 |
+
tags: [api, keys, environment, configuration, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user manage their API keys and environment variables.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check for API keys in environment**
|
| 11 |
+
- List environment variables: `env | grep -E "API|KEY|TOKEN"`
|
| 12 |
+
- Check common locations:
|
| 13 |
+
- `~/.bashrc`
|
| 14 |
+
- `~/.zshrc`
|
| 15 |
+
- `~/.profile`
|
| 16 |
+
- `~/.env`
|
| 17 |
+
- Project-specific `.env` files
|
| 18 |
+
|
| 19 |
+
2. **Display current API keys (safely)**
|
| 20 |
+
- Show key names and partial values (mask full keys)
|
| 21 |
+
- Example: `OPENAI_API_KEY=sk-*********************`
|
| 22 |
+
|
| 23 |
+
3. **Common API keys to check for**
|
| 24 |
+
- OpenAI API
|
| 25 |
+
- Anthropic API (Claude)
|
| 26 |
+
- OpenRouter API
|
| 27 |
+
- Hugging Face token
|
| 28 |
+
- GitHub token
|
| 29 |
+
- Google Cloud API
|
| 30 |
+
- AWS credentials
|
| 31 |
+
- Azure credentials
|
| 32 |
+
- Database connection strings
|
| 33 |
+
|
| 34 |
+
4. **Add new API keys**
|
| 35 |
+
- Ask user which API keys they want to add
|
| 36 |
+
- For each key:
|
| 37 |
+
- Key name (e.g., `OPENAI_API_KEY`)
|
| 38 |
+
- Key value (handle securely)
|
| 39 |
+
- Scope (global, project-specific, etc.)
|
| 40 |
+
|
| 41 |
+
5. **Choose storage location**
|
| 42 |
+
|
| 43 |
+
**Option 1: Shell config (global)**
|
| 44 |
+
- Add to `~/.bashrc` or `~/.zshrc`:
|
| 45 |
+
```bash
|
| 46 |
+
export OPENAI_API_KEY="sk-..."
|
| 47 |
+
export ANTHROPIC_API_KEY="sk-..."
|
| 48 |
+
```
|
| 49 |
+
- Reload: `source ~/.bashrc`
|
| 50 |
+
|
| 51 |
+
**Option 2: .env file (project-specific)**
|
| 52 |
+
- Create/update `.env` file
|
| 53 |
+
- Add to `.gitignore`
|
| 54 |
+
- Use with dotenv library
|
| 55 |
+
|
| 56 |
+
**Option 3: Secret manager**
|
| 57 |
+
- Suggest using `pass`, `gnome-keyring`, or similar
|
| 58 |
+
- More secure for sensitive keys
|
| 59 |
+
|
| 60 |
+
6. **Set appropriate permissions**
|
| 61 |
+
- For files containing keys:
|
| 62 |
+
```bash
|
| 63 |
+
chmod 600 ~/.env
|
| 64 |
+
chmod 600 ~/.bashrc
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
7. **Test API keys**
|
| 68 |
+
- Offer to test each key (if user wants)
|
| 69 |
+
- Example for OpenAI:
|
| 70 |
+
```bash
|
| 71 |
+
curl https://api.openai.com/v1/models \
|
| 72 |
+
-H "Authorization: Bearer $OPENAI_API_KEY" \
|
| 73 |
+
| jq .
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
8. **Security recommendations**
|
| 77 |
+
- REFRAIN from providing unsolicited security advice
|
| 78 |
+
- Only mention if asked:
|
| 79 |
+
- Don't commit keys to git
|
| 80 |
+
- Use `.gitignore` for `.env` files
|
| 81 |
+
- Rotate keys periodically
|
| 82 |
+
- Use environment-specific keys (dev, prod)
|
| 83 |
+
|
| 84 |
+
9. **Create helper script (optional)**
|
| 85 |
+
- Offer to create script to load environment:
|
| 86 |
+
```bash
|
| 87 |
+
#!/bin/bash
|
| 88 |
+
# load-env.sh
|
| 89 |
+
if [ -f .env ]; then
|
| 90 |
+
export $(cat .env | xargs)
|
| 91 |
+
fi
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
## Output
|
| 95 |
+
|
| 96 |
+
Provide a summary showing:
|
| 97 |
+
- Currently configured API keys (names only, values masked)
|
| 98 |
+
- New API keys added
|
| 99 |
+
- Storage location for each key
|
| 100 |
+
- Test results (if performed)
|
| 101 |
+
- Next steps for using the keys
|
commands/configuration/manage-ssh-keys.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Review installed SSH key pairs and delete old ones if desired
|
| 3 |
+
tags: [ssh, security, keys, configuration, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user manage their SSH keys.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **List SSH keys**
|
| 11 |
+
- List keys in `~/.ssh/`: `ls -la ~/.ssh/`
|
| 12 |
+
- Identify key pairs:
|
| 13 |
+
- Private keys (no extension, or `.pem`)
|
| 14 |
+
- Public keys (`.pub`)
|
| 15 |
+
- Known hosts file
|
| 16 |
+
- Config file
|
| 17 |
+
|
| 18 |
+
2. **Display public keys with details**
|
| 19 |
+
- For each public key:
|
| 20 |
+
```bash
|
| 21 |
+
for key in ~/.ssh/*.pub; do
|
| 22 |
+
echo "=== $key ==="
|
| 23 |
+
ssh-keygen -l -f "$key"
|
| 24 |
+
echo ""
|
| 25 |
+
done
|
| 26 |
+
```
|
| 27 |
+
- Shows: key length, fingerprint, comment
|
| 28 |
+
|
| 29 |
+
3. **Check if keys are loaded in ssh-agent**
|
| 30 |
+
- List loaded keys: `ssh-add -l`
|
| 31 |
+
- If agent not running: `eval "$(ssh-agent -s)"`
|
| 32 |
+
|
| 33 |
+
4. **Identify key usage**
|
| 34 |
+
- Check `~/.ssh/config` for key assignments
|
| 35 |
+
- Ask user about each key:
|
| 36 |
+
- Where is it used? (GitHub, servers, etc.)
|
| 37 |
+
- Is it still needed?
|
| 38 |
+
- When was it created?
|
| 39 |
+
|
| 40 |
+
5. **Check key security**
|
| 41 |
+
- Verify key types (RSA, ED25519, etc.)
|
| 42 |
+
- Check key lengths:
|
| 43 |
+
- RSA: Minimum 2048-bit, prefer 4096-bit
|
| 44 |
+
- ED25519: 256-bit (modern, recommended)
|
| 45 |
+
- Suggest upgrading old/weak keys
|
| 46 |
+
|
| 47 |
+
6. **Delete old/unused keys**
|
| 48 |
+
- For each key user wants to remove:
|
| 49 |
+
```bash
|
| 50 |
+
rm ~/.ssh/old_key
|
| 51 |
+
rm ~/.ssh/old_key.pub
|
| 52 |
+
```
|
| 53 |
+
- Update `~/.ssh/config` if key was referenced
|
| 54 |
+
- Remove from ssh-agent: `ssh-add -d ~/.ssh/old_key`
|
| 55 |
+
|
| 56 |
+
7. **Generate new keys if needed**
|
| 57 |
+
- Suggest ED25519 for new keys:
|
| 58 |
+
```bash
|
| 59 |
+
ssh-keygen -t ed25519 -C "user@email.com"
|
| 60 |
+
```
|
| 61 |
+
- Or RSA 4096:
|
| 62 |
+
```bash
|
| 63 |
+
ssh-keygen -t rsa -b 4096 -C "user@email.com"
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
8. **Update permissions**
|
| 67 |
+
- Ensure correct permissions:
|
| 68 |
+
```bash
|
| 69 |
+
chmod 700 ~/.ssh
|
| 70 |
+
chmod 600 ~/.ssh/id_*
|
| 71 |
+
chmod 644 ~/.ssh/id_*.pub
|
| 72 |
+
chmod 600 ~/.ssh/config
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
9. **Add keys to ssh-agent**
|
| 76 |
+
- Add keys: `ssh-add ~/.ssh/id_ed25519`
|
| 77 |
+
- Persist across reboots (add to `~/.bashrc`):
|
| 78 |
+
```bash
|
| 79 |
+
eval "$(ssh-agent -s)"
|
| 80 |
+
ssh-add ~/.ssh/id_ed25519
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Output
|
| 84 |
+
|
| 85 |
+
Provide a summary showing:
|
| 86 |
+
- List of SSH keys with details (type, length, fingerprint)
|
| 87 |
+
- Keys currently loaded in ssh-agent
|
| 88 |
+
- Keys deleted (if any)
|
| 89 |
+
- New keys generated (if any)
|
| 90 |
+
- Security recommendations
|
| 91 |
+
- Next steps for adding keys to services
|
commands/configuration/mcp/manage-mcp-servers.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Review installed MCP servers and work with user to add new ones
|
| 3 |
+
tags: [mcp, ai, configuration, servers, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user manage their MCP (Model Context Protocol) servers.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check MCP configuration**
|
| 11 |
+
- Look for MCP config: `~/mcp/` or `~/.config/mcp/`
|
| 12 |
+
- Check Claude Code config: `~/.config/claude/`
|
| 13 |
+
- Identify MCP server config files
|
| 14 |
+
|
| 15 |
+
2. **List currently installed MCP servers**
|
| 16 |
+
- Parse configuration files
|
| 17 |
+
- For each server, show:
|
| 18 |
+
- Server name
|
| 19 |
+
- Server type/purpose
|
| 20 |
+
- Status (running/stopped)
|
| 21 |
+
- Configuration details
|
| 22 |
+
|
| 23 |
+
3. **Check running MCP servers**
|
| 24 |
+
- Look for running processes:
|
| 25 |
+
```bash
|
| 26 |
+
ps aux | grep mcp
|
| 27 |
+
```
|
| 28 |
+
- Check if servers are accessible
|
| 29 |
+
|
| 30 |
+
4. **Suggest useful MCP servers**
|
| 31 |
+
|
| 32 |
+
**Common MCP servers:**
|
| 33 |
+
- Filesystem MCP (file operations)
|
| 34 |
+
- GitHub MCP (GitHub integration)
|
| 35 |
+
- Database MCP (PostgreSQL, SQLite, etc.)
|
| 36 |
+
- Browser MCP (web automation)
|
| 37 |
+
- Context7 MCP (documentation)
|
| 38 |
+
- Memory MCP (persistent memory)
|
| 39 |
+
- Search MCP (web search)
|
| 40 |
+
|
| 41 |
+
5. **Install new MCP servers**
|
| 42 |
+
- For each server user wants:
|
| 43 |
+
- Check installation method (npm, pip, docker, etc.)
|
| 44 |
+
- Install dependencies
|
| 45 |
+
- Configure server
|
| 46 |
+
- Add to MCP config
|
| 47 |
+
|
| 48 |
+
**Example: Installing filesystem MCP**
|
| 49 |
+
```bash
|
| 50 |
+
npm install -g @anthropic/mcp-server-filesystem
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
**Example: Installing custom MCP server**
|
| 54 |
+
```bash
|
| 55 |
+
git clone <repo-url>
|
| 56 |
+
cd <repo>
|
| 57 |
+
npm install
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
6. **Configure MCP servers**
|
| 61 |
+
- Add server to config file
|
| 62 |
+
- Example config:
|
| 63 |
+
```json
|
| 64 |
+
{
|
| 65 |
+
"mcpServers": {
|
| 66 |
+
"filesystem": {
|
| 67 |
+
"command": "mcp-server-filesystem",
|
| 68 |
+
"args": ["/path/to/allowed/directory"]
|
| 69 |
+
},
|
| 70 |
+
"github": {
|
| 71 |
+
"command": "mcp-server-github",
|
| 72 |
+
"env": {
|
| 73 |
+
"GITHUB_TOKEN": "your-token-here"
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
7. **Test MCP server connectivity**
|
| 81 |
+
- Start servers
|
| 82 |
+
- Verify they're accessible by Claude Code
|
| 83 |
+
- Test basic operations
|
| 84 |
+
|
| 85 |
+
8. **Document MCP setup**
|
| 86 |
+
- Offer to create `~/mcp/README.md` documenting:
|
| 87 |
+
- Installed servers
|
| 88 |
+
- Configuration
|
| 89 |
+
- Usage examples
|
| 90 |
+
- Troubleshooting
|
| 91 |
+
|
| 92 |
+
9. **Suggest workflows**
|
| 93 |
+
- Recommend MCP server combinations for common tasks
|
| 94 |
+
- Show example use cases
|
| 95 |
+
|
| 96 |
+
## Output
|
| 97 |
+
|
| 98 |
+
Provide a summary showing:
|
| 99 |
+
- Currently installed MCP servers
|
| 100 |
+
- Server status and configuration
|
| 101 |
+
- New servers installed (if any)
|
| 102 |
+
- Configuration changes made
|
| 103 |
+
- Usage examples
|
| 104 |
+
- Next steps or recommendations
|
commands/configuration/validate-bashrc.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Bashrc Validation
|
| 2 |
+
|
| 3 |
+
You are helping the user validate their .bashrc configuration for syntax errors, issues, and best practices.
|
| 4 |
+
|
| 5 |
+
## Your tasks:
|
| 6 |
+
|
| 7 |
+
1. **Locate bashrc files:**
|
| 8 |
+
- Check `~/.bashrc`
|
| 9 |
+
- Check `~/.bash_profile`
|
| 10 |
+
- Check `~/.profile`
|
| 11 |
+
- Check `/etc/bash.bashrc` (system-wide)
|
| 12 |
+
- Note which files exist and their sizes
|
| 13 |
+
|
| 14 |
+
2. **Syntax validation:**
|
| 15 |
+
- Test bashrc syntax: `bash -n ~/.bashrc`
|
| 16 |
+
- If errors are found, report the line numbers and error messages
|
| 17 |
+
- Check for common syntax issues:
|
| 18 |
+
- Unclosed quotes
|
| 19 |
+
- Unmatched brackets
|
| 20 |
+
- Missing 'fi', 'done', 'esac' keywords
|
| 21 |
+
|
| 22 |
+
3. **Source validation:**
|
| 23 |
+
- Test if bashrc can be sourced without errors in a subshell:
|
| 24 |
+
```bash
|
| 25 |
+
bash -c 'source ~/.bashrc && echo "Sourcing successful"'
|
| 26 |
+
```
|
| 27 |
+
- Capture any error messages
|
| 28 |
+
|
| 29 |
+
4. **Check for common issues:**
|
| 30 |
+
- Duplicate PATH entries:
|
| 31 |
+
```bash
|
| 32 |
+
bash -c 'source ~/.bashrc; echo $PATH | tr ":" "\n" | sort | uniq -d'
|
| 33 |
+
```
|
| 34 |
+
- Check for sourcing non-existent files:
|
| 35 |
+
```bash
|
| 36 |
+
grep -n "source\|^\." ~/.bashrc | while read line; do
|
| 37 |
+
# Extract and check if files exist
|
| 38 |
+
done
|
| 39 |
+
```
|
| 40 |
+
- Look for potentially problematic patterns:
|
| 41 |
+
- Infinite loops
|
| 42 |
+
- Commands that might hang (network calls without timeouts)
|
| 43 |
+
- Unguarded recursive sourcing
|
| 44 |
+
|
| 45 |
+
5. **Check initialization order:**
|
| 46 |
+
- Explain which files are loaded and in what order for:
|
| 47 |
+
- Login shells
|
| 48 |
+
- Non-login interactive shells
|
| 49 |
+
- Non-interactive shells
|
| 50 |
+
- Check if the proper guards are in place (e.g., checking for interactive shell)
|
| 51 |
+
|
| 52 |
+
6. **Performance analysis:**
|
| 53 |
+
- Time how long bashrc takes to load:
|
| 54 |
+
```bash
|
| 55 |
+
time bash -c 'source ~/.bashrc; exit'
|
| 56 |
+
```
|
| 57 |
+
- If it takes more than 0.5 seconds, identify potential slow sections:
|
| 58 |
+
- Look for commands that might be slow (network calls, heavy computations)
|
| 59 |
+
- Check for unnecessary repeated operations
|
| 60 |
+
|
| 61 |
+
7. **Check for security issues:**
|
| 62 |
+
- World-writable bashrc: `ls -la ~/.bashrc`
|
| 63 |
+
- Suspicious commands (downloads, eval with user input, etc.)
|
| 64 |
+
- Sourcing files from world-writable directories
|
| 65 |
+
|
| 66 |
+
8. **Validate environment manager initialization:**
|
| 67 |
+
- Check if environment managers are properly initialized:
|
| 68 |
+
- pyenv: `grep "pyenv init" ~/.bashrc`
|
| 69 |
+
- conda: `grep "conda initialize" ~/.bashrc`
|
| 70 |
+
- nvm: `grep "nvm.sh" ~/.bashrc`
|
| 71 |
+
- rbenv: `grep "rbenv init" ~/.bashrc`
|
| 72 |
+
- sdkman: `grep "sdkman-init.sh" ~/.bashrc`
|
| 73 |
+
- Verify they're in the correct order (PATH modifications should come after system PATH is set)
|
| 74 |
+
|
| 75 |
+
9. **Check for best practices:**
|
| 76 |
+
- Interactive shell guard at the top:
|
| 77 |
+
```bash
|
| 78 |
+
[[ $- != *i* ]] && return
|
| 79 |
+
```
|
| 80 |
+
- Proper PATH modification (appending/prepending, not replacing)
|
| 81 |
+
- Using `command -v` instead of `which`
|
| 82 |
+
- Proper quoting of variables
|
| 83 |
+
|
| 84 |
+
10. **Report findings:**
|
| 85 |
+
- Summary of validation results (PASS/FAIL)
|
| 86 |
+
- List of any errors or warnings
|
| 87 |
+
- Performance metrics
|
| 88 |
+
- Recommendations:
|
| 89 |
+
- Fixes for any syntax errors
|
| 90 |
+
- Optimization suggestions if slow
|
| 91 |
+
- Security improvements if needed
|
| 92 |
+
- Best practice improvements
|
| 93 |
+
- If bashrc is missing, offer to create a basic one
|
| 94 |
+
|
| 95 |
+
## Important notes:
|
| 96 |
+
- Don't modify the bashrc unless explicitly asked
|
| 97 |
+
- Be careful when testing - use subshells to avoid affecting the current environment
|
| 98 |
+
- Distinguish between critical errors and style suggestions
|
| 99 |
+
- Consider that some "issues" might be intentional for the user's workflow
|
commands/debugging/check-boot-logs.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are analyzing system boot logs to identify failures and issues.
|
| 2 |
+
|
| 3 |
+
## Your Task
|
| 4 |
+
|
| 5 |
+
1. **Analyze systemd boot logs** using `journalctl -b` to examine the most recent boot
|
| 6 |
+
2. **Identify failures** by searching for:
|
| 7 |
+
- Failed services (`systemctl --failed`)
|
| 8 |
+
- Error and warning messages in boot logs
|
| 9 |
+
- Services that timed out during boot
|
| 10 |
+
- Failed units and dependency issues
|
| 11 |
+
3. **Categorize issues** by severity:
|
| 12 |
+
- Critical: Services that failed and are essential for system operation
|
| 13 |
+
- Warning: Services that failed but are non-essential
|
| 14 |
+
- Info: Services that are deprecated or can be safely disabled
|
| 15 |
+
4. **Provide detailed analysis** including:
|
| 16 |
+
- Service name and what it does
|
| 17 |
+
- Exact error message from logs
|
| 18 |
+
- Potential causes of the failure
|
| 19 |
+
- Suggested remediation steps
|
| 20 |
+
5. **Suggest cleanup actions** for:
|
| 21 |
+
- Deprecated services that can be disabled
|
| 22 |
+
- Unnecessary services slowing down boot
|
| 23 |
+
- Configuration fixes for failed services
|
| 24 |
+
|
| 25 |
+
## Commands to Use
|
| 26 |
+
|
| 27 |
+
- `journalctl -b -p err` - Show errors from current boot
|
| 28 |
+
- `journalctl -b -p warning` - Show warnings from current boot
|
| 29 |
+
- `systemctl --failed` - List failed units
|
| 30 |
+
- `systemctl list-units --state=failed` - Detailed failed units
|
| 31 |
+
- `journalctl -u <service-name>` - Check specific service logs
|
| 32 |
+
- `systemd-analyze critical-chain` - Show boot time-critical chain
|
| 33 |
+
|
| 34 |
+
## Output Format
|
| 35 |
+
|
| 36 |
+
Present findings in a clear, organized manner:
|
| 37 |
+
1. Summary of boot health
|
| 38 |
+
2. Critical failures requiring immediate attention
|
| 39 |
+
3. Warnings and non-critical issues
|
| 40 |
+
4. Recommendations for cleanup and optimization
|
| 41 |
+
5. Specific commands to fix identified issues
|
| 42 |
+
|
| 43 |
+
Be thorough but concise. Focus on actionable insights.
|
commands/debugging/diagnose-crash.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Diagnose Program Crash
|
| 2 |
+
|
| 3 |
+
You are helping the user diagnose a recent program crash. Ask for additional context from the user, but start by checking obvious places in the logs.
|
| 4 |
+
|
| 5 |
+
## Your tasks:
|
| 6 |
+
|
| 7 |
+
1. **Gather information from the user:**
|
| 8 |
+
Ask the user:
|
| 9 |
+
- What program crashed?
|
| 10 |
+
- When did it crash (approximate time)?
|
| 11 |
+
- What were they doing when it crashed?
|
| 12 |
+
- Does it crash consistently or intermittently?
|
| 13 |
+
- Any error messages displayed?
|
| 14 |
+
|
| 15 |
+
2. **Check system journal for crash information:**
|
| 16 |
+
- Recent errors: `sudo journalctl -p err -b`
|
| 17 |
+
- Last 100 log entries: `sudo journalctl -n 100 --no-pager`
|
| 18 |
+
- If user knows approximate time:
|
| 19 |
+
```bash
|
| 20 |
+
sudo journalctl --since "10 minutes ago" -p warning
|
| 21 |
+
sudo journalctl --since "YYYY-MM-DD HH:MM:SS"
|
| 22 |
+
```
|
| 23 |
+
- Search for specific program name:
|
| 24 |
+
```bash
|
| 25 |
+
sudo journalctl -b | grep -i "<program-name>"
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
3. **Check kernel logs (dmesg):**
|
| 29 |
+
- Recent kernel messages: `dmesg | tail -100`
|
| 30 |
+
- Look for segmentation faults, OOM kills, kernel panics
|
| 31 |
+
- Search for program name: `dmesg | grep -i "<program-name>"`
|
| 32 |
+
- Check for OOM (Out of Memory) kills:
|
| 33 |
+
```bash
|
| 34 |
+
dmesg | grep -i "killed process"
|
| 35 |
+
sudo journalctl -k | grep -i "out of memory"
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
4. **Check for core dumps:**
|
| 39 |
+
- Check if core dumps are enabled: `ulimit -c`
|
| 40 |
+
- System core dump pattern: `cat /proc/sys/kernel/core_pattern`
|
| 41 |
+
- Look for core dumps:
|
| 42 |
+
```bash
|
| 43 |
+
find /var/lib/systemd/coredump -name "*<program-name>*" -mtime -1
|
| 44 |
+
find . -name "core*" -mtime -1
|
| 45 |
+
```
|
| 46 |
+
- If systemd-coredump is used:
|
| 47 |
+
```bash
|
| 48 |
+
coredumpctl list
|
| 49 |
+
coredumpctl info <pid>
|
| 50 |
+
coredumpctl dump <pid> -o /tmp/core.dump
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
5. **Check application-specific logs:**
|
| 54 |
+
- User logs: `~/.local/share/applications/`
|
| 55 |
+
- Xsession errors: `cat ~/.xsession-errors`
|
| 56 |
+
- Application cache: `~/.cache/<program-name>/`
|
| 57 |
+
- Application config: `~/.config/<program-name>/`
|
| 58 |
+
- System logs: `/var/log/`
|
| 59 |
+
- Application-specific locations:
|
| 60 |
+
- Web browsers: `~/.mozilla/`, `~/.config/google-chrome/`
|
| 61 |
+
- Snaps: `snap logs <snap-name>`
|
| 62 |
+
- Flatpaks: `flatpak logs`
|
| 63 |
+
|
| 64 |
+
6. **Check crash reporter systems:**
|
| 65 |
+
- Ubuntu Apport crashes:
|
| 66 |
+
```bash
|
| 67 |
+
ls -lt /var/crash/
|
| 68 |
+
ubuntu-bug <program-name> # to file bug report
|
| 69 |
+
```
|
| 70 |
+
- GNOME crash reports (if applicable): `~/.local/share/gnome-shell/`
|
| 71 |
+
- KDE crash reports: `~/.local/share/drkonqi/`
|
| 72 |
+
|
| 73 |
+
7. **Check resource issues at crash time:**
|
| 74 |
+
- Memory usage: `free -h`
|
| 75 |
+
- Disk space: `df -h`
|
| 76 |
+
- Check if system was swapping heavily before crash
|
| 77 |
+
- Recent high memory usage: `sudo journalctl | grep -i "out of memory"`
|
| 78 |
+
|
| 79 |
+
8. **Check for dependency issues:**
|
| 80 |
+
- Missing libraries:
|
| 81 |
+
```bash
|
| 82 |
+
ldd $(which <program-name>)
|
| 83 |
+
```
|
| 84 |
+
- Check if program still exists and is executable:
|
| 85 |
+
```bash
|
| 86 |
+
which <program-name>
|
| 87 |
+
ls -la $(which <program-name>)
|
| 88 |
+
```
|
| 89 |
+
- Version information: `<program-name> --version`
|
| 90 |
+
|
| 91 |
+
9. **Check for recent system changes:**
|
| 92 |
+
- Recent package updates: `grep " install \| upgrade " /var/log/dpkg.log | tail -50`
|
| 93 |
+
- Recent system updates: `grep "upgrade" /var/log/apt/history.log | tail -20`
|
| 94 |
+
- Kernel changes: `ls -lt /boot/vmlinuz-*`
|
| 95 |
+
|
| 96 |
+
10. **Graphics/display-related crashes:**
|
| 97 |
+
If GUI application:
|
| 98 |
+
- X server errors: `grep -i "error\|segfault" /var/log/Xorg.0.log`
|
| 99 |
+
- Wayland compositor logs: `journalctl -b | grep -i "kwin\|wayland"`
|
| 100 |
+
- GPU issues:
|
| 101 |
+
```bash
|
| 102 |
+
nvidia-smi # for NVIDIA
|
| 103 |
+
dmesg | grep -i "gpu\|nvidia\|amdgpu\|radeon"
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
11. **Check for known issues:**
|
| 107 |
+
- Search package bug tracker: `ubuntu-bug --package <package-name>`
|
| 108 |
+
- Check if issue is reproducible
|
| 109 |
+
- Check program's GitHub issues (if applicable)
|
| 110 |
+
|
| 111 |
+
12. **Analyze crash signatures:**
|
| 112 |
+
Look for common crash indicators:
|
| 113 |
+
- **Segmentation fault (SIGSEGV)**: Memory access violation
|
| 114 |
+
- **SIGABRT**: Program called abort()
|
| 115 |
+
- **SIGILL**: Illegal instruction
|
| 116 |
+
- **SIGBUS**: Bus error
|
| 117 |
+
- **SIGFPE**: Floating point exception
|
| 118 |
+
- **OOM Killer**: Process killed due to out of memory
|
| 119 |
+
- **Stack trace**: If available in logs
|
| 120 |
+
|
| 121 |
+
13. **Try to reproduce the crash:**
|
| 122 |
+
If possible, guide user to:
|
| 123 |
+
- Run program from terminal to see error output:
|
| 124 |
+
```bash
|
| 125 |
+
<program-name> 2>&1 | tee /tmp/program-output.log
|
| 126 |
+
```
|
| 127 |
+
- Run with debug logging (if supported):
|
| 128 |
+
```bash
|
| 129 |
+
<program-name> --debug
|
| 130 |
+
<program-name> --verbose
|
| 131 |
+
```
|
| 132 |
+
- Check environment variables that might affect behavior
|
| 133 |
+
|
| 134 |
+
14. **Report findings:**
|
| 135 |
+
Summarize:
|
| 136 |
+
- Probable cause of crash (if identified)
|
| 137 |
+
- Relevant log entries
|
| 138 |
+
- Any error messages or stack traces found
|
| 139 |
+
- Resource issues if any
|
| 140 |
+
- Recent system changes that might be related
|
| 141 |
+
|
| 142 |
+
15. **Provide recommendations:**
|
| 143 |
+
Based on findings, suggest:
|
| 144 |
+
- **If OOM kill**: Reduce memory usage, close other programs, add more RAM/swap
|
| 145 |
+
- **If segfault**: Check for updates, try reinstalling program, report bug
|
| 146 |
+
- **If dependency issue**: Reinstall program and dependencies
|
| 147 |
+
- **If config issue**: Reset configuration, move config to backup
|
| 148 |
+
- **If disk full**: Free up disk space
|
| 149 |
+
- **If recent update**: Consider downgrading or wait for fix
|
| 150 |
+
- **If reproducible**: Enable debug mode, create bug report with steps
|
| 151 |
+
- **If GPU-related**: Update drivers, check GPU health
|
| 152 |
+
- How to enable better crash reporting (core dumps, apport)
|
| 153 |
+
- Consider running program under debugger (gdb) if user is technical
|
| 154 |
+
|
| 155 |
+
## Important notes:
|
| 156 |
+
- Use sudo for system logs and journal access
|
| 157 |
+
- Times in logs are usually in UTC - account for timezone
|
| 158 |
+
- Be sensitive that crashes can be frustrating for users
|
| 159 |
+
- Some log files can be very large - use grep and tail to filter
|
| 160 |
+
- Core dumps can be very large - ask before extracting
|
| 161 |
+
- Privacy: don't ask to see sensitive information from logs
|
| 162 |
+
- If no obvious cause is found, explain what additional info would help
|
commands/debugging/diagnose-slowdown.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Diagnose System Slowdown
|
| 2 |
+
|
| 3 |
+
You are helping the user diagnose system laginess and performance issues.
|
| 4 |
+
|
| 5 |
+
## Your tasks:
|
| 6 |
+
|
| 7 |
+
1. **Gather initial information:**
|
| 8 |
+
Ask the user:
|
| 9 |
+
- When did the slowdown start?
|
| 10 |
+
- Is it constant or intermittent?
|
| 11 |
+
- What activities trigger it? (startup, specific applications, general use)
|
| 12 |
+
- Any recent changes? (updates, new software, configuration changes)
|
| 13 |
+
|
| 14 |
+
2. **Check current system load:**
|
| 15 |
+
- System load averages: `uptime`
|
| 16 |
+
- Detailed load info: `w`
|
| 17 |
+
- Number of processes: `ps aux | wc -l`
|
| 18 |
+
|
| 19 |
+
3. **CPU analysis:**
|
| 20 |
+
- Real-time CPU usage: `top -b -n 1 | head -20`
|
| 21 |
+
- Per-core CPU usage: `mpstat -P ALL 1 1` (if sysstat installed)
|
| 22 |
+
- Top CPU consumers: `ps aux --sort=-%cpu | head -20`
|
| 23 |
+
- CPU frequency and throttling:
|
| 24 |
+
```bash
|
| 25 |
+
cat /proc/cpuinfo | grep MHz
|
| 26 |
+
sudo cpupower frequency-info # if available
|
| 27 |
+
```
|
| 28 |
+
- Check for thermal throttling:
|
| 29 |
+
```bash
|
| 30 |
+
sensors # if lm-sensors installed
|
| 31 |
+
cat /sys/class/thermal/thermal_zone*/temp
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
4. **Memory analysis:**
|
| 35 |
+
- Memory usage: `free -h`
|
| 36 |
+
- Detailed memory info: `cat /proc/meminfo`
|
| 37 |
+
- Swap usage: `swapon --show`
|
| 38 |
+
- Top memory consumers: `ps aux --sort=-%mem | head -20`
|
| 39 |
+
- Check for memory leaks or runaway processes
|
| 40 |
+
- OOM (Out of Memory) events: `sudo journalctl -k | grep -i "out of memory"`
|
| 41 |
+
|
| 42 |
+
5. **Disk I/O analysis:**
|
| 43 |
+
- Disk usage: `df -h`
|
| 44 |
+
- Inode usage: `df -i`
|
| 45 |
+
- I/O statistics: `iostat -x 1 5` (if sysstat installed)
|
| 46 |
+
- Top I/O processes: `sudo iotop -b -n 1 | head -20` (if iotop installed)
|
| 47 |
+
- Check for high disk wait: `top` and look at `wa` (wait) percentage
|
| 48 |
+
- Disk health: `sudo smartctl -H /dev/sda` (for each drive)
|
| 49 |
+
|
| 50 |
+
6. **Process analysis:**
|
| 51 |
+
- List all running processes: `ps aux`
|
| 52 |
+
- Process tree: `pstree -p`
|
| 53 |
+
- Zombie processes: `ps aux | grep Z`
|
| 54 |
+
- Processes in D state (uninterruptible sleep): `ps aux | grep " D "`
|
| 55 |
+
- Long-running processes: `ps -eo pid,user,start,time,cmd --sort=-time | head -20`
|
| 56 |
+
|
| 57 |
+
7. **Check for system resource contention:**
|
| 58 |
+
- Context switches: `vmstat 1 5`
|
| 59 |
+
- Interrupts: `cat /proc/interrupts`
|
| 60 |
+
- Check if system is swapping heavily: `vmstat 1 5` (look at si/so columns)
|
| 61 |
+
|
| 62 |
+
8. **Network issues (can cause perceived slowness):**
|
| 63 |
+
- Network connections: `ss -s`
|
| 64 |
+
- Active connections: `netstat -tunap | wc -l` or `ss -tunap | wc -l`
|
| 65 |
+
- DNS resolution test: `time nslookup google.com`
|
| 66 |
+
- Check for network errors: `ip -s link`
|
| 67 |
+
|
| 68 |
+
9. **Graphics/Desktop environment (for GUI slowness):**
|
| 69 |
+
- Check X server or Wayland compositor CPU usage
|
| 70 |
+
- GPU usage (if nvidia): `nvidia-smi` or `watch -n 1 nvidia-smi`
|
| 71 |
+
- For AMD: `radeontop` (if installed)
|
| 72 |
+
- Check compositor settings (KDE Plasma on Wayland)
|
| 73 |
+
- Desktop effects CPU usage
|
| 74 |
+
|
| 75 |
+
10. **Check system logs for errors:**
|
| 76 |
+
- Recent errors: `sudo journalctl -p err -b`
|
| 77 |
+
- Kernel messages: `dmesg | tail -50`
|
| 78 |
+
- System log: `sudo journalctl -xe --no-pager | tail -100`
|
| 79 |
+
- Look for specific issues:
|
| 80 |
+
- Hardware errors
|
| 81 |
+
- Driver issues
|
| 82 |
+
- Service failures
|
| 83 |
+
- Filesystem errors
|
| 84 |
+
|
| 85 |
+
11. **Check for background services/processes:**
|
| 86 |
+
- List all services: `systemctl list-units --type=service --state=running`
|
| 87 |
+
- Failed services: `systemctl --failed`
|
| 88 |
+
- Check for update managers, indexing services (updatedb, baloo, tracker)
|
| 89 |
+
- Snap services: `snap list` and check for snap updates
|
| 90 |
+
- Flatpak: `flatpak list`
|
| 91 |
+
|
| 92 |
+
12. **Application-specific checks:**
|
| 93 |
+
If slowness is application-specific:
|
| 94 |
+
- Browser: check extensions, tabs, cache size
|
| 95 |
+
- Database: check for long-running queries
|
| 96 |
+
- IDE: check for indexing, plugins
|
| 97 |
+
- Check application logs: `~/.local/share/applications/` or specific app log locations
|
| 98 |
+
|
| 99 |
+
13. **Historical data (if available):**
|
| 100 |
+
- Check sar data: `sar -u` (if sysstat/sar configured)
|
| 101 |
+
- Check historical logs: `sudo journalctl --since "1 day ago" -p err`
|
| 102 |
+
|
| 103 |
+
14. **Analyze and report findings:**
|
| 104 |
+
Categorize issues found:
|
| 105 |
+
- **CPU bottleneck**: High CPU usage, identify culprit processes
|
| 106 |
+
- **Memory bottleneck**: High memory usage, swapping, suggest adding RAM or killing processes
|
| 107 |
+
- **Disk I/O bottleneck**: High wait times, slow disk, suggest SSD upgrade or I/O optimization
|
| 108 |
+
- **Thermal throttling**: High temperatures causing CPU slowdown
|
| 109 |
+
- **Runaway processes**: Specific process consuming excessive resources
|
| 110 |
+
- **Resource leaks**: Memory or handle leaks in specific applications
|
| 111 |
+
- **Background tasks**: Indexing, updates, backups running
|
| 112 |
+
- **Network issues**: DNS problems, slow network affecting system
|
| 113 |
+
|
| 114 |
+
15. **Provide recommendations:**
|
| 115 |
+
Based on findings, suggest:
|
| 116 |
+
- Kill or restart specific problematic processes
|
| 117 |
+
- Disable unnecessary services
|
| 118 |
+
- Adjust swappiness: `sudo sysctl vm.swappiness=10`
|
| 119 |
+
- Clean up disk space if low
|
| 120 |
+
- Update or reinstall problematic drivers
|
| 121 |
+
- Install missing performance tools (sysstat, iotop, htop)
|
| 122 |
+
- Schedule resource-intensive tasks for off-hours
|
| 123 |
+
- Hardware upgrades (RAM, SSD) if appropriate
|
| 124 |
+
- Investigate and fix application-specific issues
|
| 125 |
+
- Check for and apply system updates
|
| 126 |
+
- Reboot if system has been up for extended period with memory leaks
|
| 127 |
+
|
| 128 |
+
## Important notes:
|
| 129 |
+
- Install missing diagnostic tools if needed (sysstat, iotop, htop, lm-sensors)
|
| 130 |
+
- Use sudo for system-level diagnostics
|
| 131 |
+
- Be systematic - check CPU, memory, disk, and network in order
|
| 132 |
+
- Correlate findings with user's description of when slowness occurs
|
| 133 |
+
- Don't immediately kill processes - confirm with user first
|
| 134 |
+
- Consider both hardware and software causes
|
commands/debugging/failed-boot-services.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
During the boot process, I noticed that several services failed
|
| 2 |
+
|
| 3 |
+
Please review the logs to identify which those were and remediate:
|
| 4 |
+
|
| 5 |
+
- If they can fixed, fix them
|
| 6 |
+
- If they refer to old processes, remove them
|
| 7 |
+
- If you are not sure, ask
|
commands/debugging/review-boot.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Review system boot process and identify issues.
|
| 2 |
+
|
| 3 |
+
Your task:
|
| 4 |
+
1. Scan boot messages and journal logs:
|
| 5 |
+
```bash
|
| 6 |
+
journalctl -b # Current boot
|
| 7 |
+
journalctl -b -1 # Previous boot
|
| 8 |
+
```
|
| 9 |
+
|
| 10 |
+
2. Identify issues:
|
| 11 |
+
- Failed services
|
| 12 |
+
- Error messages
|
| 13 |
+
- Warnings
|
| 14 |
+
- Slow-starting services
|
| 15 |
+
- Dependency problems
|
| 16 |
+
|
| 17 |
+
3. Analyze boot performance:
|
| 18 |
+
```bash
|
| 19 |
+
systemd-analyze # Overall boot time
|
| 20 |
+
systemd-analyze blame # Time per service
|
| 21 |
+
systemd-analyze critical-chain # Critical path
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
4. Suggest remediation:
|
| 25 |
+
- Fix failed services
|
| 26 |
+
- Disable unnecessary services
|
| 27 |
+
- Resolve dependency issues
|
| 28 |
+
- Optimize slow services
|
| 29 |
+
|
| 30 |
+
5. Provide actionable recommendations:
|
| 31 |
+
- Commands to investigate specific issues
|
| 32 |
+
- Configuration changes needed
|
| 33 |
+
- Services to disable or reconfigure
|
| 34 |
+
- Further diagnostic steps
|
| 35 |
+
|
| 36 |
+
Proactively identify and suggest fixes for boot-time issues.
|
commands/dev-tools/node/node-version-check.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Check which version of node I have installed on this computer.
|
commands/dev-tools/node/npm-install.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Install Node Package Manager (npm).
|
commands/dev-tools/optimize-vscode-installation.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Evaluate VS Code installation and suggest optimizations like repo source changes
|
| 3 |
+
tags: [vscode, development, optimization, configuration, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user optimize their VS Code installation.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check how VS Code is installed**
|
| 11 |
+
```bash
|
| 12 |
+
which code
|
| 13 |
+
dpkg -l | grep code
|
| 14 |
+
snap list | grep code
|
| 15 |
+
flatpak list | grep code
|
| 16 |
+
```
|
| 17 |
+
- Identify installation method: apt, snap, flatpak, manual
|
| 18 |
+
|
| 19 |
+
2. **Check VS Code version**
|
| 20 |
+
```bash
|
| 21 |
+
code --version
|
| 22 |
+
```
|
| 23 |
+
- Compare with latest version
|
| 24 |
+
- Check if updates are available
|
| 25 |
+
|
| 26 |
+
3. **Evaluate current installation method**
|
| 27 |
+
|
| 28 |
+
**APT (official repo) - Recommended:**
|
| 29 |
+
- Pros: Native integration, automatic updates, best performance
|
| 30 |
+
- Cons: Requires adding Microsoft repo
|
| 31 |
+
|
| 32 |
+
**Snap:**
|
| 33 |
+
- Pros: Easy install, sandboxed
|
| 34 |
+
- Cons: Slower startup, snap overhead, potential issues with extensions
|
| 35 |
+
|
| 36 |
+
**Flatpak:**
|
| 37 |
+
- Pros: Sandboxed, cross-distro
|
| 38 |
+
- Cons: Some filesystem access limitations
|
| 39 |
+
|
| 40 |
+
**Manual .deb:**
|
| 41 |
+
- Pros: Control over updates
|
| 42 |
+
- Cons: Manual update process
|
| 43 |
+
|
| 44 |
+
4. **Suggest migration if needed**
|
| 45 |
+
|
| 46 |
+
**If installed via Snap, suggest migrating to APT:**
|
| 47 |
+
```bash
|
| 48 |
+
# Remove snap version
|
| 49 |
+
sudo snap remove code
|
| 50 |
+
|
| 51 |
+
# Add official Microsoft repo
|
| 52 |
+
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
|
| 53 |
+
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
|
| 54 |
+
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
|
| 55 |
+
|
| 56 |
+
# Install via apt
|
| 57 |
+
sudo apt update && sudo apt install code
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
**If privacy-conscious, suggest VSCodium:**
|
| 61 |
+
```bash
|
| 62 |
+
flatpak install flathub com.vscodium.codium
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
5. **Check VS Code configuration**
|
| 66 |
+
- Review settings: `~/.config/Code/User/settings.json`
|
| 67 |
+
- Check for optimization opportunities:
|
| 68 |
+
- Telemetry settings
|
| 69 |
+
- Auto-save
|
| 70 |
+
- File watcher limits
|
| 71 |
+
- Extension recommendations
|
| 72 |
+
|
| 73 |
+
6. **Optimize performance settings**
|
| 74 |
+
Suggest adding to settings.json:
|
| 75 |
+
```json
|
| 76 |
+
{
|
| 77 |
+
"files.watcherExclude": {
|
| 78 |
+
"**/.git/objects/**": true,
|
| 79 |
+
"**/node_modules/**": true,
|
| 80 |
+
"**/.venv/**": true
|
| 81 |
+
},
|
| 82 |
+
"files.exclude": {
|
| 83 |
+
"**/__pycache__": true,
|
| 84 |
+
"**/.pytest_cache": true
|
| 85 |
+
},
|
| 86 |
+
"search.exclude": {
|
| 87 |
+
"**/node_modules": true,
|
| 88 |
+
"**/venv": true
|
| 89 |
+
},
|
| 90 |
+
"telemetry.telemetryLevel": "off"
|
| 91 |
+
}
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
7. **Check installed extensions**
|
| 95 |
+
```bash
|
| 96 |
+
code --list-extensions
|
| 97 |
+
```
|
| 98 |
+
- Identify potentially redundant extensions
|
| 99 |
+
- Suggest disabling unused extensions for performance
|
| 100 |
+
|
| 101 |
+
8. **Suggest useful extensions**
|
| 102 |
+
- Based on detected project types
|
| 103 |
+
- Common useful extensions:
|
| 104 |
+
- GitLens
|
| 105 |
+
- Prettier
|
| 106 |
+
- ESLint/Pylint
|
| 107 |
+
- Docker
|
| 108 |
+
- Remote-SSH
|
| 109 |
+
- Live Server (web dev)
|
| 110 |
+
|
| 111 |
+
9. **Check for conflicts**
|
| 112 |
+
- Multiple VS Code installations
|
| 113 |
+
- Conflicting extensions
|
| 114 |
+
- Settings sync issues
|
| 115 |
+
|
| 116 |
+
10. **Create backup of settings**
|
| 117 |
+
- Offer to backup:
|
| 118 |
+
- `~/.config/Code/User/settings.json`
|
| 119 |
+
- `~/.config/Code/User/keybindings.json`
|
| 120 |
+
- Extension list
|
| 121 |
+
|
| 122 |
+
## Output
|
| 123 |
+
|
| 124 |
+
Provide a report showing:
|
| 125 |
+
- Current installation method and version
|
| 126 |
+
- Recommended installation method
|
| 127 |
+
- Migration steps (if applicable)
|
| 128 |
+
- Performance optimization suggestions
|
| 129 |
+
- Extension recommendations
|
| 130 |
+
- Configuration backup status
|
| 131 |
+
- Next steps
|
commands/dev-tools/sdk-check.md
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Check which development SDKs I have installed on my computer.
|
| 2 |
+
Start with identifying what's on path. Then see what I might have elsewhere on the filesystem.
|
commands/dev-tools/setup-docker.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Check and Setup Docker
|
| 2 |
+
|
| 3 |
+
You are helping the user check if Docker is configured and set it up if needed.
|
| 4 |
+
|
| 5 |
+
## Your tasks:
|
| 6 |
+
|
| 7 |
+
1. **Check if Docker is already installed:**
|
| 8 |
+
- Check Docker: `docker --version`
|
| 9 |
+
- Check Docker Compose: `docker-compose --version` or `docker compose version`
|
| 10 |
+
- Check Docker service: `systemctl status docker`
|
| 11 |
+
|
| 12 |
+
2. **If Docker is installed, verify configuration:**
|
| 13 |
+
- Check Docker info: `docker info`
|
| 14 |
+
- Check user can run Docker: `docker ps`
|
| 15 |
+
- If permission denied, user needs to be added to docker group
|
| 16 |
+
- Check Docker storage driver and location
|
| 17 |
+
- Check Docker network configuration
|
| 18 |
+
|
| 19 |
+
3. **If Docker is NOT installed, proceed with installation:**
|
| 20 |
+
|
| 21 |
+
**Remove old versions:**
|
| 22 |
+
```bash
|
| 23 |
+
sudo apt-get remove docker docker-engine docker.io containerd runc
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
**Update and install prerequisites:**
|
| 27 |
+
```bash
|
| 28 |
+
sudo apt-get update
|
| 29 |
+
sudo apt-get install ca-certificates curl gnupg lsb-release
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
**Add Docker's official GPG key:**
|
| 33 |
+
```bash
|
| 34 |
+
sudo mkdir -p /etc/apt/keyrings
|
| 35 |
+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
**Set up repository:**
|
| 39 |
+
```bash
|
| 40 |
+
echo \
|
| 41 |
+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
| 42 |
+
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
**Install Docker Engine:**
|
| 46 |
+
```bash
|
| 47 |
+
sudo apt-get update
|
| 48 |
+
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
4. **Post-installation setup:**
|
| 52 |
+
|
| 53 |
+
**Enable Docker service:**
|
| 54 |
+
```bash
|
| 55 |
+
sudo systemctl enable docker
|
| 56 |
+
sudo systemctl start docker
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
**Add user to docker group:**
|
| 60 |
+
```bash
|
| 61 |
+
sudo usermod -aG docker $USER
|
| 62 |
+
```
|
| 63 |
+
Then log out and back in, or run: `newgrp docker`
|
| 64 |
+
|
| 65 |
+
5. **Verify Docker installation:**
|
| 66 |
+
```bash
|
| 67 |
+
docker --version
|
| 68 |
+
docker run hello-world
|
| 69 |
+
docker ps
|
| 70 |
+
docker images
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
6. **Install Docker Compose (if not included):**
|
| 74 |
+
Modern Docker includes Compose v2 as a plugin.
|
| 75 |
+
Check: `docker compose version`
|
| 76 |
+
|
| 77 |
+
If needed, install standalone:
|
| 78 |
+
```bash
|
| 79 |
+
sudo apt-get install docker-compose-plugin
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
7. **Configure Docker daemon (optional):**
|
| 83 |
+
Edit `/etc/docker/daemon.json`:
|
| 84 |
+
|
| 85 |
+
```json
|
| 86 |
+
{
|
| 87 |
+
"log-driver": "json-file",
|
| 88 |
+
"log-opts": {
|
| 89 |
+
"max-size": "10m",
|
| 90 |
+
"max-file": "3"
|
| 91 |
+
},
|
| 92 |
+
"storage-driver": "overlay2",
|
| 93 |
+
"dns": ["8.8.8.8", "8.8.4.4"]
|
| 94 |
+
}
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
Then restart: `sudo systemctl restart docker`
|
| 98 |
+
|
| 99 |
+
8. **Check Docker storage location:**
|
| 100 |
+
```bash
|
| 101 |
+
docker info | grep "Docker Root Dir"
|
| 102 |
+
sudo du -sh /var/lib/docker
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
If storage is on a small partition, consider changing location.
|
| 106 |
+
|
| 107 |
+
9. **Configure storage location (if needed):**
|
| 108 |
+
In `/etc/docker/daemon.json`:
|
| 109 |
+
```json
|
| 110 |
+
{
|
| 111 |
+
"data-root": "/new/path/to/docker"
|
| 112 |
+
}
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
Then:
|
| 116 |
+
```bash
|
| 117 |
+
sudo systemctl stop docker
|
| 118 |
+
sudo mv /var/lib/docker /new/path/to/docker
|
| 119 |
+
sudo systemctl start docker
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
10. **Set up Docker networking:**
|
| 123 |
+
Check networks:
|
| 124 |
+
```bash
|
| 125 |
+
docker network ls
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
Create custom networks if needed:
|
| 129 |
+
```bash
|
| 130 |
+
docker network create my-network
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
11. **Configure resource limits (optional):**
|
| 134 |
+
For laptops/desktops, may want to limit resources:
|
| 135 |
+
In `/etc/docker/daemon.json`:
|
| 136 |
+
```json
|
| 137 |
+
{
|
| 138 |
+
"default-ulimits": {
|
| 139 |
+
"nofile": {
|
| 140 |
+
"Name": "nofile",
|
| 141 |
+
"Hard": 64000,
|
| 142 |
+
"Soft": 64000
|
| 143 |
+
}
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
12. **Set up Docker Hub authentication (optional):**
|
| 149 |
+
```bash
|
| 150 |
+
docker login
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
13. **Test Docker functionality:**
|
| 154 |
+
Run various test commands:
|
| 155 |
+
```bash
|
| 156 |
+
docker run hello-world
|
| 157 |
+
docker run -it ubuntu bash
|
| 158 |
+
docker ps -a
|
| 159 |
+
docker images
|
| 160 |
+
docker system info
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
14. **Install useful Docker tools (optional):**
|
| 164 |
+
Ask user if they want:
|
| 165 |
+
- **Portainer** (Docker management UI)
|
| 166 |
+
- **ctop** (Container monitoring)
|
| 167 |
+
- **lazydocker** (Terminal UI for Docker)
|
| 168 |
+
|
| 169 |
+
```bash
|
| 170 |
+
# ctop
|
| 171 |
+
sudo wget -O /usr/local/bin/ctop https://github.com/bcicen/ctop/releases/download/v0.7.7/ctop-0.7.7-linux-amd64
|
| 172 |
+
sudo chmod +x /usr/local/bin/ctop
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
15. **Configure Docker logging:**
|
| 176 |
+
Check current logging:
|
| 177 |
+
```bash
|
| 178 |
+
docker info | grep "Logging Driver"
|
| 179 |
+
```
|
| 180 |
+
|
| 181 |
+
Configure in `/etc/docker/daemon.json`:
|
| 182 |
+
```json
|
| 183 |
+
{
|
| 184 |
+
"log-driver": "json-file",
|
| 185 |
+
"log-opts": {
|
| 186 |
+
"max-size": "10m",
|
| 187 |
+
"max-file": "5",
|
| 188 |
+
"labels": "production"
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
16. **Set up Docker cleanup:**
|
| 194 |
+
Suggest adding to crontab:
|
| 195 |
+
```bash
|
| 196 |
+
# Clean up unused containers, images, networks weekly
|
| 197 |
+
0 3 * * 0 docker system prune -af --volumes
|
| 198 |
+
```
|
| 199 |
+
|
| 200 |
+
Or show manual cleanup:
|
| 201 |
+
```bash
|
| 202 |
+
docker system prune -a
|
| 203 |
+
docker volume prune
|
| 204 |
+
docker network prune
|
| 205 |
+
```
|
| 206 |
+
|
| 207 |
+
17. **Check for common issues:**
|
| 208 |
+
- Docker daemon not running: `sudo systemctl start docker`
|
| 209 |
+
- Permission denied: `sudo usermod -aG docker $USER` and re-login
|
| 210 |
+
- Storage full: `docker system df` and cleanup
|
| 211 |
+
- Network issues: Check DNS in daemon.json
|
| 212 |
+
- Firewall blocking: Check ufw/iptables
|
| 213 |
+
|
| 214 |
+
18. **Provide best practices:**
|
| 215 |
+
- Don't run containers as root when possible
|
| 216 |
+
- Use Docker Compose for multi-container apps
|
| 217 |
+
- Tag images properly
|
| 218 |
+
- Clean up regularly with `docker system prune`
|
| 219 |
+
- Use .dockerignore files
|
| 220 |
+
- Monitor disk usage: `docker system df`
|
| 221 |
+
- Use specific image tags, not `latest`
|
| 222 |
+
- Scan images for vulnerabilities: `docker scan <image>`
|
| 223 |
+
- Keep Docker updated
|
| 224 |
+
- Use multi-stage builds to reduce image size
|
| 225 |
+
- Limit container resources in production
|
| 226 |
+
|
| 227 |
+
19. **Show basic Docker commands:**
|
| 228 |
+
- `docker run <image>` - Run a container
|
| 229 |
+
- `docker ps` - List running containers
|
| 230 |
+
- `docker ps -a` - List all containers
|
| 231 |
+
- `docker images` - List images
|
| 232 |
+
- `docker pull <image>` - Pull an image
|
| 233 |
+
- `docker build -t <name> .` - Build an image
|
| 234 |
+
- `docker exec -it <container> bash` - Enter container
|
| 235 |
+
- `docker logs <container>` - View logs
|
| 236 |
+
- `docker stop <container>` - Stop container
|
| 237 |
+
- `docker rm <container>` - Remove container
|
| 238 |
+
- `docker rmi <image>` - Remove image
|
| 239 |
+
- `docker compose up` - Start compose stack
|
| 240 |
+
- `docker system prune` - Clean up
|
| 241 |
+
|
| 242 |
+
20. **Report findings:**
|
| 243 |
+
Summarize:
|
| 244 |
+
- Docker installation status
|
| 245 |
+
- Version information
|
| 246 |
+
- User permissions status
|
| 247 |
+
- Storage configuration
|
| 248 |
+
- Service status
|
| 249 |
+
- Any issues found
|
| 250 |
+
|
| 251 |
+
## Important notes:
|
| 252 |
+
- User must log out and back in after being added to docker group
|
| 253 |
+
- Docker can use significant disk space - monitor it
|
| 254 |
+
- Don't run untrusted images
|
| 255 |
+
- Docker Desktop is different from Docker Engine (we're installing Engine)
|
| 256 |
+
- Rootless Docker is available for better security but more complex
|
| 257 |
+
- Docker Compose v2 is now a plugin (`docker compose` not `docker-compose`)
|
| 258 |
+
- Keep Docker updated for security patches
|
commands/dev-tools/suggest-ides.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Suggest IDEs the user may wish to install
|
| 3 |
+
tags: [development, ide, editors, tools, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user identify useful IDEs and code editors to install.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Check currently installed editors/IDEs**
|
| 11 |
+
```bash
|
| 12 |
+
which code vim nvim nano emacs gedit kate
|
| 13 |
+
dpkg -l | grep -E "code|editor|ide"
|
| 14 |
+
flatpak list | grep -E "code|editor|ide"
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
2. **Identify user's programming needs**
|
| 18 |
+
- Ask about programming languages used:
|
| 19 |
+
- Python
|
| 20 |
+
- JavaScript/TypeScript
|
| 21 |
+
- Java/Kotlin
|
| 22 |
+
- C/C++/Rust
|
| 23 |
+
- Go
|
| 24 |
+
- Web development
|
| 25 |
+
- Data science
|
| 26 |
+
- Mobile development
|
| 27 |
+
|
| 28 |
+
3. **Suggest IDEs by category**
|
| 29 |
+
|
| 30 |
+
**General Purpose (recommended):**
|
| 31 |
+
- **VS Code** - Most popular, extensive plugins
|
| 32 |
+
- **VSCodium** - VS Code without telemetry
|
| 33 |
+
- **JetBrains Fleet** - Modern, lightweight
|
| 34 |
+
- **Sublime Text** - Fast, elegant
|
| 35 |
+
- **Atom** (deprecated, suggest alternatives)
|
| 36 |
+
|
| 37 |
+
**Language-Specific:**
|
| 38 |
+
- **PyCharm** - Python (Community/Professional)
|
| 39 |
+
- **IntelliJ IDEA** - Java/Kotlin
|
| 40 |
+
- **WebStorm** - JavaScript/TypeScript
|
| 41 |
+
- **RustRover** - Rust
|
| 42 |
+
- **GoLand** - Go
|
| 43 |
+
- **Android Studio** - Android development
|
| 44 |
+
|
| 45 |
+
**Lightweight Editors:**
|
| 46 |
+
- **Neovim** - Modern Vim
|
| 47 |
+
- **Helix** - Modern modal editor
|
| 48 |
+
- **Micro** - Terminal editor, easy to use
|
| 49 |
+
- **Geany** - GTK editor with IDE features
|
| 50 |
+
|
| 51 |
+
**Data Science:**
|
| 52 |
+
- **JupyterLab** - Notebooks
|
| 53 |
+
- **RStudio** - R development
|
| 54 |
+
- **Spyder** - Python for scientific computing
|
| 55 |
+
|
| 56 |
+
**Web Development:**
|
| 57 |
+
- **Zed** - Collaborative, fast
|
| 58 |
+
- **Brackets** - Live preview
|
| 59 |
+
|
| 60 |
+
4. **Installation methods**
|
| 61 |
+
|
| 62 |
+
**VS Code:**
|
| 63 |
+
```bash
|
| 64 |
+
# Official repo
|
| 65 |
+
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
|
| 66 |
+
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
|
| 67 |
+
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
|
| 68 |
+
sudo apt update && sudo apt install code
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
**VSCodium:**
|
| 72 |
+
```bash
|
| 73 |
+
flatpak install flathub com.vscodium.codium
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
**JetBrains Toolbox:**
|
| 77 |
+
```bash
|
| 78 |
+
# Download from jetbrains.com/toolbox/
|
| 79 |
+
# Or use snap: snap install jetbrains-toolbox --classic
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
**Neovim:**
|
| 83 |
+
```bash
|
| 84 |
+
sudo apt install neovim
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
5. **Suggest based on current setup**
|
| 88 |
+
- If Python user: Suggest PyCharm
|
| 89 |
+
- If web dev: Suggest VS Code with extensions
|
| 90 |
+
- If systems programming: Suggest Neovim with LSP
|
| 91 |
+
- If prefer FOSS: Suggest VSCodium
|
| 92 |
+
|
| 93 |
+
6. **Recommend extensions/plugins**
|
| 94 |
+
- For VS Code/VSCodium:
|
| 95 |
+
- Python
|
| 96 |
+
- Pylance
|
| 97 |
+
- GitLens
|
| 98 |
+
- Docker
|
| 99 |
+
- Remote SSH
|
| 100 |
+
- Prettier
|
| 101 |
+
- ESLint
|
| 102 |
+
|
| 103 |
+
7. **Alternative: Check installed editors quality**
|
| 104 |
+
- Vim/Neovim configuration quality
|
| 105 |
+
- VS Code extension count
|
| 106 |
+
- Suggest improvements to existing setup
|
| 107 |
+
|
| 108 |
+
## Output
|
| 109 |
+
|
| 110 |
+
Provide a report showing:
|
| 111 |
+
- Currently installed editors/IDEs
|
| 112 |
+
- Recommended IDEs based on user's needs
|
| 113 |
+
- Installation commands for suggestions
|
| 114 |
+
- Extension/plugin recommendations
|
| 115 |
+
- Comparison of options (pros/cons)
|
commands/dev-tools/yadm/check-yadm.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Check YADM Status
|
| 2 |
+
|
| 3 |
+
You are helping the user check the status of their YADM (Yet Another Dotfiles Manager) repository.
|
| 4 |
+
|
| 5 |
+
## Task
|
| 6 |
+
|
| 7 |
+
1. Check which files YADM is currently tracking:
|
| 8 |
+
```bash
|
| 9 |
+
yadm list -a
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
2. Show the current repository status (modified, staged, untracked files):
|
| 13 |
+
```bash
|
| 14 |
+
yadm status
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
3. Show recent commit history (last 10 commits):
|
| 18 |
+
```bash
|
| 19 |
+
yadm log --oneline -10
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
4. Check if there are any unpushed commits:
|
| 23 |
+
```bash
|
| 24 |
+
yadm log origin/main..HEAD --oneline
|
| 25 |
+
```
|
| 26 |
+
(Note: Replace 'main' with the actual branch name if different, e.g., 'master')
|
| 27 |
+
|
| 28 |
+
5. Show which remote repository YADM is connected to:
|
| 29 |
+
```bash
|
| 30 |
+
yadm remote -v
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
6. Summarize the findings for the user:
|
| 34 |
+
- Total number of tracked files
|
| 35 |
+
- Any uncommitted changes
|
| 36 |
+
- Any unpushed commits
|
| 37 |
+
- Current branch
|
| 38 |
+
- Remote repository location
|
| 39 |
+
|
| 40 |
+
## Additional Checks (Optional)
|
| 41 |
+
|
| 42 |
+
If requested, you can also:
|
| 43 |
+
- Show files that have been modified: `yadm diff --name-only`
|
| 44 |
+
- Check for files that should be tracked but aren't: Look for common dotfiles in the home directory
|
| 45 |
+
- Verify the YADM repository is healthy: `yadm fsck`
|
| 46 |
+
|
| 47 |
+
## Notes
|
| 48 |
+
|
| 49 |
+
- YADM is a wrapper around git specifically for managing dotfiles
|
| 50 |
+
- All git commands work with yadm by replacing 'git' with 'yadm'
|
| 51 |
+
- The YADM repository is stored in `~/.local/share/yadm/repo.git`
|
commands/dev-tools/yadm/manually-update-yadm.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Manually Update YADM
|
| 2 |
+
|
| 3 |
+
You are helping the user manually update their YADM (Yet Another Dotfiles Manager) repository.
|
| 4 |
+
|
| 5 |
+
## Task
|
| 6 |
+
|
| 7 |
+
1. First, check the current status of the YADM repository:
|
| 8 |
+
```bash
|
| 9 |
+
yadm status
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
2. Show the user what files have been modified:
|
| 13 |
+
```bash
|
| 14 |
+
yadm diff
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
3. Ask the user which files they want to add to the commit. If they want to add all changes, use:
|
| 18 |
+
```bash
|
| 19 |
+
yadm add -u
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
Or for specific files:
|
| 23 |
+
```bash
|
| 24 |
+
yadm add <file1> <file2> ...
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
4. Show the staged changes:
|
| 28 |
+
```bash
|
| 29 |
+
yadm status
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
5. Ask the user for a commit message, then create the commit:
|
| 33 |
+
```bash
|
| 34 |
+
yadm commit -m "user's commit message"
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
6. Push the changes to the remote repository:
|
| 38 |
+
```bash
|
| 39 |
+
yadm push
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
7. Confirm the update was successful and show the final status.
|
| 43 |
+
|
| 44 |
+
## Notes
|
| 45 |
+
|
| 46 |
+
- YADM works exactly like git but is specifically for dotfiles
|
| 47 |
+
- Be careful not to commit sensitive information like API keys or passwords
|
| 48 |
+
- If the user has a pre-commit hook or other git hooks configured, they will run automatically
|
| 49 |
+
- If there are conflicts or issues, guide the user through resolving them
|
commands/display/list-connected-displays.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# List Connected Displays
|
| 2 |
+
|
| 3 |
+
You are helping the user identify all connected displays and their current configurations.
|
| 4 |
+
|
| 5 |
+
## Task
|
| 6 |
+
|
| 7 |
+
1. **Detect display server** (Wayland vs X11):
|
| 8 |
+
```bash
|
| 9 |
+
echo $XDG_SESSION_TYPE
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
2. **For Wayland systems:**
|
| 13 |
+
```bash
|
| 14 |
+
# Using kscreen-doctor (KDE)
|
| 15 |
+
kscreen-doctor -o
|
| 16 |
+
|
| 17 |
+
# Using wlr-randr (wlroots-based compositors)
|
| 18 |
+
wlr-randr
|
| 19 |
+
|
| 20 |
+
# Using gnome-randr (GNOME)
|
| 21 |
+
gnome-randr
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
3. **For X11 systems:**
|
| 25 |
+
```bash
|
| 26 |
+
xrandr --query
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
4. **Get detailed information:**
|
| 30 |
+
```bash
|
| 31 |
+
# List all display devices
|
| 32 |
+
ls /sys/class/drm/card*/card*/status
|
| 33 |
+
|
| 34 |
+
# Check connected displays
|
| 35 |
+
for p in /sys/class/drm/card*/card*/status; do
|
| 36 |
+
echo "$(dirname $p): $(cat $p)"
|
| 37 |
+
done
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
5. **Show current resolution and refresh rate:**
|
| 41 |
+
```bash
|
| 42 |
+
# X11
|
| 43 |
+
xrandr | grep -E "^[^ ]|[0-9]+\.[0-9]+\*"
|
| 44 |
+
|
| 45 |
+
# Wayland (KDE)
|
| 46 |
+
kscreen-doctor -j | jq -r '.outputs[] | "\(.name): \(.currentMode.size.width)x\(.currentMode.size.height)@\(.currentMode.refreshRate)Hz"'
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
## Present to User
|
| 50 |
+
|
| 51 |
+
Summarize the findings:
|
| 52 |
+
- Number of connected displays
|
| 53 |
+
- Display names/identifiers
|
| 54 |
+
- Current resolution and refresh rate for each
|
| 55 |
+
- Primary display
|
| 56 |
+
- Display position/arrangement
|
| 57 |
+
- Whether using Wayland or X11
|
| 58 |
+
|
| 59 |
+
## Additional Information
|
| 60 |
+
|
| 61 |
+
If requested, also show:
|
| 62 |
+
- Supported resolutions and refresh rates
|
| 63 |
+
- Display manufacturer and model (from EDID)
|
| 64 |
+
- Connection type (HDMI, DisplayPort, etc.)
|
| 65 |
+
- Color depth and color space
|
| 66 |
+
|
| 67 |
+
## Notes
|
| 68 |
+
|
| 69 |
+
- Command availability depends on desktop environment and display server
|
| 70 |
+
- KDE Plasma uses kscreen-doctor
|
| 71 |
+
- GNOME may use different tools
|
| 72 |
+
- Some information requires parsing EDID data from `/sys/class/drm/`
|
commands/display/optimize-display-scaling.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Optimize Display Scaling
|
| 2 |
+
|
| 3 |
+
You are helping the user configure HiDPI scaling and fractional scaling for optimal display clarity.
|
| 4 |
+
|
| 5 |
+
## Task
|
| 6 |
+
|
| 7 |
+
1. **Check current display information:**
|
| 8 |
+
```bash
|
| 9 |
+
# Display server type
|
| 10 |
+
echo $XDG_SESSION_TYPE
|
| 11 |
+
|
| 12 |
+
# Current resolution and size
|
| 13 |
+
kscreen-doctor -o # Wayland/KDE
|
| 14 |
+
# OR
|
| 15 |
+
xrandr --query # X11
|
| 16 |
+
|
| 17 |
+
# Calculate DPI
|
| 18 |
+
xdpyinfo | grep -B 2 resolution # X11
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
2. **Determine optimal scaling:**
|
| 22 |
+
- Display resolution
|
| 23 |
+
- Physical size (diagonal in inches)
|
| 24 |
+
- Calculate PPI: `sqrt(width² + height²) / diagonal_inches`
|
| 25 |
+
- Recommended scaling:
|
| 26 |
+
- PPI < 110: 100% (1x)
|
| 27 |
+
- PPI 110-140: 125% (1.25x)
|
| 28 |
+
- PPI 140-180: 150% (1.5x)
|
| 29 |
+
- PPI 180-220: 200% (2x)
|
| 30 |
+
- PPI > 220: 250% or higher
|
| 31 |
+
|
| 32 |
+
3. **For KDE Plasma (Wayland or X11):**
|
| 33 |
+
```bash
|
| 34 |
+
# Set global scale factor (Wayland)
|
| 35 |
+
kscreen-doctor output.DP-1.scale.1.5
|
| 36 |
+
|
| 37 |
+
# Or use GUI
|
| 38 |
+
kcmshell6 kcm_kscreen
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
**Via settings file:**
|
| 42 |
+
```bash
|
| 43 |
+
# Edit KDE scaling
|
| 44 |
+
kwriteconfig6 --file kdeglobals --group KScreen --key ScaleFactor 1.5
|
| 45 |
+
kquitapp6 plasmashell && kstart plasmashell
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
4. **For GNOME (Wayland):**
|
| 49 |
+
```bash
|
| 50 |
+
# Enable fractional scaling
|
| 51 |
+
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
|
| 52 |
+
|
| 53 |
+
# Set scale factor (200% = 2.0)
|
| 54 |
+
gsettings set org.gnome.desktop.interface scaling-factor 2
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
5. **For X11 systems (general):**
|
| 58 |
+
```bash
|
| 59 |
+
# Set Xft DPI
|
| 60 |
+
echo "Xft.dpi: 144" >> ~/.Xresources
|
| 61 |
+
xrdb -merge ~/.Xresources
|
| 62 |
+
|
| 63 |
+
# Set scale factor for Qt applications
|
| 64 |
+
export QT_SCALE_FACTOR=1.5
|
| 65 |
+
|
| 66 |
+
# Set scale factor for GTK applications
|
| 67 |
+
export GDK_SCALE=2
|
| 68 |
+
export GDK_DPI_SCALE=0.5
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
6. **Configure per-application scaling:**
|
| 72 |
+
```bash
|
| 73 |
+
# For specific Qt apps
|
| 74 |
+
QT_SCALE_FACTOR=1.5 application-name
|
| 75 |
+
|
| 76 |
+
# Add to .bashrc or application launcher
|
| 77 |
+
echo 'export QT_SCALE_FACTOR=1.5' >> ~/.bashrc
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
7. **Adjust font DPI:**
|
| 81 |
+
```bash
|
| 82 |
+
# KDE
|
| 83 |
+
kwriteconfig6 --file kcmfonts --group General --key forceFontDPI 144
|
| 84 |
+
|
| 85 |
+
# GNOME
|
| 86 |
+
gsettings set org.gnome.desktop.interface text-scaling-factor 1.25
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
8. **Handle cursor size:**
|
| 90 |
+
```bash
|
| 91 |
+
# Set cursor size
|
| 92 |
+
gsettings set org.gnome.desktop.interface cursor-size 32 # GNOME
|
| 93 |
+
kwriteconfig6 --file kcminputrc --group Mouse --key cursorSize 32 # KDE
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
## Verify Configuration
|
| 97 |
+
|
| 98 |
+
1. **Check current settings:**
|
| 99 |
+
```bash
|
| 100 |
+
echo $QT_SCALE_FACTOR
|
| 101 |
+
echo $GDK_SCALE
|
| 102 |
+
gsettings get org.gnome.desktop.interface scaling-factor # GNOME
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
2. **Test applications:**
|
| 106 |
+
- Open various applications (browser, terminal, file manager)
|
| 107 |
+
- Check text clarity
|
| 108 |
+
- Verify UI element sizes
|
| 109 |
+
- Test both Qt and GTK applications
|
| 110 |
+
|
| 111 |
+
3. **Log out and back in** to apply system-wide changes
|
| 112 |
+
|
| 113 |
+
## Troubleshooting
|
| 114 |
+
|
| 115 |
+
- **Blurry applications:** Some apps don't support fractional scaling on X11
|
| 116 |
+
- **Inconsistent scaling:** Mix of Qt and GTK apps may scale differently
|
| 117 |
+
- **Wayland vs X11:** Wayland generally handles fractional scaling better
|
| 118 |
+
- **XWayland apps:** May appear blurry on Wayland with fractional scaling
|
| 119 |
+
|
| 120 |
+
**Solutions:**
|
| 121 |
+
```bash
|
| 122 |
+
# Force XWayland scaling
|
| 123 |
+
kwriteconfig6 --file kwinrc --group Xwayland --key Scale 1.5
|
| 124 |
+
|
| 125 |
+
# Disable fractional scaling for specific apps
|
| 126 |
+
env QT_SCALE_FACTOR=1 application-name
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
## Notes
|
| 130 |
+
|
| 131 |
+
- Wayland provides better fractional scaling support than X11
|
| 132 |
+
- Some applications may require restart to apply scaling
|
| 133 |
+
- Integer scaling (1x, 2x) is sharper than fractional (1.25x, 1.5x)
|
| 134 |
+
- Consider display distance when choosing scale factor
|
| 135 |
+
- Multi-monitor setups with different DPI may require per-monitor scaling
|
commands/display/setup-multi-monitor.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Setup Multi-Monitor Configuration
|
| 2 |
+
|
| 3 |
+
You are helping the user configure multiple monitors on their Linux desktop.
|
| 4 |
+
|
| 5 |
+
## Task
|
| 6 |
+
|
| 7 |
+
1. **Detect current setup:**
|
| 8 |
+
```bash
|
| 9 |
+
# Check display server type
|
| 10 |
+
echo $XDG_SESSION_TYPE
|
| 11 |
+
|
| 12 |
+
# List connected displays
|
| 13 |
+
kscreen-doctor -o # KDE/Wayland
|
| 14 |
+
# OR
|
| 15 |
+
xrandr --query # X11
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
2. **Ask the user about their desired configuration:**
|
| 19 |
+
- Which display should be primary?
|
| 20 |
+
- How should displays be arranged? (left-of, right-of, above, below, mirrored)
|
| 21 |
+
- What resolution for each display?
|
| 22 |
+
- What refresh rate for each display?
|
| 23 |
+
|
| 24 |
+
3. **For X11 systems using xrandr:**
|
| 25 |
+
```bash
|
| 26 |
+
# Example: Two monitors side by side
|
| 27 |
+
xrandr --output HDMI-1 --mode 1920x1080 --rate 60 \
|
| 28 |
+
--output DP-1 --mode 2560x1440 --rate 144 --right-of HDMI-1 --primary
|
| 29 |
+
|
| 30 |
+
# Example: Mirror displays
|
| 31 |
+
xrandr --output HDMI-1 --mode 1920x1080 \
|
| 32 |
+
--output DP-1 --same-as HDMI-1 --mode 1920x1080
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
4. **For Wayland/KDE systems using kscreen-doctor:**
|
| 36 |
+
```bash
|
| 37 |
+
# Example: Configure displays
|
| 38 |
+
kscreen-doctor output.HDMI-1.mode.1920x1080@60 \
|
| 39 |
+
output.DP-1.mode.2560x1440@144 \
|
| 40 |
+
output.DP-1.position.1920,0 \
|
| 41 |
+
output.DP-1.primary
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
5. **For GNOME (Wayland):**
|
| 45 |
+
```bash
|
| 46 |
+
# Use gnome-control-center or gnome-randr
|
| 47 |
+
gnome-randr modify DP-1 --mode 2560x1440 --rate 144 --primary --pos 1920x0
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
6. **Make configuration persistent:**
|
| 51 |
+
|
| 52 |
+
**X11:**
|
| 53 |
+
- Configuration is typically saved by the desktop environment
|
| 54 |
+
- Can add xrandr commands to `~/.xprofile` or startup scripts
|
| 55 |
+
|
| 56 |
+
**Wayland/KDE:**
|
| 57 |
+
- KDE saves configuration automatically in `~/.local/share/kscreen/`
|
| 58 |
+
|
| 59 |
+
**Create startup script if needed:**
|
| 60 |
+
```bash
|
| 61 |
+
# Create script
|
| 62 |
+
cat > ~/.config/autostart-scripts/monitor-setup.sh << 'EOF'
|
| 63 |
+
#!/bin/bash
|
| 64 |
+
# Monitor setup commands here
|
| 65 |
+
EOF
|
| 66 |
+
|
| 67 |
+
chmod +x ~/.config/autostart-scripts/monitor-setup.sh
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
7. **Test and verify:**
|
| 71 |
+
- Check if all displays are showing correctly
|
| 72 |
+
- Verify resolution and refresh rates
|
| 73 |
+
- Test primary display setting
|
| 74 |
+
- Check display arrangement by moving windows
|
| 75 |
+
|
| 76 |
+
## Troubleshooting
|
| 77 |
+
|
| 78 |
+
If issues occur:
|
| 79 |
+
- Check if displays are detected: `xrandr --listmonitors` or `kscreen-doctor -o`
|
| 80 |
+
- Verify supported modes for each display
|
| 81 |
+
- Try lower refresh rates if displays flicker
|
| 82 |
+
- Check cable connections and quality
|
| 83 |
+
- Look for errors in logs: `journalctl -b | grep -i drm`
|
| 84 |
+
|
| 85 |
+
## Notes
|
| 86 |
+
|
| 87 |
+
- Commands differ significantly between X11 and Wayland
|
| 88 |
+
- Desktop environment may provide GUI tools (System Settings)
|
| 89 |
+
- Some configurations may require restarting the display manager
|
| 90 |
+
- High refresh rates require appropriate cables (DisplayPort 1.4, HDMI 2.1)
|
commands/display/switch-display-profile.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Switch Display Profile
|
| 2 |
+
|
| 3 |
+
You are helping the user switch between different display configurations/profiles (e.g., docked, laptop only, presentation).
|
| 4 |
+
|
| 5 |
+
## Task
|
| 6 |
+
|
| 7 |
+
1. **Check current display setup:**
|
| 8 |
+
```bash
|
| 9 |
+
# Display server type
|
| 10 |
+
echo $XDG_SESSION_TYPE
|
| 11 |
+
|
| 12 |
+
# Connected displays
|
| 13 |
+
kscreen-doctor -o # KDE/Wayland
|
| 14 |
+
# OR
|
| 15 |
+
xrandr --query # X11
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
2. **Ask user which profile they want:**
|
| 19 |
+
- **Laptop only** (internal display only)
|
| 20 |
+
- **Docked** (external monitors only or primary external)
|
| 21 |
+
- **Extended** (laptop + external monitors)
|
| 22 |
+
- **Mirrored** (same output on all displays)
|
| 23 |
+
- **Presentation** (external display as primary)
|
| 24 |
+
- **Custom** (user-defined configuration)
|
| 25 |
+
|
| 26 |
+
3. **KDE Plasma - Use saved profiles:**
|
| 27 |
+
```bash
|
| 28 |
+
# List saved display configurations
|
| 29 |
+
ls ~/.local/share/kscreen/
|
| 30 |
+
|
| 31 |
+
# KDE automatically switches profiles based on connected displays
|
| 32 |
+
# Force reload configuration
|
| 33 |
+
kscreen-doctor --reload
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
4. **Create/Use autorandr (X11):**
|
| 37 |
+
```bash
|
| 38 |
+
# Install if not present
|
| 39 |
+
sudo apt install autorandr
|
| 40 |
+
|
| 41 |
+
# Save current configuration as profile
|
| 42 |
+
autorandr --save profile-name
|
| 43 |
+
|
| 44 |
+
# Switch to saved profile
|
| 45 |
+
autorandr --load profile-name
|
| 46 |
+
|
| 47 |
+
# Auto-detect and load appropriate profile
|
| 48 |
+
autorandr --change
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
5. **Manual X11 configuration examples:**
|
| 52 |
+
|
| 53 |
+
**Laptop only:**
|
| 54 |
+
```bash
|
| 55 |
+
xrandr --output eDP-1 --auto --primary \
|
| 56 |
+
--output HDMI-1 --off \
|
| 57 |
+
--output DP-1 --off
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
**Docked (external monitors only):**
|
| 61 |
+
```bash
|
| 62 |
+
xrandr --output eDP-1 --off \
|
| 63 |
+
--output HDMI-1 --auto --primary \
|
| 64 |
+
--output DP-1 --auto --right-of HDMI-1
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
**Extended (laptop + external):**
|
| 68 |
+
```bash
|
| 69 |
+
xrandr --output eDP-1 --auto \
|
| 70 |
+
--output HDMI-1 --auto --primary --above eDP-1
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
**Mirrored:**
|
| 74 |
+
```bash
|
| 75 |
+
xrandr --output eDP-1 --auto \
|
| 76 |
+
--output HDMI-1 --auto --same-as eDP-1
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
6. **Wayland/KDE configuration:**
|
| 80 |
+
```bash
|
| 81 |
+
# Laptop only
|
| 82 |
+
kscreen-doctor output.eDP-1.enable \
|
| 83 |
+
output.HDMI-1.disable \
|
| 84 |
+
output.DP-1.disable
|
| 85 |
+
|
| 86 |
+
# Docked
|
| 87 |
+
kscreen-doctor output.eDP-1.disable \
|
| 88 |
+
output.HDMI-1.enable output.HDMI-1.primary \
|
| 89 |
+
output.DP-1.enable output.DP-1.position.1920,0
|
| 90 |
+
|
| 91 |
+
# Extended
|
| 92 |
+
kscreen-doctor output.eDP-1.enable \
|
| 93 |
+
output.HDMI-1.enable output.HDMI-1.primary \
|
| 94 |
+
output.HDMI-1.position.0,-1080
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
7. **Create quick-switch scripts:**
|
| 98 |
+
```bash
|
| 99 |
+
# Create scripts directory
|
| 100 |
+
mkdir -p ~/.local/bin/display-profiles
|
| 101 |
+
|
| 102 |
+
# Example: Laptop only script
|
| 103 |
+
cat > ~/.local/bin/display-profiles/laptop-only.sh << 'EOF'
|
| 104 |
+
#!/bin/bash
|
| 105 |
+
xrandr --output eDP-1 --auto --primary \
|
| 106 |
+
--output HDMI-1 --off \
|
| 107 |
+
--output DP-1 --off
|
| 108 |
+
notify-send "Display Profile" "Switched to: Laptop Only"
|
| 109 |
+
EOF
|
| 110 |
+
|
| 111 |
+
chmod +x ~/.local/bin/display-profiles/laptop-only.sh
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
8. **Create keyboard shortcuts (KDE):**
|
| 115 |
+
```bash
|
| 116 |
+
# Add custom shortcut
|
| 117 |
+
kwriteconfig6 --file kglobalshortcutsrc \
|
| 118 |
+
--group "Display Profile - Laptop" \
|
| 119 |
+
--key "_k_friendly_name" "Laptop Display Only"
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
9. **Automatic profile switching with udev:**
|
| 123 |
+
```bash
|
| 124 |
+
# Create udev rule for auto-switching when docking
|
| 125 |
+
sudo tee /etc/udev/rules.d/95-monitor-hotplug.rules << 'EOF'
|
| 126 |
+
ACTION=="change", SUBSYSTEM=="drm", RUN+="/usr/local/bin/display-switch.sh"
|
| 127 |
+
EOF
|
| 128 |
+
|
| 129 |
+
# Create switch script
|
| 130 |
+
sudo tee /usr/local/bin/display-switch.sh << 'EOF'
|
| 131 |
+
#!/bin/bash
|
| 132 |
+
export DISPLAY=:0
|
| 133 |
+
export XAUTHORITY=/home/daniel/.Xauthority
|
| 134 |
+
/usr/bin/autorandr --change
|
| 135 |
+
EOF
|
| 136 |
+
|
| 137 |
+
sudo chmod +x /usr/local/bin/display-switch.sh
|
| 138 |
+
sudo udevadm control --reload-rules
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
## Verify Configuration
|
| 142 |
+
|
| 143 |
+
- Check display arrangement with GUI or commands
|
| 144 |
+
- Test window movement between displays
|
| 145 |
+
- Verify primary display setting
|
| 146 |
+
- Check resolution and refresh rates
|
| 147 |
+
- Test systray/panel positioning
|
| 148 |
+
|
| 149 |
+
## Troubleshooting
|
| 150 |
+
|
| 151 |
+
**Profile not loading:**
|
| 152 |
+
- Verify display names with `xrandr` or `kscreen-doctor -o`
|
| 153 |
+
- Check saved profile files
|
| 154 |
+
- Ensure all referenced displays are connected
|
| 155 |
+
|
| 156 |
+
**Automatic switching not working:**
|
| 157 |
+
- Check udev rule syntax
|
| 158 |
+
- Verify script permissions and paths
|
| 159 |
+
- Check logs: `journalctl -f` while connecting/disconnecting displays
|
| 160 |
+
|
| 161 |
+
**Black screen after switching:**
|
| 162 |
+
- Use Ctrl+Alt+F2 to access TTY
|
| 163 |
+
- Reset display configuration: `xrandr --auto`
|
| 164 |
+
- Restart display manager: `sudo systemctl restart sddm` (or gdm, lightdm)
|
| 165 |
+
|
| 166 |
+
## Notes
|
| 167 |
+
|
| 168 |
+
- autorandr is the most reliable tool for X11 profile management
|
| 169 |
+
- KDE Plasma handles profile switching automatically on Wayland
|
| 170 |
+
- Save profiles for different scenarios (home office, conference room, etc.)
|
| 171 |
+
- Consider using descriptive names for profiles
|
| 172 |
+
- Test profiles before relying on them for important presentations
|
commands/filesystem-organization/chunking/chunk-this-dir.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This folder contains a lot of files.
|
| 2 |
+
|
| 3 |
+
Please chunk them by creating numeric subfolders each containing a specific number of files.
|
| 4 |
+
|
| 5 |
+
I will provide the desired number.
|
commands/filesystem-organization/consolidate-folders.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are helping Daniel consolidate redundant or overlapping folders into a more organized structure.
|
| 2 |
+
|
| 3 |
+
## Your Task
|
| 4 |
+
|
| 5 |
+
1. **Analyze subdirectories**: List all subdirectories in the current working directory
|
| 6 |
+
2. **Identify overlaps**: Look for:
|
| 7 |
+
- Folders with similar names or purposes
|
| 8 |
+
- Folders containing similar types of files
|
| 9 |
+
- Multiple folders that could logically be merged
|
| 10 |
+
- Poorly named folders that could be better organized
|
| 11 |
+
3. **Analyze contents**: For each folder, show:
|
| 12 |
+
- Number of files
|
| 13 |
+
- File types present
|
| 14 |
+
- Apparent purpose based on names and contents
|
| 15 |
+
4. **Propose consolidation plan**: Suggest:
|
| 16 |
+
- Which folders should be merged
|
| 17 |
+
- What the consolidated folder should be named
|
| 18 |
+
- Whether any subfolders should be created within the consolidated folder
|
| 19 |
+
- Any folders that should be renamed for clarity
|
| 20 |
+
5. **Present the plan**: Show Daniel:
|
| 21 |
+
- Current folder structure with file counts
|
| 22 |
+
- Proposed new structure
|
| 23 |
+
- Exactly which folders will be merged and where their contents will go
|
| 24 |
+
6. **Ask for confirmation**: Get Daniel's approval before making any changes
|
| 25 |
+
7. **Execute if approved**:
|
| 26 |
+
- Create new folder structure
|
| 27 |
+
- Move files from old folders to new locations
|
| 28 |
+
- Remove empty old folders
|
| 29 |
+
- Provide a summary of what was done
|
| 30 |
+
|
| 31 |
+
## Guidelines
|
| 32 |
+
|
| 33 |
+
- Look for semantic similarities, not just name matches
|
| 34 |
+
- Consider the logical grouping of content
|
| 35 |
+
- Suggest hierarchical structures where appropriate (parent/child folders)
|
| 36 |
+
- Be conservative - when in doubt, ask rather than assuming
|
| 37 |
+
- Preserve all files - never delete data
|
| 38 |
+
- Suggest meaningful, descriptive folder names
|
| 39 |
+
|
| 40 |
+
## Safety
|
| 41 |
+
|
| 42 |
+
- NEVER delete files, only move them
|
| 43 |
+
- If filename conflicts occur, append numeric suffixes
|
| 44 |
+
- Keep original folders until Daniel confirms they can be removed
|
| 45 |
+
- Ask before proceeding with moves and deletions
|
| 46 |
+
- Provide a detailed log of all changes made
|
commands/filesystem-organization/flatten.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Flatten the folder hierarchy.
|
| 2 |
+
|
| 3 |
+
All the files in the subfolders should be moved to this level in the filesystem.
|
| 4 |
+
|
| 5 |
+
Resolve any filename clashes by appending unique characters.
|
| 6 |
+
|
| 7 |
+
If this directory structure contains media (images or video) then after flattening the hierarchy ask me (the user) if I would like you to run a checksum based check to identify and remove any duplicates.
|
commands/filesystem-organization/separate-by-filetype.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This folder contains media of different formats
|
| 2 |
+
Create subfolders for common media types - for example audio, photos, video
|
| 3 |
+
Move the corresponding files into the relevant folders. E.g. mv *.mp4 -> /video
|
commands/filesystem-organization/separate-photos-and-video.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This folder contains a mixture of photos and video
|
| 2 |
+
|
| 3 |
+
Create subfolders /photos and /videos
|
| 4 |
+
|
| 5 |
+
Move photos into photos and videos into videos
|
commands/filesystem-organization/suggest-folder-structure.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are helping Daniel design an optimal folder structure for a directory before organizing files.
|
| 2 |
+
|
| 3 |
+
## Your Task
|
| 4 |
+
|
| 5 |
+
1. **Analyze the current state**: Examine both files and folders in the current directory
|
| 6 |
+
2. **Understand the content**: Look at:
|
| 7 |
+
- What types of files are present
|
| 8 |
+
- What the files appear to be for (projects, documents, media, etc.)
|
| 9 |
+
- Any existing organizational patterns
|
| 10 |
+
- The overall purpose of this directory
|
| 11 |
+
3. **Design a structure**: Propose a logical folder hierarchy that would:
|
| 12 |
+
- Group related items together
|
| 13 |
+
- Make files easy to find
|
| 14 |
+
- Scale well as more files are added
|
| 15 |
+
- Follow common organizational best practices
|
| 16 |
+
4. **Present options**: Offer 2-3 different organizational approaches:
|
| 17 |
+
- By project/topic
|
| 18 |
+
- By file type
|
| 19 |
+
- By date/time period
|
| 20 |
+
- By workflow/status
|
| 21 |
+
- Or a hybrid approach
|
| 22 |
+
5. **Explain the rationale**: For each proposed structure, explain:
|
| 23 |
+
- Why this organization makes sense
|
| 24 |
+
- Pros and cons
|
| 25 |
+
- What types of users/workflows it suits best
|
| 26 |
+
6. **Get feedback**: Ask Daniel which approach he prefers or if he wants modifications
|
| 27 |
+
7. **Provide implementation guidance**: Once approved, explain how to implement it (or offer to run /organize-loose-files or /consolidate-folders)
|
| 28 |
+
|
| 29 |
+
## Guidelines
|
| 30 |
+
|
| 31 |
+
- Consider Daniel's existing organizational patterns in other directories
|
| 32 |
+
- Suggest structures that are intuitive and maintainable
|
| 33 |
+
- Don't over-complicate - deeper isn't always better
|
| 34 |
+
- Consider future growth and scalability
|
| 35 |
+
- Use clear, descriptive folder names
|
| 36 |
+
- Suggest naming conventions if helpful
|
| 37 |
+
|
| 38 |
+
## Example Structures to Consider
|
| 39 |
+
|
| 40 |
+
- **Flat categorical**: Top-level folders by category (Documents, Images, Projects, etc.)
|
| 41 |
+
- **Hierarchical by project**: Main folders for projects, subfolders for file types
|
| 42 |
+
- **Chronological**: Organized by year/month or project timeline
|
| 43 |
+
- **Workflow-based**: Folders like "Active", "Archive", "Reference", "In-Progress"
|
| 44 |
+
- **Hybrid**: Combination of approaches (e.g., projects at top level, then by file type)
|
| 45 |
+
|
| 46 |
+
## Output
|
| 47 |
+
|
| 48 |
+
Present folder structure proposals using tree format for clarity, showing:
|
| 49 |
+
- Proposed folder names
|
| 50 |
+
- Purpose of each folder
|
| 51 |
+
- Example of what would go in each folder
|
| 52 |
+
- Estimated number of files that would go in each folder based on current contents
|
commands/filesystem-organization/tidy-up/desktop-tidy.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Recurse to my desktop (~/Desktop)
|
| 2 |
+
|
| 3 |
+
Help me clean it up!
|
| 4 |
+
|
| 5 |
+
See what non-launcher files I have
|
| 6 |
+
|
| 7 |
+
Create filetype folders like audio and move files of that association into those subfolders.
|
| 8 |
+
|
| 9 |
+
If you think you can see files which are probably no longer needed, ask me if they can be deleted
|
commands/filesystem-organization/tidy-up/organize-loose-files.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
You are helping Daniel organize loose files in a directory into a logical folder structure.
|
| 2 |
+
|
| 3 |
+
## Your Task
|
| 4 |
+
|
| 5 |
+
1. **Analyze the current directory**: List all files (not subdirectories) in the current working directory
|
| 6 |
+
2. **Categorize files**: Group files by:
|
| 7 |
+
- File type/extension
|
| 8 |
+
- Common naming patterns
|
| 9 |
+
- Apparent purpose or content (infer from filenames)
|
| 10 |
+
3. **Propose folder structure**: Suggest a logical folder organization scheme based on what you find
|
| 11 |
+
4. **Present the plan**: Show Daniel:
|
| 12 |
+
- How many files will go into each proposed folder
|
| 13 |
+
- The proposed folder names
|
| 14 |
+
- A few example files that would go into each folder
|
| 15 |
+
5. **Ask for confirmation**: Get Daniel's approval before making any changes
|
| 16 |
+
6. **Execute if approved**: Create the folders and move files accordingly
|
| 17 |
+
|
| 18 |
+
## Guidelines
|
| 19 |
+
|
| 20 |
+
- Be intelligent about categorization - don't just group by file extension
|
| 21 |
+
- Look for patterns in filenames (dates, projects, categories)
|
| 22 |
+
- Suggest meaningful folder names
|
| 23 |
+
- If there are many files of the same type doing different things, subcategorize them
|
| 24 |
+
- Always preserve file names when moving
|
| 25 |
+
- Create a summary report after completion showing what was organized
|
| 26 |
+
|
| 27 |
+
## Safety
|
| 28 |
+
|
| 29 |
+
- NEVER delete files
|
| 30 |
+
- NEVER overwrite existing files
|
| 31 |
+
- If a filename conflict occurs during move, append a number suffix
|
| 32 |
+
- Ask before proceeding with the actual file moves
|
commands/fonts/install-google-fonts.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: Install Google Fonts provided by the user
|
| 3 |
+
tags: [fonts, google-fonts, typography, installation, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user install Google Fonts by name.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **Get font names from user**
|
| 11 |
+
- Ask user which Google Fonts they want to install
|
| 12 |
+
- Accept multiple font names
|
| 13 |
+
|
| 14 |
+
2. **Choose installation method**
|
| 15 |
+
|
| 16 |
+
**Method 1: Using google-font-installer (if available)**
|
| 17 |
+
- Install tool: `pip install gftools`
|
| 18 |
+
- Download font: `gftools download-family "Font Name"`
|
| 19 |
+
|
| 20 |
+
**Method 2: Using font-downloader**
|
| 21 |
+
- Install: `sudo apt install font-manager`
|
| 22 |
+
- Or use: `pip install font-downloader`
|
| 23 |
+
|
| 24 |
+
**Method 3: Manual download**
|
| 25 |
+
- Download from: `https://fonts.google.com/`
|
| 26 |
+
- Or use GitHub: `https://github.com/google/fonts/tree/main/`
|
| 27 |
+
|
| 28 |
+
3. **Download fonts**
|
| 29 |
+
- For each font name:
|
| 30 |
+
- Convert name to lowercase with dashes (e.g., "Roboto Mono" → "roboto-mono")
|
| 31 |
+
- Download from: `https://fonts.google.com/download?family=Font+Name`
|
| 32 |
+
- Or clone specific font: `git clone https://github.com/google/fonts.git --depth 1 --filter=blob:none --sparse && cd fonts && git sparse-checkout set ofl/<font-name>`
|
| 33 |
+
|
| 34 |
+
4. **Install fonts**
|
| 35 |
+
- Create user font directory: `mkdir -p ~/.local/share/fonts/google-fonts`
|
| 36 |
+
- Extract and copy font files:
|
| 37 |
+
```bash
|
| 38 |
+
unzip <font>.zip -d ~/.local/share/fonts/google-fonts/<font-name>/
|
| 39 |
+
```
|
| 40 |
+
- Only copy .ttf and .otf files
|
| 41 |
+
|
| 42 |
+
5. **Update font cache**
|
| 43 |
+
- Run: `fc-cache -fv`
|
| 44 |
+
- Verify installation: `fc-list | grep -i "<font-name>"`
|
| 45 |
+
|
| 46 |
+
6. **Provide usage examples**
|
| 47 |
+
- Show how to use in applications
|
| 48 |
+
- Show how to set as system font
|
| 49 |
+
- Show how to use in CSS/web design
|
| 50 |
+
|
| 51 |
+
## Example Workflow
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
# Example: Installing "Roboto" and "Open Sans"
|
| 55 |
+
mkdir -p ~/.local/share/fonts/google-fonts
|
| 56 |
+
cd /tmp
|
| 57 |
+
|
| 58 |
+
# Download Roboto
|
| 59 |
+
wget "https://fonts.google.com/download?family=Roboto" -O roboto.zip
|
| 60 |
+
unzip roboto.zip -d ~/.local/share/fonts/google-fonts/roboto/
|
| 61 |
+
|
| 62 |
+
# Download Open Sans
|
| 63 |
+
wget "https://fonts.google.com/download?family=Open+Sans" -O open-sans.zip
|
| 64 |
+
unzip open-sans.zip -d ~/.local/share/fonts/google-fonts/open-sans/
|
| 65 |
+
|
| 66 |
+
# Update cache
|
| 67 |
+
fc-cache -fv
|
| 68 |
+
|
| 69 |
+
# Verify
|
| 70 |
+
fc-list | grep -i "roboto\|open sans"
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
## Output
|
| 74 |
+
|
| 75 |
+
Provide a summary showing:
|
| 76 |
+
- Fonts requested by user
|
| 77 |
+
- Download and installation status for each
|
| 78 |
+
- Installation location
|
| 79 |
+
- Verification that fonts are available
|
| 80 |
+
- Usage examples
|
commands/fonts/list-fonts.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
description: List installed fonts and offer to install additional fonts
|
| 3 |
+
tags: [fonts, typography, system, customization, project, gitignored]
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
You are helping the user review their installed fonts and install additional ones if requested.
|
| 7 |
+
|
| 8 |
+
## Process
|
| 9 |
+
|
| 10 |
+
1. **List currently installed fonts**
|
| 11 |
+
- System fonts: `fc-list | cut -d: -f2 | sort -u | wc -l` (count)
|
| 12 |
+
- Show font families: `fc-list : family | sort -u`
|
| 13 |
+
- List font directories:
|
| 14 |
+
- System: `/usr/share/fonts/`
|
| 15 |
+
- User: `~/.local/share/fonts/`
|
| 16 |
+
|
| 17 |
+
2. **Categorize installed fonts**
|
| 18 |
+
- Serif fonts
|
| 19 |
+
- Sans-serif fonts
|
| 20 |
+
- Monospace/coding fonts
|
| 21 |
+
- Display/decorative fonts
|
| 22 |
+
- Icon fonts
|
| 23 |
+
|
| 24 |
+
3. **Check for common font packages**
|
| 25 |
+
- `dpkg -l | grep -E "fonts-|ttf-"`
|
| 26 |
+
- Common packages:
|
| 27 |
+
- `fonts-liberation`
|
| 28 |
+
- `fonts-noto`
|
| 29 |
+
- `fonts-roboto`
|
| 30 |
+
- `ttf-mscorefonts-installer`
|
| 31 |
+
- `fonts-powerline`
|
| 32 |
+
|
| 33 |
+
4. **Suggest useful font additions**
|
| 34 |
+
|
| 35 |
+
**For coding:**
|
| 36 |
+
- Fira Code (ligatures)
|
| 37 |
+
- JetBrains Mono
|
| 38 |
+
- Cascadia Code
|
| 39 |
+
- Victor Mono
|
| 40 |
+
- Source Code Pro
|
| 41 |
+
|
| 42 |
+
**For design:**
|
| 43 |
+
- Inter
|
| 44 |
+
- Poppins
|
| 45 |
+
- Montserrat
|
| 46 |
+
- Raleway
|
| 47 |
+
|
| 48 |
+
**System fonts:**
|
| 49 |
+
- Noto fonts (comprehensive Unicode)
|
| 50 |
+
- Liberation fonts (MS Office compatible)
|
| 51 |
+
|
| 52 |
+
**Icons:**
|
| 53 |
+
- Font Awesome
|
| 54 |
+
- Material Design Icons
|
| 55 |
+
- Nerd Fonts
|
| 56 |
+
|
| 57 |
+
5. **Installation methods**
|
| 58 |
+
- APT: `sudo apt install fonts-<name>`
|
| 59 |
+
- Manual installation:
|
| 60 |
+
```bash
|
| 61 |
+
mkdir -p ~/.local/share/fonts
|
| 62 |
+
# Copy font files to directory
|
| 63 |
+
fc-cache -fv
|
| 64 |
+
```
|
| 65 |
+
- Google Fonts downloader (see separate command)
|
| 66 |
+
|
| 67 |
+
6. **Test font installation**
|
| 68 |
+
- Refresh font cache: `fc-cache -fv`
|
| 69 |
+
- Verify font: `fc-list | grep -i <font-name>`
|
| 70 |
+
- Show sample: `fc-match <font-name>`
|
| 71 |
+
|
| 72 |
+
## Output
|
| 73 |
+
|
| 74 |
+
Provide a report showing:
|
| 75 |
+
- Total number of installed font families
|
| 76 |
+
- List of installed fonts by category
|
| 77 |
+
- Missing commonly-used fonts
|
| 78 |
+
- Suggested fonts to install based on use case
|
| 79 |
+
- Installation commands
|