Add zsh configuration sync system
- Add zshrc.template with full oh-my-zsh configuration - Add install-zsh-config.sh for complete installation - Add quick-install.sh for one-command installation - Add sync script for configuration updates - Include custom aliases and plugin configurations - Support for ansible, docker, terraform, kubernetes tools
This commit is contained in:
242
configuration/zsh/oh-my-zsh-custom/aliases.zsh
Normal file
242
configuration/zsh/oh-my-zsh-custom/aliases.zsh
Normal file
@@ -0,0 +1,242 @@
|
||||
# =============================================================================
|
||||
# CUSTOM ALIASES FOR MANAGEMENT SYSTEM
|
||||
# =============================================================================
|
||||
|
||||
# Project Management
|
||||
alias mgmt='cd /root/mgmt'
|
||||
alias mgmt-status='cd /root/mgmt && ./mgmt.sh status'
|
||||
alias mgmt-deploy='cd /root/mgmt && ./mgmt.sh deploy'
|
||||
alias mgmt-cleanup='cd /root/mgmt && ./mgmt.sh cleanup'
|
||||
alias mgmt-swarm='cd /root/mgmt && ./mgmt.sh swarm'
|
||||
alias mgmt-tofu='cd /root/mgmt && ./mgmt.sh tofu'
|
||||
|
||||
# Ansible Management
|
||||
alias ansible-check='cd /root/mgmt/configuration && ansible-playbook --syntax-check'
|
||||
alias ansible-deploy='cd /root/mgmt/configuration && ansible-playbook -i inventories/production/inventory.ini'
|
||||
alias ansible-ping='cd /root/mgmt/configuration && ansible -i inventories/production/inventory.ini all -m ping'
|
||||
alias ansible-vault='cd /root/mgmt/configuration && ansible-vault'
|
||||
alias ansible-galaxy='cd /root/mgmt/configuration && ansible-galaxy'
|
||||
|
||||
# OpenTofu/Terraform Management
|
||||
alias tofu-init='cd /root/mgmt/tofu/environments/dev && tofu init'
|
||||
alias tofu-plan='cd /root/mgmt/tofu/environments/dev && tofu plan -var-file="terraform.tfvars"'
|
||||
alias tofu-apply='cd /root/mgmt/tofu/environments/dev && tofu apply -var-file="terraform.tfvars"'
|
||||
alias tofu-destroy='cd /root/mgmt/tofu/environments/dev && tofu destroy -var-file="terraform.tfvars"'
|
||||
alias tofu-output='cd /root/mgmt/tofu/environments/dev && tofu output'
|
||||
alias tofu-validate='cd /root/mgmt/tofu/environments/dev && tofu validate'
|
||||
alias tofu-fmt='cd /root/mgmt/tofu/environments/dev && tofu fmt -recursive'
|
||||
|
||||
# Docker Management
|
||||
alias d='docker'
|
||||
alias dc='docker-compose'
|
||||
alias dps='docker ps'
|
||||
alias dpsa='docker ps -a'
|
||||
alias di='docker images'
|
||||
alias dex='docker exec -it'
|
||||
alias dlog='docker logs -f'
|
||||
alias dstop='docker stop'
|
||||
alias dstart='docker start'
|
||||
alias drm='docker rm'
|
||||
alias drmi='docker rmi'
|
||||
alias dclean='docker system prune -f'
|
||||
alias dbuild='docker build'
|
||||
alias drun='docker run'
|
||||
alias dpull='docker pull'
|
||||
alias dpush='docker push'
|
||||
|
||||
# Docker Swarm Management
|
||||
alias dswarm='docker swarm'
|
||||
alias dstack='docker stack'
|
||||
alias dservice='docker service'
|
||||
alias dnode='docker node'
|
||||
alias dnetwork='docker network'
|
||||
alias dsecret='docker secret'
|
||||
alias dconfig='docker config'
|
||||
alias dstack-ls='docker stack ls'
|
||||
alias dstack-rm='docker stack rm'
|
||||
alias dstack-deploy='docker stack deploy'
|
||||
alias dservice-ls='docker service ls'
|
||||
alias dservice-ps='docker service ps'
|
||||
alias dservice-logs='docker service logs'
|
||||
|
||||
# Kubernetes Management
|
||||
alias k='kubectl'
|
||||
alias kgp='kubectl get pods'
|
||||
alias kgs='kubectl get services'
|
||||
alias kgd='kubectl get deployments'
|
||||
alias kgn='kubectl get nodes'
|
||||
alias kgi='kubectl get ingress'
|
||||
alias kgc='kubectl get configmaps'
|
||||
alias kgs='kubectl get secrets'
|
||||
alias kdp='kubectl describe pod'
|
||||
alias kds='kubectl describe service'
|
||||
alias kdd='kubectl describe deployment'
|
||||
alias kdn='kubectl describe node'
|
||||
alias kdi='kubectl describe ingress'
|
||||
alias kaf='kubectl apply -f'
|
||||
alias kdf='kubectl delete -f'
|
||||
alias kl='kubectl logs -f'
|
||||
alias ke='kubectl edit'
|
||||
alias kx='kubectl exec -it'
|
||||
alias kctx='kubectl config current-context'
|
||||
alias kuse='kubectl config use-context'
|
||||
|
||||
# Git Management
|
||||
alias gs='git status'
|
||||
alias ga='git add'
|
||||
alias gc='git commit'
|
||||
alias gp='git push'
|
||||
alias gl='git pull'
|
||||
alias gd='git diff'
|
||||
alias gb='git branch'
|
||||
alias gco='git checkout'
|
||||
alias gcom='git checkout main'
|
||||
alias gcod='git checkout develop'
|
||||
alias gst='git stash'
|
||||
alias gstp='git stash pop'
|
||||
alias gstl='git stash list'
|
||||
alias gstc='git stash clear'
|
||||
alias gcl='git clone'
|
||||
alias gfe='git fetch'
|
||||
alias gme='git merge'
|
||||
alias gr='git rebase'
|
||||
alias grc='git rebase --continue'
|
||||
alias gra='git rebase --abort'
|
||||
alias gres='git reset'
|
||||
alias gresh='git reset --hard'
|
||||
alias gress='git reset --soft'
|
||||
|
||||
# System Management
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias ports='netstat -tuln'
|
||||
alias myip='curl -s https://httpbin.org/ip | jq -r .origin'
|
||||
alias speedtest='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3'
|
||||
alias psg='ps aux | grep'
|
||||
alias top='htop'
|
||||
alias cp='cp -i'
|
||||
alias mv='mv -i'
|
||||
alias rm='rm -i'
|
||||
alias mkdir='mkdir -pv'
|
||||
|
||||
# Network Management
|
||||
alias ping='ping -c 4'
|
||||
alias traceroute='traceroute -n'
|
||||
alias nmap='nmap -sS -O'
|
||||
alias ss='ss -tuln'
|
||||
|
||||
# File Operations
|
||||
alias find='find . -name'
|
||||
alias locate='locate -i'
|
||||
alias which='which -a'
|
||||
alias whereis='whereis -b'
|
||||
|
||||
# Text Processing
|
||||
alias cat='cat -n'
|
||||
alias less='less -R'
|
||||
alias more='more -R'
|
||||
alias head='head -n 20'
|
||||
alias tail='tail -n 20'
|
||||
alias wc='wc -l'
|
||||
|
||||
# Archive Operations
|
||||
alias tar='tar -v'
|
||||
alias zip='zip -r'
|
||||
alias unzip='unzip -l'
|
||||
alias gzip='gzip -v'
|
||||
alias gunzip='gunzip -v'
|
||||
|
||||
# Process Management
|
||||
alias jobs='jobs -l'
|
||||
alias bg='bg %'
|
||||
alias fg='fg %'
|
||||
alias kill='kill -9'
|
||||
alias pkill='pkill -f'
|
||||
|
||||
# Environment
|
||||
alias env='env | sort'
|
||||
alias set='set | sort'
|
||||
alias unset='unset'
|
||||
alias export='export'
|
||||
alias source='source'
|
||||
|
||||
# History
|
||||
alias h='history'
|
||||
alias hg='history | grep'
|
||||
alias hc='history -c'
|
||||
|
||||
# Directory Navigation
|
||||
alias cd..='cd ..'
|
||||
alias cd...='cd ../..'
|
||||
alias cd....='cd ../../..'
|
||||
alias cd-='cd -'
|
||||
alias cd~='cd ~'
|
||||
alias cd/='cd /'
|
||||
|
||||
# Quick Access
|
||||
alias vim='vim'
|
||||
alias nano='nano'
|
||||
alias emacs='emacs'
|
||||
alias code='code'
|
||||
alias subl='subl'
|
||||
|
||||
# Monitoring
|
||||
alias df='df -h'
|
||||
alias du='du -h'
|
||||
alias free='free -h'
|
||||
alias meminfo='cat /proc/meminfo'
|
||||
alias cpuinfo='cat /proc/cpuinfo'
|
||||
alias uptime='uptime -p'
|
||||
|
||||
# Security
|
||||
alias chmod='chmod -v'
|
||||
alias chown='chown -v'
|
||||
alias chgrp='chgrp -v'
|
||||
alias passwd='passwd'
|
||||
alias su='su -'
|
||||
alias sudo='sudo -E'
|
||||
|
||||
# Development
|
||||
alias make='make -j$(nproc)'
|
||||
alias cmake='cmake -DCMAKE_BUILD_TYPE=Release'
|
||||
alias gcc='gcc -Wall -Wextra'
|
||||
alias g++='g++ -Wall -Wextra'
|
||||
alias python='python3'
|
||||
alias pip='pip3'
|
||||
alias node='node'
|
||||
alias npm='npm'
|
||||
alias yarn='yarn'
|
||||
|
||||
# Logs
|
||||
alias journal='journalctl -f'
|
||||
alias syslog='tail -f /var/log/syslog'
|
||||
alias auth='tail -f /var/log/auth.log'
|
||||
alias kern='tail -f /var/log/kern.log'
|
||||
alias mail='tail -f /var/log/mail.log'
|
||||
|
||||
# Backup
|
||||
alias backup='tar -czf backup-$(date +%Y%m%d-%H%M%S).tar.gz'
|
||||
alias restore='tar -xzf'
|
||||
|
||||
# Cleanup
|
||||
alias clean='rm -rf ~/.cache/* ~/.tmp/* /tmp/*'
|
||||
alias clean-docker='docker system prune -af --volumes'
|
||||
alias clean-k8s='kubectl delete pods --field-selector=status.phase=Succeeded'
|
||||
alias clean-ansible='rm -rf ~/.ansible/tmp/*'
|
||||
|
||||
# Information
|
||||
alias info='uname -a'
|
||||
alias whoami='whoami'
|
||||
alias id='id'
|
||||
alias groups='groups'
|
||||
alias users='users'
|
||||
alias w='w'
|
||||
alias who='who'
|
||||
alias last='last -n 10'
|
||||
12
configuration/zsh/oh-my-zsh-custom/example.zsh
Normal file
12
configuration/zsh/oh-my-zsh-custom/example.zsh
Normal file
@@ -0,0 +1,12 @@
|
||||
# Put files in this folder to add your own custom functionality.
|
||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization
|
||||
#
|
||||
# Files in the custom/ directory will be:
|
||||
# - loaded automatically by the init script, in alphabetical order
|
||||
# - loaded last, after all built-ins in the lib/ directory, to override them
|
||||
# - ignored by git by default
|
||||
#
|
||||
# Example: add custom/shortcuts.zsh for shortcuts to your local projects
|
||||
#
|
||||
# brainstormr=~/Projects/development/planetargon/brainstormr
|
||||
# cd $brainstormr
|
||||
@@ -0,0 +1,3 @@
|
||||
# Add your own custom plugins in the custom/plugins directory. Plugins placed
|
||||
# here will override ones with the same name in the main plugins directory.
|
||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-plugins
|
||||
Submodule configuration/zsh/oh-my-zsh-custom/plugins/zsh-autosuggestions added at 85919cd1ff
Submodule configuration/zsh/oh-my-zsh-custom/plugins/zsh-completions added at d08cee09ce
Submodule configuration/zsh/oh-my-zsh-custom/plugins/zsh-syntax-highlighting added at 5eb677bb0f
@@ -0,0 +1,6 @@
|
||||
# Put your custom themes in this folder.
|
||||
# See: https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#overriding-and-adding-themes
|
||||
#
|
||||
# Example:
|
||||
|
||||
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
|
||||
Reference in New Issue
Block a user