Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Greg's CLI Stuff

CLI Cheatsheet

A list of my most used commands as well as a few from Oh My Zsh!

ZSH Shortcuts

https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet

Git

getmaster "feature/foo-branch"

Get the lastest from master, and merge into my feature branch.

getprod "hotfix/foo-branch"

Get the lastest from prod, and merge into my hotfix branch.

mim "feature/foo-branch"

Merge this branch into master, commit, and push.

commit "foo commit message"

Shortcut for staging, commiting, and pushing to a repository.

fixit

Re-run gulp which usually fixes stylesheet related merge conflicts.

submodulesbump

Update all submodules in a repository.

Homebrew

brewupdate

Update Homebrew, Homebrew Cask, NPM modules, Gems, etc...

Aliases

openalias

Open ZSH aliases.

openfunctions

Open ZSH functions.

hosts

Open the hosts file.

speedtest1 or speedtest2

Run a speedtest.net speedtest in the command line.

Misc. Commands

wpcli

Update WP-CLI.

db

Pull down a WordPress database using MigrateDB Pro.

cbt

Proxy crossbrowsertesting.com through your local.

serverupdate

Update an Ubuntu server and reboot.

# ██ ██
# ░██░░
# ██████ ░██ ██ ██████ ██████ █████ ██████
# ░░░░░░██ ░██░██ ░░░░░░██ ██░░░░ ██░░░██ ██░░░░
# ███████ ░██░██ ███████ ░░█████ ░███████░░█████
# ██░░░░██ ░██░██ ██░░░░██ ░░░░░██░██░░░░ ░░░░░██
# ░░████████ ███░██░░████████ ██████ ░░██████ ██████
# ░░░░░░░░ ░░░ ░░ ░░░░░░░░ ░░░░░░ ░░░░░░ ░░░░░░
#
alias zshconfig="$EDITOR ~/.zshrc"
alias ohmyzsh="$EDITOR ~/.oh-my-zsh"
alias openalias="open -a 'Sublime Text' ~/Dropbox/Backup/dotfiles/sourced/aliases"
alias openfunctions="open -a 'Sublime Text' ~/Dropbox/Backup/dotfiles/sourced/functions"
alias openpaths="open -a 'Sublime Text' ~/Dropbox/Backup/dotfiles/sourced/paths"
alias openexports="open -a 'Sublime Text' ~/Dropbox/Backup/dotfiles/sourced/exports"
alias hosts="open -a 'Sublime Text' /private/etc/hosts"
alias desktop="cd ~/desktop && ls"
alias lss="ls -Gal"
alias lp="ls -p"
alias h="history"
alias hosts="sudo $EDITOR /etc/hosts"
alias c="cd"
alias e="$EDITOR ."
alias vup="vagrant up && vagrant provision && vagrant ssh"
alias vp="vagrant provision"
alias vag="vagrant"
alias db="wp migratedb profile 1"
alias db2="wp migratedb profile 2"
alias rebootz="source /Users/gregrickaby/DropBox/Backup/dotfiles/.zshrc"
alias publickey='more ~/.ssh/id_rsa.pub | pbcopy | printf '\''=> Public key copied to clipboard.\n'\'
alias hidedotfiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
alias showdotfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias disk="df -h"
alias iphone="open /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app"
alias flushdns="sudo killall -HUP mDNSResponder"
alias serverup='VBoxHeadless --startvm "Ubuntu Server"'
alias serverdown='VBoxManage controlvm "Ubuntu Server" poweroff'
alias serverpause='VBoxManage controlvm "Ubuntu Server" pause'
alias serverreset='VBoxManage controlvm "Ubuntu Server" reset'
alias speedtest1="speedtest --server 1787 --share"
alias speedtest2="speedtest --server 884 --share"
# ██
# ██████ ░██
# █████ ██ ██░██░░░██ ██████ ██████ ██████ ██████
# ██░░░██░░██ ██ ░██ ░██ ██░░░░██░░██░░█░░░██░ ██░░░░
# ░███████ ░░███ ░██████ ░██ ░██ ░██ ░ ░██ ░░█████
# ░██░░░░ ██░██ ░██░░░ ░██ ░██ ░██ ░██ ░░░░░██
# ░░██████ ██ ░░██░██ ░░██████ ░███ ░░██ ██████
# ░░░░░░ ░░ ░░ ░░ ░░░░░░ ░░░ ░░ ░░░░░░
#
# Allow WP-CLI to interact with MAMP Pro
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
# Place Cask's into /Applications
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
export PATH="/usr/local/sbin:$PATH"
# Node/NPM
export PATH="usr/local/bin:$PATH"
# Homemade scripts
export PATH=/Users/$USER/Scripts:$PATH
# Sorry vim.
export EDITOR="nano";
# ████ ██ ██
# ░██░ ░██ ░░
# ██████ ██ ██ ███████ █████ ██████ ██ ██████ ███████ ██████
# ░░░██░ ░██ ░██░░██░░░██ ██░░░██░░░██░ ░██ ██░░░░██░░██░░░██ ██░░░░
# ░██ ░██ ░██ ░██ ░██░██ ░░ ░██ ░██░██ ░██ ░██ ░██░░█████
# ░██ ░██ ░██ ░██ ░██░██ ██ ░██ ░██░██ ░██ ░██ ░██ ░░░░░██
# ░██ ░░██████ ███ ░██░░█████ ░░██ ░██░░██████ ███ ░██ ██████
# ░░ ░░░░░░ ░░░ ░░ ░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░ ░░░░░░
# Update WP-CLI
function wpcli() {
sudo curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && sudo chmod +x wp-cli.phar && sudo mv wp-cli.phar /usr/local/bin/wp
}
# Update 3rd party shit and do misc clean ups
function brewupdate() {
brew update && brew upgrade && brew cleanup && brew cask cleanup && brew cask update && npm update -g && gem update --sysem
}
# Clean up dev emails generated by random bounces
function mailcleanup() {
sudo rm /var/mail/gregrickaby && sudo rm /var/mail/root
}
# Roll through and update all the submodules
function submodulesbump() {
git submodule foreach git checkout master && git submodule foreach --recursive git pull origin master
}
# Allow CBT to see your local
function cbt() {
java -jar /Applications/MAMP/htdocs/cbttunnel.jar -authkey ua4662cd50ff1c8f
}
# Merge master into a branch and push
# usage: getmaster "feature/foo-branch"
function getmaster() {
git checkout master && git pull && git checkout "$@" && git merge master && git push
}
# Merge prod into a branch and push
# usage: getprod "feature/foo-branch"
function getprod() {
git checkout prod && git pull && git checkout "$@" && git merge prod && git push
}
# Merge into master and push
# usage: mim "feature/foo-branch"
function mim() {
git checkout master && git pull && git merge "$@" && git push && git checkout "$@"
}
# Add, commit and then push
# usage: commit "foo commit message"
function commit() {
git add -A && git commit -m "$@" && git push
}
# Fix the usual CSS related merge conflicts
function fixit() {
gulp styles && git add -A && git commit -m "merge gulp" && git push
}
# Update a server and reboot
function serverupdate() {
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo reboot
}
#
# ██ ██
# ██████ ░██ ░██
# ░██░░░██ ██████ ██████░██ ██████
# ░██ ░██ ░░░░░░██ ░░░██░ ░██████ ██░░░░
# ░██████ ███████ ░██ ░██░░░██░░█████
# ░██░░░ ██░░░░██ ░██ ░██ ░██ ░░░░░██
# ░██ ░░████████ ░░██ ░██ ░██ ██████
# ░░ ░░░░░░░░ ░░ ░░ ░░ ░░░░░░
#
alias app="cd /Applications/MAMP/htdocs/apppresser/wp-content/themes/apppresser"
alias appirio="cd /Applications/MAMP/htdocs/appirio/wp-content/themes/appirio"
alias box="cd ~/Dropbox/"
alias centralmarket="cd /Applications/MAMP/htdocs/centralmarket/wp-content/themes/centralmarket"
alias clp="cd /Applications/MAMP/htdocs/nps-clp/wp-content/themes/clp"
alias clpbp="cd /Applications/MAMP/htdocs/nps-clp/wp-content/plugins/wds-buddypress-project-framework"
alias clphero="cd /Applications/MAMP/htdocs/nps-clp/wp-content/plugins/wds-clp-heroes"
alias dl="cd ~/Downloads"
alias docs="cd ~/Documents/"
alias dt="cd ~/Desktop"
alias flexi="cd /Applications/MAMP/htdocs/flexi/wp-content/themes/flexi"
alias generator="cd /Applications/MAMP/htdocs/wd_s-generator/"
alias genesissample="cd /Applications/MAMP/htdocs/genesis-sample/"
alias greg="cd /Applications/MAMP/htdocs/gregrickaby/wp-content/"
alias hippie="cd /Applications/MAMP/htdocs/organichippie/wp-content/themes/hippie_30/"
alias honeydid="cd /Applications/MAMP/htdocs/honeydid/wp-content/themes/"
alias htdocs="cd /Applications/MAMP/htdocs/"
alias kc="cd /Applications/MAMP/htdocs/killercosmetics/wp-content/plugins/grd-killer-cosmetics-customizations"
alias kiss="cd /Applications/MAMP/htdocs/kiss961/wp-content/themes/kiss961"
alias make="cd /Applications/MAMP/htdocs/make-blog/wp-content/"
alias pluginize="cd /Applications/MAMP/htdocs/pluginize/wp-content/themes/pluginize/"
alias puffpastry="cd /Applications/MAMP/htdocs/puffpastry/wp-content/"
alias raceraves="cd /Applications/MAMP/htdocs/raceraves/wp-content/themes/raceraves"
alias richthomas="cd /Applications/MAMP/htdocs/richthomasweather/wp-content/themes/richthomasweather/"
alias skype="cd /Applications/MAMP/htdocs/skype/wp-content/themes/skype-media"
alias testing="cd /Applications/MAMP/htdocs/testing/wp-content/"
alias uber="cd /Applications/MAMP/htdocs/uber/wp-content/themes/uber-careers"
alias vvv="cd ~/vagrant-local/www"
alias wd_s="cd /Applications/MAMP/htdocs/wd_s/"
alias wds7="cd /Applications/MAMP/htdocs/wds7/wp-content/themes/wds7/"
alias wdsshop="cd /Applications/MAMP/htdocs/wdsshop/wp-content/plugins/wds-shop-master-plugin/"
alias wiregrass="cd /Applications/MAMP/htdocs/wiregrass/wp-content/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.