By adding the lines below to your ~/.zshrc
or ~/.bashrc
you can use quick aliases to perform some firebase and aws commands.
# Undo last commit (If you haven't pushed)
alias gitz="git reset --soft HEAD~"
#Bumps NPM version & stages the change.
alias bump='read -r -p "Version update type: (M)ajor/Mi(n)or/(P)atch " patchBumpMode && if [ ${patchBumpMode,,} == "m" ]; then echo "Its major update" && npm --no-git-tag-version version major; elif [ ${patchBumpMode,,} == "n" ]; then echo "Its minor update" && npm --no-git-tag-version version minor; elif [ ${patchBumpMode,,} == "p" ]; then echo "Its patch update" && npm --no-git-tag-version version patch; else echo "Dunno"; fi && git add package.json package-lock.json'
You can install, update, deploy functions and smart firebase emulator with these aliases.
#Firebase
alias fbup="npm install -g firebase-tools"
alias fbdf="firebase deploy --only functions"
alias fbes="firebase emulators:start"
alias fbesf="firebase emulators:start —only functions"
Installs or updates amplify in a project.
#Amplify install/update
alias ampup="npm install -g @aws-amplify/cli"
# List installed brew packages with decriptions
alias brewery='brew leaves | xargs brew desc --eval-all'
# Copy SSH Key
alias sshcopy='cat ~/.ssh/id_rsa.pub | pbcopy'
# Display SSH Key
alias sshshow='cat ~/.ssh/id_rsa.pub'
# Displays your public ip
mip(){
ip=$(curl -s https://api.ipify.org)
echo "IP => $ip"
}
Aliases to list, start, stop, terminate and restart ec2 instances.
#AWS ec2 List, describe;
alias awsec2ls="aws ec2 describe-instances"
alias awsec2start="aws ec2 start-instances --instance-ids"
alias awsec2stop="aws ec2 stop-instances --instance-ids"
alias awsec2terminate="aws ec2 terminate-instances --dry-run --instance-ids"
alias awsec2restart="aws ec2 reboot-instances --instance-ids"
#XCode
alias simulator='open -a simulator'