Snippets (Automation)
Scripting and variable interpolation engine
Snippets transform Netcatty from a passive terminal into an active automation platform. They bridge the gap between "typing a command manually" and "writing a full Ansible playbook".
Multi-Line Scripts
Netcatty handles multi-line snippets with ease.
- Sequential Execution: Snippets are sent to the terminal as a sequence of commands, maintaining proper line-ending handling.
- Broadcast Execution: You can run a snippet across all active panes simultaneously using Broadcast Mode.
Startup Commands
You can also define a startupCommand for any specific Host in the Advanced tab. This command will execute automatically every time you connect to that host, separate from your reusable snippets.
The Snippet Cookbook
Here are 3 essential snippets to get you started.
1. System Triage
- Description: Instant health check.
- Command:
echo "=== MEMORY ==="; free -h; echo "\n=== DISK ==="; df -h /; echo "\n=== LOAD ==="; uptime;
2. Log Tail (Nginx)
- Description: Watch logs with color.
- Command:
tail -f /var/log/nginx/access.log | grep --color=auto " 500 "
3. Update & Upgrade (Ubuntu)
- Description: Update system (non-interactive).
- Command:
sudo apt-get update && sudo apt-get upgrade -y
Sharing & Sync
Snippets are stored as JSON objects in your Vault.
- Export: You can export snippets specifically (without hosts) to share a "Team Toolkit" JSON file.
- Sync: Snippets sync seamlessly via Cloud Sync. Your "Docker Killer" script will be available on your home PC instantly.