Custom zsh functions and utilities for productivity and automation on macOS.
- π Git helpers - Quick navigation and branch management
- π³ Docker utilities - Remote Docker connections and management
- π» Development tools - TypeScript compilation, code formatting, and more
- π Network automation - Dynamic DNS switching and captive portal auto-login
- π§ macOS utilities - Brightness control, WiFi detection, and system management
- π¦ Database tools - PostgreSQL setup and management helpers
- macOS (required for macOS-specific features)
- Zsh shell
- Git
# Clone the repository
git clone https://github.com/NeoHBz/.ezsh.git ~/.ezsh
# Run the installation script
cd ~/.ezsh
chmod +x install.sh
./install.sh
# Reload your shell
source ~/.zshrc- Clone the repository to
~/.ezsh - Add to your
~/.zshrc:source ~/.ezsh/load.sh
- Copy and configure environment files:
cp ~/.ezsh/.env.sample ~/.ezsh/.env cp ~/.ezsh/.config.sample ~/.ezsh/.config
- Edit
~/.ezsh/.envand~/.ezsh/.configwith your settings
Copy .env.sample to .env and configure:
cp ~/.ezsh/.env.sample ~/.ezsh/.envKey configuration options:
- Docker - Remote Docker host settings
- PostgreSQL - Database connection details
- DNS - Custom DNS server configuration
- LPU Portal - Captive portal settings (if applicable)
- WiFi Networks - Network-specific automation triggers
See CONFIGURATION.md for detailed documentation.
Services are disabled by default for non-intrusive operation. To enable services:
-
Copy
.config.sampleto.config:cp ~/.ezsh/.config.sample ~/.ezsh/.config
-
Edit
.configand enable desired services:# Enable services by listing them (comma-separated) ENABLED_SERVICES="dynamic_dns_service,lpu_auto_login"
Available services:
dynamic_dns_service- Auto-switch DNS based on WiFi networklpu_auto_login- Auto-login to LPU captive portal
gcd- Switch to dev branchgcm- Switch to main/master branchgpo <branch>- Pull from origin branchgitrefresh- Clean up merged branchesgitnuke- Delete all branches except main/dev/currentgdiff [args]- Show git diff including untracked files
removeremote- Unset Docker remote environment variables
tsc1 <file>- Type-check a single TypeScript fileprettify [directory]- Format code with Prettier (current dir or specified)mcode <dir...>- Open directories in new VS Code windowsgccc <file>- Compile and run C programgcpp <file>- Compile and run C++ programjc <file>- Compile and run Java program
bright- Remap brightness keys using hidutilcleardock- Reset macOS Dock to defaultstouchidsudo- Enable Touch ID for sudowifiname- Get current WiFi network name
psql_setup- Initialize PostgreSQL environmentpsql_teardown- Clean up PostgreSQL environment
And many more! Browse the functions/ directory for all available utilities.
# Quick git branch switching
gcm # Switch to main/master
gcd # Switch to dev
# Git operations
gpo main # Pull from origin main
gitrefresh # Clean merged branches
# Docker remote connection
remote # Connect to configured Docker host
# TypeScript type checking
tsc1 src/app.ts # Check single file
# macOS utilities
bright # Remap brightness keys
wifiname # Show current WiFi network
# Compile and run
gccc myprogram # Compile and run C program
gcpp myprogram # Compile and run C++ program
jc MyClass # Compile and run Java classFor automated services (WiFi-based DNS switching, captive portal login):
-
Enable services in
~/.ezsh/.config -
Install LaunchAgents:
# Dynamic DNS service cp services/mac/wifi/dynamic_dns.plist ~/Library/LaunchAgents/com.ezsh.dynamic_dns.plist launchctl load ~/Library/LaunchAgents/com.ezsh.dynamic_dns.plist # LPU auto-login service cp services/mac/wifi/lpu_auto_login.plist ~/Library/LaunchAgents/com.ezsh.lpu.autologin.plist launchctl load ~/Library/LaunchAgents/com.ezsh.lpu.autologin.plist
-
View logs:
tail -f ~/.ezsh/logs/dynamic_dns.log tail -f ~/.ezsh/logs/lpu_auto_login.log
.ezsh/
βββ functions/ # Function definitions
β βββ git/ # Git utilities
β βββ docker/ # Docker helpers
β βββ mac/ # macOS-specific tools
β βββ psql/ # PostgreSQL tools
β βββ tsc/ # TypeScript utilities
β βββ ...
βββ services/ # LaunchAgent services
β βββ mac/wifi/ # WiFi-based automation
βββ logs/ # Service logs
βββ load.sh # Main loader script
βββ install.sh # Installation script
βββ .env.sample # Environment template
βββ .config.sample # Service config template
βββ README.md # This file
If you're upgrading from an older version with hardcoded values, see MIGRATION.md for step-by-step migration instructions.
β οΈ Never commit.envor.configfiles (already in.gitignore)- π Set proper permissions:
chmod 600 ~/.ezsh/.env - π Rotate credentials regularly
- π Use
.env.sampleas a template, not the actual config
# Check if load.sh is sourced in ~/.zshrc
grep "load.sh" ~/.zshrc
# Manually reload
source ~/.ezsh/load.sh# Check if service is enabled in .config
cat ~/.ezsh/.config | grep ENABLED_SERVICES
# Check service logs
tail -f ~/.ezsh/logs/dynamic_dns.log# Ensure .env exists and is sourced
ls -la ~/.ezsh/.env
source ~/.ezsh/.envContributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow existing code style and structure
- Test your changes thoroughly
- Update documentation as needed
- Use descriptive commit messages
- Add comments for complex logic
This project is licensed under the MIT License - see the LICENSE file for details.
NeoHBz
- GitHub: @NeoHBz
- Built for productivity and automation
- Inspired by the need for streamlined development workflows
- Community contributions and feedback
If you find this project helpful, please β star the repository!
For issues, questions, or feature requests, please open an issue.
Note: This project is primarily designed for macOS. Some features may not work on other operating systems.