Skip to content

Instantly share code, notes, and snippets.

@siniradam
Last active May 29, 2024 09:24
Show Gist options
  • Save siniradam/76e409fb5c7ab299a5d15c1d796d3abe to your computer and use it in GitHub Desktop.
Save siniradam/76e409fb5c7ab299a5d15c1d796d3abe to your computer and use it in GitHub Desktop.
Useful Full-Stack Bash Aliases

Useful aliases for front-end & back end developers

By adding the lines below to your ~/.zshrc or ~/.bashrc you can use quick aliases to perform some firebase and aws commands.

GIT

# Undo last commit (If you haven't pushed)
alias gitz="git reset --soft HEAD~"

NodeJS Aliases

#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'

Firebase and AWS aliases

Firebase

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"

Amplify

Installs or updates amplify in a project.

#Amplify install/update
alias ampup="npm install -g @aws-amplify/cli"

Tools

# 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"
}

Frequently used AWS EC2 Instance commands

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"

Run iOS Simulator (osx)

#XCode
alias simulator='open -a simulator'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment