Skip to content

Instantly share code, notes, and snippets.

@garrettmac
Created July 2, 2017 02:10
Show Gist options
  • Save garrettmac/7a37dcbeebfcd6f069149701d25d8a6d to your computer and use it in GitHub Desktop.
Save garrettmac/7a37dcbeebfcd6f069149701d25d8a6d to your computer and use it in GitHub Desktop.
Nick Jacques

chsh -s $(which zsh)

@garrettmac
Copy link
Author

garrettmac commented Jul 2, 2017

my zsh_functions

#!bin/zsh


infohost() {
    echo -e "\nYou are logged on ${RED}$HOST"
    echo -e "\nAdditionnal information:$NC " ; uname -a
    echo -e "\n${RED}Users logged on:$NC " ; w -h
    echo -e "\n${RED}Current date :$NC " ; date
    echo -e "\n${RED}Machine stats :$NC " ; uptime
    echo -e "\n${RED}Current network location :$NC " ; scselect
    echo -e "\n${RED}Public facing IP Address :$NC " ;myip
    #echo -e "\n${RED}DNS Configuration:$NC " ; scutil --dns
    echo
}
 # h() {
     # if [-z "$1"]
     # then
     # history
     # else history | fgrep "$1"
     # fi
 # }
function cl () { clear; echo -e "\033c\e[3J"}
function mydir(){ mkdir "$1";cd "$1";}

# function adda (){ function "$*";() {cho function "$*"() {> ~/.zshrc; sz; }}
function adda (){  echo "alias $1="\"$2\"""  >> ~/.zsh_aliases; source ~/.zsh_aliases; }

function addcordovaplugin (){ cordova plugin add cordova-plugin-"$*"; }
# function addf (){ function "$*";() {cho "function $1 () { $2}"   >> ~/.zshrc; source ~/.zshrc; }}
function addf (){ echo "function $1 () { "$2"}"   >> ~/.zsh_functions; source ~/.zsh_functions; }


function addz(){ "$*";source ~/.zshrc;}
function sz(){ source ~/.zshrc;}
function szf(){ source ~/.zsh_aliases;}
function sza(){ source ~/.zsh_functions;}
function iphonepath (){cd ~/Library/Application\ Support/MobileSync/Backup;}
function appspath (){cd /Users/vyga/Desktop/portpal/platforms/ios/build/device/;}
function pathcleanlocation1 (){cd ~/Library/Preferences/;}
function pathcleanlocation2 (){cd ~/Library/Application\ Support/;}
function pathcleanlocation3 (){cd ~/Library/Saved\ Application\ State/;}
function pathcleanlocation4 (){cd ~/Library/Caches/;}
function savedstatespath (){cd /Users/vyga/Library/Saved\ Application\ State;}
function removemetadata () { convert "$1" -strip "$2"; }
function rmmetadata () { convert "$1" -strip "$2"; }
function convertInfo () { echo "Convert Info: \n ------------------------------ \n\nSee CheatSheet: http://xahlee.info/img/imagemagic.html \n or http://stackoverflow.com/questions/28332502/remove-the-noise-from-imagemagick-transformation-pipeline \nDefining Color ......... \'rgb(255,25,255)\', blue, \'#12354\'\nReplace Color .........  convert b4.png  -fuzz 30% -fill [CONVERT TO COLOR] -opaque [COLOR TO CONVERT] out.png\nTransparent Background ......... convert -fuzz 20% -transparent white b4.png after.png"}
function hidedockiconon(){ defaults write /Applications/$1.app/Contents/Info.plist LSUIElement true; }
function py () { python }





function glfind(){  git log --all --grep="$1";}
function gfh() { git log -p --}
function glts() {git log --pretty=format:"%C(Yellow)%h%Creset %Cgreen(%ar)%Creset:\"%s\" %Cred(Timestamp:%cd)%Creset"}
function gl() {git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative}
function gl2() {git log --pretty=format:"%C(Yellow)%h%Creset %Cgreen(%ar)%Creset:\"%s\""}
function gls() {git log --pretty=format:"%C(Yellow)%h%Creset %Cgreen(%ar)%Creset:\"%s\"" --stat}
function glgo() {git log --graph --oneline --decorate }
function glgo() {git log --graph --oneline }
function glg() {git log --graph --decorate --pretty=format:"%C(Yellow)%h%Creset %Cgreen(%ar)%Creset:\"%s\""}

function gchc () { git whatchanged -1 --format=oneline | tail -n +2 | wc -l}

function gchf () { git diff --name-only $1 $2}


# function gl() {git log}
function grl() {git reflog}

function gs() {git status}

function gd() {git diff}
function gstaged() {git diff --cached && echo git diff --cached}



function ga() {git add .}
# function gac() {git add . && git commit -am}
function gacx() {git add . && git commit -am '# Quick Add# '}
function gacxp() {git add . && git commit -am '# Quick Add# ' && git push origin}
function gacxp() {git add . && git commit -am '# Quick Add# ' && git push origin master}


function gclmy () { git clone https://github.com/garrettmac/"$1".git && cd $_; }
function gcl() {git clone}

function gitrepo() {  printf "# $1">> README.md; printf "node_modules\nbower_dependancies\n.tmp\n">> .gitignore; git init; git add .; git commit -m "first commit"; git remote add origin https://github.com/garrettmac/"$1".git; git push -u origin master; }
function gitrepoinit() {  printf "# $1">> README.md; printf "node_modules\nbower_dependancies\n.tmp\n">> .gitignore; git init; git add .; git commit -m "first commit"; }
function gitrepolink() {   git remote add origin https://github.com/garrettmac/"$1".git;}


function gc() {
msg="`git whatchanged -1 --format=oneline | tail -n +2 | wc -l` file(s) changed: `git diff --name-status HEAD~1..HEAD | sed -e 's/ /,/g'` (on `date`)"
if [ $# -eq 1 ]
  then msg="$1"
fi
removeMe="   "
echo "A: $msg"
echo "B: ${msg//$removeMe/,}"
git commit -am "${msg//$removeMe/,}"
}
function gac() {
  git add .
msg="`git whatchanged -1 --format=oneline | tail -n +2 | wc -l` file(s) changed: (on `date`)"
if [ $# -eq 1 ]
  then msg="$1"
fi
removeMe="M   "
git commit -am "${msg//$removeMe/,}"
}


function gp() {git push}
function gp() {git push origin}
function gpp() {git push origin gh-pages -f}
function gpm() {git push origin master -f}
function gpPages() {
subpage="public"
  if [ $# -eq 1 ]
    then subpage="$1"
  fi
  git push origin `git subtree split --prefix ${subpage} master`:gh-pages --force
}

function gitp() {git pull}

function gco() {git checkout}
function gcom() {git checkout master -f}
function gcop() {git checkout gh-pages -f}

function gitb() {git branch -r}
function gf() {git fetch}
function gm() {git merge}
function gitd() {git branch -d}
function gitbD() {git branch -D}

function gitr() {git remote -v}

function gitrsurl() {git remote set-url origin}
function gitrurl() {git remote set-url origin}
function gitrset() {git remote set-url origin}

function gignored() {git ls-files --others -i --exclude-standard && echo git ls-files --others -i --exclude-standard}



# other
function v () { vim }
function vzf () { vim ~/.zsh_functions}


function infozhotkeys(){

printf "Shortcut	Action
CTRL + A	Move to the beginning of the line
CTRL + E	Move to the end of the line
CTRL + [left arrow]	Move one word backward (on some systems this is ALT + B)
CTRL + [right arrow]	Move one word forward (on some systems this is ALT + F)
CTRL + U (bash)	Clear the characters on the line before the current cursor position
CTRL + U (zsh)	If you're using the zsh, this will clear the entire line
CTRL + K	Clear the characters on the line after the current cursor position
ESC + [backspace]	Delete the word in front of the cursor
CTRL + W	Delete the word in front of the cursor
ALT + D	Delete the word after the cursor
CTRL + R	Search history
CTRL + G	Escape from search mode
CTRL + _	Undo the last change
CTRL + L	Clear screen
CTRL + S	Stop output to screen
CTRL + Q	Re-enable screen output
CTRL + C	Terminate/kill current foreground process
CTRL + Z	Suspend/stop current foreground process
Command	Action
!!	Execute last command in history
!abc	Execute last command in history beginning with abc
!abc:p	Print last command in history beginning with abc
History Search
Press CTRL + R to search through the history. Continue pressing CTRL + R until you find the entry you're looking for. Press [ENTER] to execute the current expression. Press [Right Arrow] to modify the current expression. Press CTRL + G to escape from search mode.
Special setup for Mac OS X
Go to Terminal -> Preferences -> Settings -> Keyboard
To enable the use of the ALT or OPTION key, select use option as meta key
To enable the CTRL + [left arrow] and CTRL + [right arrow] shortcuts, select
control cursor left and set it to \033b and
control cursor right and set it to \033f."

}

function infomachotkeys(){
printf "${RED}
Command ⌘
Shift ⇧
Option ⌥
Control ⌃
Caps Lock ⇪
Fn"
printf "
Cut, copy, paste, and other common shortcuts
          Shortcut          	Description
	  Command-X	Cut: Remove the selected item and copy it to the Clipboard.
	  Command-C	Copy the selected item to the Clipboard. This also works for files in the Finder.
	  Command-V	Paste the contents of the Clipboard into the current document or app. This also works for files in the Finder.
	  Command-Z	Undo the previous command. You can then press Command-Shift-Z to Redo, reversing the undo command. In some apps, you can undo and redo multiple commands.
	  Command-A	Select All items.
	  Command-F	Find: Open a Find window, or find items in a document.
	  Command-G	Find Again: Find the next occurrence of the item previously found. To find the previous occurrence, press Command-Shift-G.
	  Command-H	Hide the windows of the front app. To view the front app but hide all other apps, press Command-Option-H.
	  Command-M	Minimize the front window to the Dock. To minimize all windows of the front app, press Command-Option-M.
	  Command-N	New: Open an new document or window.
	  Command-O	Open the selected item, or open a dialog to select a file to open.
	  Command-P	Print the current document.
	  Command-S	Save the current document.
	  Command-W	Close the front window. To close all windows of the app, press Command-Option-W.
	  Command-Q	Quit the app.
	  Option-Command-Esc	Force Quit: Choose an app to force quit. Or press Command-Shift-Option-Esc and hold for 3 seconds to force just the front app to quit.
	  Command–Space bar	Spotlight: Show or hide the Spotlight search field. To perform a Spotlight search from a Finder window, press Command–Option–Space bar. If you use multiple input sources to type in different languages, these shortcuts change input sources instead of showing Spotlight.
	  Space bar	Quick Look: Use Quick Look to preview the selected item.
	  Command-Tab	Switch apps: Switch to the next most recently used app among your open apps.
	  Shift-Command-Tilde (~)	Switch windows: Switch to the next most recently used window of the front app.
	  Shift-Command-3	Screenshot: Take a screenshot of the entire screen. Learn more screenshot shortcuts.
	  Command-Comma (,)	Preferences: Open preferences for the front app.
"
}
function vz () { vim ~/.zshrc}
function vza () { vim ~/.zsh_aliases}
function vzf () { vim ~/.zsh_functions}
function fastbackupoff () { sudo sysctl debug.lowpri_throttle_enabled=1}
function fastbackupon () { sudo sysctl debug.lowpri_throttle_enabled=0}
function shutupon () { sudo nvram SystemAudioVolume=%00}
function shutupoff () { sudo nvram -d SystemAudioVolume}
function irid () { ionic run ios --device --livereload}
function iei () { ionic emulate ios --livereload}
function iem () { ionic emulate ios --livereload}
function ibi () { ionic build ios}
function xcode () { open -a 'Xcode' platforms/ios}
function npmu () { npm uninstall }
alias devt="devtool '$1' --watch"
function imgresize () {convert $1 -resize $2x$2 ~/Desktop/$3 }

@garrettmac
Copy link
Author

zshrc

plugins=(lol npm history fasd autojump httpie)
export ZSH="$HOME/.oh-my-zsh"
# ZSH_THEME="agnoster"
# ZSH_THEME="jnrowe"
ZSH_THEME="avit"
# ZSH_THEME="bira"

#ZSH_THEME="agnoster|jnrowe|avit|bira|cobalt2|bureau|dogenpunk|gnzh|pygmalion|random"
source "$ZSH/oh-my-zsh.sh"
BLACK='\E[30;47m'
RED='\E[31;47m'
GREEN='\E[32;47m'
YELLOW='\E[33;47m'
BLUE='\E[34;47m'
MAGENTA='\E[35;47m'
CYAN='\E[36;47m'
WHITE='\E[37;47m'
source "$HOME/.zsh_exports"
source "$HOME/.zsh_config"
source "$HOME/.zsh_aliases"
source "$HOME/.zsh_functions"

@garrettmac
Copy link
Author

zshrc exports

#!bin/zsh
# export ANDROID_HOME=/Users/vyga/Library/android-sdk-macosx:/Users/vyga/Library/Android/sdk:$PATH
# export PATH="/Users/vyga/.node/lib/node_modules/ios-sim:/Users/vyga/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/bin:/opt/X11/bin:/Users/vyga/Library/Android/sdk/platform-tools"
# export ANDROID_HOME=/Users/vyga/ant:/Users/vyga/Library/Android/sdk:/Users/vyga/Library/Android/sdk/build-tools/23.0.2:/Users/vyga/Library/Android/sdk/build-tools:/Users/vyga/Library/Android/sdk/tools:/Users/vyga/Library/Android/sdk:/Users/vyga/Library/Android/sdk:/Users/vyga/Library/Android/sdk/platform-tools:$PATH
# export MANPATH="/usr/local/man:$MANPATH"

# export ZSH="$HOME/.oh-my-zsh"
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH
export ANDROID_HOME=/Users/vyga/Library/Android/sdk:$PATH
export PATH=/usr/bin/rails:/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:/Users/vyga/Library/android-sdk-macosx/platform-tools::/Users/vyga/Library/android-sdk-macosx/tools:/usr/local/bin/sbt:/usr/bin/java:/Users/vyga/Library/android-sdk-cosx/tools:/usr/local/bin/parse:/usr/local/lib:/usr/local/bin:/usr/bin:/usr/bin/bash:/Users/vyga/Library/Android/sdk:/Users/vyga/Library/Android/sdk:/Users/vyga/Library/Android/sdk/platform-tools:/usr/local/bin:/Users/vyga/Library/Android/sdk/tools:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/vyga/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/vyga/Library/Android/sdk/platform-tools:/usr/local/share/npm/bin:/Users/vyga/.node/lib/node_modules/ios-sim:/Users/vyga/lib/node_modules/ionic/bin/ionic:/Users/vyga/.node/lib/node_modules:/Users/vyga/.node/lib/node_modules/phonegap:/Users/vyga:/Users/vyga/lib:/lib/node_modules:~/lib/node_modules:/usr/local/lib/node_modules:mongodb/3.2.4/bin:$PATH
export NODE_PATH=/usr/local/lib/node_modules:$PATH
export SSH_KEY_PATH="~/.ssh/dsa_id"
# export PATH=/usr/local/lib:/usr/local/bin:/usr/local/share:$PATH

@garrettmac
Copy link
Author

zsh config

#!bin/zsh
# source "./.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
# source "./.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"

# plugins=(osx ant git nyan decode64 encode64 github npm bower grunt yeoman command-not-found dirhistory git-extras fasd history httpie)
setopt inc_append_history # save every command before it is executed
setopt share_history #retrieve the history file everytime history is called upon



## History
# HISTFILE=$HOME/.zhistory       # enable history saving on shell exit
setopt APPEND_HISTORY          # append rather than overwrite history file.
HISTSIZE=200000                  # lines of history to maintain memory
SAVEHIST=200000                  # lines of history to maintain in history file.
setopt HIST_EXPIRE_DUPS_FIRST  # allow dups, but expire old ones when I hit HISTSIZE
setopt EXTENDED_HISTORY        # save timestamp and runtime information
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search # Up
bindkey "^[[B" down-line-or-beginning-search # Down

#  this allow me to grep through my command history on zsh
#  The command 'history 1' (or 'h ls') will display the entire command history. And running 'history 1 | egrep' ls shows just those command containing ls.
SAVEHIST=200000

#   3.  Other
#   ---------------------------------------------------------------------------------
# User configuration
# DEFAULT_USER=`whoami`

# DEFAULT_USER= $(whoami)
DEFAULT_USER=vyga
# nvm
# . ~/.nvm/nvm.sh
#smart terminal

ENABLE_CORRECTION="true"
COMPLETETION_WAITING_DOTS="true"
#grunt cache
zstyle ':completion:*' use-cache yes
zstyle ':completion::complete:grunt::options:' show_grunt_path yes

@garrettmac
Copy link
Author

if [[ $ZSH_EVAL_CONTEXT == 'file' ]]; then
source "$HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "$HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
fi

@garrettmac
Copy link
Author

zsh alais

#!bin/zsh

alias az="atom ~/.zshrc"
alias sz="source ~/.zshrc"


alias s="subl ."
alias a="atom ."
alias o="open ."
alias c="clear"
# search

# basic navigation
alias out="cd .."
alias back="cd -"
alias ls='ls -GFh'
alias lls='ls -la'
alias dt="~/Desktop/"
alias xcode='open platforms/ios/*.xcodeproj'
alias vi='vim'
alias v='vim'
alias vz='vim ~/.zshrc'
alias gb='git branch'
alias gb='git branch -v'
alias gco='git checkout'

alias ib='ionic build'
alias lls='ls -la'
alias rmt='rmtrash'
alias pp="~/Desktop/portPal"


# open chrome
alias openchrome="open -a Google\ Chrome --args --disable-web-security --user-data-dir"




alias showhidden="defaults write com.apple.finder ShowAllFiles TRUE"
alias hidehidden="defaults write com.apple.finder ShowAllFiles FALSE"

#  alias macchanger="openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' | xargs sudo ifconfig en0 ether && ifconfig en0 | grep ether"
alias macchanger="ifconfig en0 | grep ether && openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' | xargs sudo ifconfig en0 ether && ifconfig en0 | grep ether"
alias macwindowssunny="ifconfig en0 | grep ether; sudo ifconfig en0 ether 00:1E:C9:35:5E:01; ifconfig en0 | grep ether"
alias macwindows="ifconfig en0 | grep ether; sudo ifconfig en0 ether 00:1E:C9:35:5E:E9; ifconfig en0 | grep ether"
alias macmacossunny="ifconfig en0 | grep ether; sudo ifconfig en0 ether 00:25:4B:E4:FE:B4; ifconfig en0 | grep ether"
alias macmacchanger="ifconfig en0 | grep ether; sudo ifconfig en0 ether 00:25:4B:E4:F9:9A; ifconfig en0 | grep ether"
alias macmacos="ifconfig en0 | grep ether; sudo ifconfig en0 ether 00:25:4b:E4:F1:E4; ifconfig en0 | grep ether"
alias mymac="ifconfig en0 | grep ether"




alias is="ionic serve -ib"
alias iss="ionic serve -isc"
alias is1="ionic serve -isc"
alias is2="ionic serve -iscp 8200 8200"
alias is3="ionic serve -iscp 8300 8300"
alias is4="ionic serve -iscp 8400 8400"
alias is5="ionic serve -iscp 8500 8500"
alias is6="ionic serve -iscp 8600 8600"
alias isb="ionic serve -iscb"
alias isb1="ionic serve -isc"
alias isb2="ionic serve -iscpb 8200 8200"
alias isb3="ionic serve -iscpb 8300 8300"
alias isb4="ionic serve -iscpb 8400 8400"
alias isb5="ionic serve -iscpb 8500 8500"
alias isb6="ionic serve -iscpb 8600 8600"
# add patform
alias aios="ionic platform add ios"
alias addios="ionic platform add ios"
alias aand="ionic platform add android"
alias addand="ionic platform add android"
# remove patform
alias removeios="ionic platform remove ios"
alias rand="ionic platform remove android && ionic platform add android"
alias rios="ionic platform remove ios && ionic platform add ios"
alias rmios="ionic platform remove ios"
# reset patform
alias readdios="ionic platform remove ios && ionic platform add ios"
alias resetios="ionic platform remove ios && ionic platform add ios"
alias resetand="ionic platform remove android && ionic platform add android"
alias readdand="ionic platform remove android && ionic platform add android"
# run patforms
alias runall="ionic emulate ios -l -c && ionic run android -l -c"
alias addapp="ionic run ios --device"
alias irad="ionic run android --device --livereload --consolelogs --serverlogs"
alias emios="ionic emulate ios --livereload --consolelogs --serverlogs"
alias ieid="ionic emulate ios --livereload --consolelogs --serverlogs"
alias runand="ionic run android -l -c -s"
alias emand="ionic run android -l -c -s"

# upload to apps.ionic.io
alias iu="ionic upload"
alias ui="ionic upload"
alias ii="ionic info"
alias ion="ionic"

alias isplash="ionic resources --splash"
alias iicon="ionic resources --icon"
alias ixcodeb=" open -a Xcode-beta ~/Desktop/portpal/platforms/ios/portPal.xcodeproj"
alias ixcode=" open -a Xcode ~/Desktop/portpal/platforms/ios/portPal.xcodeproj"
alias resreset="rm -rf resources"
alias hardreaddios="rm -rf plugins/ && rm -rf platforms/ && ionic platform remove ios && ionic platform add ios"
# alias chowncordova="sudo chmod -R 777 /Users/vyga/.config/ && sudo chown -R vyga /usr/local/lib/node_modules/cordova"
# alias chowncordova2="sudo chmod -R 777 /Users/vyga/Desktop/portpal/platforms/ios && sudo chmod -R 777 /Users/vyga/.config/ && sudo chown -R vyga /usr/local/lib/node_modules/cordova"
# managing states
alias isave="ionic state save"
alias irestore="ionic state restore"
alias iclear="ionic state clear"
alias ireset="ionic state reset"
# heroku
# alias hdall="for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done"


alias pp2=" cd ~/desktop/portpal-v2"
alias ni="npm install"
alias bi="bower install"
alias nibi="npm install && bower install"
alias niti="npm install && typings install"
alias ti="typings install"

alias seebackups="ls /Volumes/Time\ Machine\ Backups/Backups.backupdb/vyga/"
alias myip='curl ip.appspot.com'                    #  myip:         Public facing IP Address
alias netCons='lsof -i'                             #  netCons:      Show all open TCP/IP sockets
alias flushDNS='dscacheutil -flushcache'            #  flushDNS:     Flush out the DNS Cache
alias lsock='sudo /usr/sbin/lsof -i -P'             #  lsock:        Display open sockets
alias lsockU='sudo /usr/sbin/lsof -nP | grep UDP'   #  lsockU:       Display only open UDP sockets
alias lsockT='sudo /usr/sbin/lsof -nP | grep TCP'   #  lsockT:       Display only open TCP sockets
alias ipInfo0='ipconfig getpacket en0'              #  ipInfo0:      Get info on connections for en0
alias ipInfo1='ipconfig getpacket en1'              #  ipInfo1:      Get info on connections for en1
alias openPorts='sudo lsof -i | grep LISTEN'        #  openPorts:    All listening connections
alias showBlocked='sudo ipfw list'                  #  showBlocked:  All ipfw rules inc/ blocked IPs


hostinfo() {
    echo -e "\nYou are logged on ${RED}$HOST"
    echo -e "\nAdditionnal information:$NC " ; uname -a
    echo -e "\n${RED}Users logged on:$NC " ; w -h
    echo -e "\n${RED}Current date :$NC " ; date
    echo -e "\n${RED}Machine stats :$NC " ; uptime
    echo -e "\n${RED}Current network location :$NC " ; scselect
    echo -e "\n${RED}Public facing IP Address :$NC " ;myip
    #echo -e "\n${RED}DNS Configuration:$NC " ; scutil --dns
    echo
}



alias myip='curl ip.appspot.com'                    # myip:         Public facing IP Address
alias netCons='lsof -i'                             # netCons:      Show all open TCP/IP sockets
alias flushDNS='dscacheutil -flushcache'            # flushDNS:     Flush out the DNS Cache
alias lsock='sudo /usr/sbin/lsof -i -P'             # lsock:        Display open sockets
alias lsockU='sudo /usr/sbin/lsof -nP | grep UDP'   # lsockU:       Display only open UDP sockets
alias lsockT='sudo /usr/sbin/lsof -nP | grep TCP'   # lsockT:       Display only open TCP sockets
alias ipInfo0='ipconfig getpacket en0'              # ipInfo0:      Get info on connections for en0
alias ipInfo1='ipconfig getpacket en1'              # ipInfo1:      Get info on connections for en1
alias openPorts='sudo lsof -i | grep LISTEN'        # openPorts:    All listening connections
alias showBlocked='sudo ipfw list'                  # showBlocked:  All ipfw rules inc/ blocked IPs
#   ii:  display useful host related informaton
#   -------------------------------------------------------------------





# GIT
# git file history, all CHANGES THAT WHERE MADE TO THE FILE

#  eg: git remote set-url origin https://github.com/user/repo2.git
alias hnew="heroku create && git push heroku master && heroku open"
alias hall="heroku create && git push heroku master && heroku open"
alias myip="nslookup mach_name"
alias xclip="xclip -selection c"
alias shutupon="sudo nvram SystemAudioVolume='%80'"
alias gcl="git clone "
alias ipai=ionic platform add ios=""
alias rr="rm -rf"
alias rn="react-native run-ios"
alias jeks="jekyll serve -w"
alias imgtran="convert -fuzz 20% -transparent white  "
alias imgtran="convert -fuzz 10% -transparent white  "
alias unhidefile="cp . "
alias unhidefile="cp ./. "
alias rn="react-native"
alias rnrios="react-native run-ios"
alias rnios="react-native run-ios"
alias npi="package-info"
alias rnxcode="open ios/*.xcodeproj"
alias rnl="react-native link"
alias rnl="react-native link"
alias rnl="react-native link"
alias nu="npm uninstall"
alias rnu="react-native uninstall"
alias rnul="react-native unlink"
alias rni="react native install"
alias rnu="react native uninstall"
alias rnul="react native unlink"
alias rnul="react-native unlink"
alias rnu="react-native uninstall"
alias rni="react-native install"
alias ns="npm start"
alias nb="npm build"
alias nrd="npm run dev"
alias nr="npm run "
alias gphm="git push heroku master"
alias gphm="git push heroku master"
alias nrb="npm run build"
alias her-l="heroku logs -t --force-color"
alias her="heroku"
alias her-r="heroku run """
alias her-l="heroku logs --tail --force-color"
alias her-l="heroku logs --tail"
alias fnd="grep -Ril '$1' $2  --color=auto"
alias nim="npm-install-missing"
alias yi="yarn install"
alias ya="yarn add"

@garrettmac
Copy link
Author

zshrc

export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="agnoster"
source "$ZSH/oh-my-zsh.sh"
BLACK='\E[30;47m'
RED='\E[31;47m'
GREEN='\E[32;47m'
YELLOW='\E[33;47m'
BLUE='\E[34;47m'
MAGENTA='\E[35;47m'
CYAN='\E[36;47m'
WHITE='\E[37;47m'
source "$HOME/.zsh_exports"
source "$HOME/.zsh_config"
plugins=(lol npm history fasd)
source "$HOME/.zsh_aliases"
source "$HOME/.zsh_functions"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment