Commit 7441438a authored by Max Masnick's avatar Max Masnick
Browse files

merge changes from offical repo

parents 9e3776f1 1120f973
...@@ -8,6 +8,14 @@ h2. Setup ...@@ -8,6 +8,14 @@ h2. Setup
h3. The automatic installer... (do you trust me?) h3. The automatic installer... (do you trust me?)
You can install this via the command line with either `curl` or `wget`.
h4. via `curl`
@curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh@
h4. via `wget`
@wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@ @wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh@
h3. The manual way h3. The manual way
...@@ -48,7 +56,7 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo ...@@ -48,7 +56,7 @@ the "refcard":http://www.bash2zsh.com/zsh_refcard/refcard.pdf is pretty tasty fo
h3. Customization h3. Customization
If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory. If you want to override any of the default behavior, just add a new file (ending in @.zsh@) into the @custom/@ directory.
If you have many functions which go good together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin. If you have many functions which go well together you can put them as a *.plugin.zsh file in the @custom/plugins/@ directory and then enable this plugin.
If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@. If you would like to override the functionality of a plugin distributed with oh-my-zsh, create a plugin of the same name in the @custom/plugins/@ directory and it will be loaded instead of the one in @plugins/@.
......
...@@ -32,12 +32,14 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir ...@@ -32,12 +32,14 @@ zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-dir
cdpath=(.) cdpath=(.)
# use /etc/hosts and known_hosts for hostname completion # use /etc/hosts and known_hosts for hostname completion
[ -r /etc/ssh/ssh_known_hosts ] && _global_ssh_hosts=(${${${${(f)"$(</etc/ssh/ssh_known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() [ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=() [ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
hosts=( hosts=(
"$_global_ssh_hosts[@]"
"$_ssh_hosts[@]" "$_ssh_hosts[@]"
"$_etc_hosts[@]" "$_etc_hosts[@]"
`hostname` "$HOST"
localhost localhost
) )
zstyle ':completion:*:hosts' hosts $hosts zstyle ':completion:*:hosts' hosts $hosts
......
...@@ -3,11 +3,11 @@ function zsh_stats() { ...@@ -3,11 +3,11 @@ function zsh_stats() {
} }
function uninstall_oh_my_zsh() { function uninstall_oh_my_zsh() {
/bin/sh $ZSH/tools/uninstall.sh /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/uninstall.sh
} }
function upgrade_oh_my_zsh() { function upgrade_oh_my_zsh() {
/bin/sh $ZSH/tools/upgrade.sh /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh
} }
function take() { function take() {
......
...@@ -4,15 +4,21 @@ function git_prompt_info() { ...@@ -4,15 +4,21 @@ function git_prompt_info() {
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
} }
# Checks if working tree is dirty # Checks if working tree is dirty
parse_git_dirty() { parse_git_dirty() {
if [[ -n $(git status -s 2> /dev/null) ]]; then local SUBMODULE_SYNTAX=''
if [[ $POST_1_7_2_GIT -gt 0 ]]; then
SUBMODULE_SYNTAX="--ignore-submodules=dirty"
fi
if [[ -n $(git status -s ${SUBMODULE_SYNTAX} 2> /dev/null) ]]; then
echo "$ZSH_THEME_GIT_PROMPT_DIRTY" echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
else else
echo "$ZSH_THEME_GIT_PROMPT_CLEAN" echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
fi fi
} }
# Checks if there are commits ahead from remote # Checks if there are commits ahead from remote
function git_prompt_ahead() { function git_prompt_ahead() {
if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
...@@ -62,3 +68,29 @@ git_prompt_status() { ...@@ -62,3 +68,29 @@ git_prompt_status() {
fi fi
echo $STATUS echo $STATUS
} }
#compare the provided version of git to the version installed and on path
#prints 1 if input version <= installed version
#prints -1 otherwise
function git_compare_version() {
local INPUT_GIT_VERSION=$1;
local INSTALLED_GIT_VERSION
INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
INSTALLED_GIT_VERSION=($(git --version));
INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
for i in {1..3}; do
if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
echo -1
return 0
fi
done
echo 1
}
#this is unlikely to change so make it all statically assigned
POST_1_7_2_GIT=$(git_compare_version "1.7.2")
#clean up the namespace slightly by removing the checker function
unset -f git_compare_version
...@@ -3,14 +3,11 @@ HISTFILE=$HOME/.zsh_history ...@@ -3,14 +3,11 @@ HISTFILE=$HOME/.zsh_history
HISTSIZE=10000 HISTSIZE=10000
SAVEHIST=10000 SAVEHIST=10000
setopt hist_ignore_dups # ignore duplication command history list setopt append_history
setopt share_history # share command history data
setopt hist_verify
setopt inc_append_history
setopt extended_history setopt extended_history
setopt hist_expire_dups_first setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space setopt hist_ignore_space
setopt hist_verify
setopt SHARE_HISTORY setopt inc_append_history
setopt APPEND_HISTORY setopt share_history # share command history data
...@@ -16,14 +16,18 @@ ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD ...@@ -16,14 +16,18 @@ ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~" ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
#Appears when you have the prompt #Appears when you have the prompt
function precmd { function omz_termsupport_precmd {
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
} }
#Appears at the beginning of (and during) of command execution #Appears at the beginning of (and during) of command execution
function preexec { function omz_termsupport_preexec {
emulate -L zsh emulate -L zsh
setopt extended_glob setopt extended_glob
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd
title "$CMD" "%100>...>$2%<<" title "$CMD" "%100>...>$2%<<"
} }
autoload -U add-zsh-hook
add-zsh-hook precmd omz_termsupport_precmd
add-zsh-hook preexec omz_termsupport_preexec
...@@ -13,20 +13,33 @@ fpath=($ZSH/functions $ZSH/completions $fpath) ...@@ -13,20 +13,33 @@ fpath=($ZSH/functions $ZSH/completions $fpath)
# TIP: Add files you don't want in git to .gitignore # TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh) source $config_file for config_file ($ZSH/lib/*.zsh) source $config_file
# Add all defined plugins to fpath # Set ZSH_CUSTOM to the path where your custom config files
plugin=${plugin:=()} # and plugins exists, or else we will use the default custom/
for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) if [[ -z "$ZSH_CUSTOM" ]]; then
ZSH_CUSTOM="$ZSH/custom"
fi
is_plugin() {
local base_dir=$1
local name=$2
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|| test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($plugins); do
if is_plugin $ZSH_CUSTOM $plugin; then
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
elif is_plugin $ZSH $plugin; then
fpath=($ZSH/plugins/$plugin $fpath)
fi
done
# Load and run compinit # Load and run compinit
autoload -U compinit autoload -U compinit
compinit -i compinit -i
# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
if [ "$ZSH_CUSTOM" = "" ]
then
ZSH_CUSTOM="$ZSH/custom"
fi
# Load all of the plugins that were defined in ~/.zshrc # Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do for plugin ($plugins); do
...@@ -52,7 +65,12 @@ then ...@@ -52,7 +65,12 @@ then
else else
if [ ! "$ZSH_THEME" = "" ] if [ ! "$ZSH_THEME" = "" ]
then then
if [ -f "$ZSH/custom/$ZSH_THEME.zsh-theme" ]
then
source "$ZSH/custom/$ZSH_THEME.zsh-theme"
else
source "$ZSH/themes/$ZSH_THEME.zsh-theme" source "$ZSH/themes/$ZSH_THEME.zsh-theme"
fi fi
fi
fi fi
...@@ -9,6 +9,7 @@ if [[ -x `which yaourt` ]]; then ...@@ -9,6 +9,7 @@ if [[ -x `which yaourt` ]]; then
alias yaconf='yaourt -C' # Fix all configuration files with vimdiff alias yaconf='yaourt -C' # Fix all configuration files with vimdiff
# Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips # Pacman - https://wiki.archlinux.org/index.php/Pacman_Tips
alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system. alias yaupg='yaourt -Syu' # Synchronize with repositories before upgrading packages that are out of date on the local system.
alias yasu='yaourt --sucre' # Same as yaupg, but without confirmation
alias yain='yaourt -S' # Install specific package(s) from the repositories alias yain='yaourt -S' # Install specific package(s) from the repositories
alias yains='yaourt -U' # Install specific package not from the repositories but from a file alias yains='yaourt -U' # Install specific package not from the repositories but from a file
alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies alias yare='yaourt -R' # Remove the specified package(s), retaining its configuration(s) and required dependencies
......
if [ -f `brew --prefix`/etc/autojump ]; then if [ $commands[autojump] ]; then # check if autojump is installed
if [ -f /usr/share/autojump/autojump.zsh ]; then # debian and ubuntu package
. /usr/share/autojump/autojump.zsh
elif [ -f /etc/profile.d/autojump.zsh ]; then # manual installation
. /etc/profile.d/autojump.zsh
elif [ $commands[brew] -a -f `brew --prefix`/etc/autojump ]; then # mac os x with brew
. `brew --prefix`/etc/autojump . `brew --prefix`/etc/autojump
fi
fi fi
if [[ $(acpi 2&>/dev/null | grep -c '^Battery.*Discharging') -gt 0 ]] ; then
function battery_pct_remaining() { echo "$(acpi | cut -f2 -d ',' | tr -cd '[:digit:]')" }
function battery_time_remaining() { echo $(acpi | cut -f3 -d ',') }
function battery_pct_prompt() {
b=$(battery_pct_remaining)
if [ $b -gt 50 ] ; then
color='green'
elif [ $b -gt 20 ] ; then
color='yellow'
else
color='red'
fi
echo "%{$fg[$color]%}[$(battery_pct_remaining)%%]%{$reset_color%}"
}
else
error_msg='no battery'
function battery_pct_remaining() { echo $error_msg }
function battery_time_remaining() { echo $error_msg }
function battery_pct_prompt() { echo '' }
fi
fpath=($ZSH/plugins/bundler $fpath)
autoload -U compinit
compinit -i
alias be="bundle exec" alias be="bundle exec"
alias bi="bundle install" alias bi="bundle install"
alias bl="bundle list" alias bl="bundle list"
...@@ -10,7 +6,7 @@ alias bu="bundle update" ...@@ -10,7 +6,7 @@ alias bu="bundle update"
# The following is based on https://github.com/gma/bundler-exec # The following is based on https://github.com/gma/bundler-exec
bundled_commands=(cap capify cucumber foreman guard heroku nanoc rackup rails rainbows rake rspec ruby shotgun spec spork thin unicorn unicorn_rails) bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
## Functions ## Functions
...@@ -20,7 +16,7 @@ _bundler-installed() { ...@@ -20,7 +16,7 @@ _bundler-installed() {
_within-bundled-project() { _within-bundled-project() {
local check_dir=$PWD local check_dir=$PWD
while [ "$(dirname $check_dir)" != "/" ]; do while [ $check_dir != "/" ]; do
[ -f "$check_dir/Gemfile" ] && return [ -f "$check_dir/Gemfile" ] && return
check_dir="$(dirname $check_dir)" check_dir="$(dirname $check_dir)"
done done
...@@ -41,6 +37,6 @@ for cmd in $bundled_commands; do ...@@ -41,6 +37,6 @@ for cmd in $bundled_commands; do
alias $cmd=bundled_$cmd alias $cmd=bundled_$cmd
if which _$cmd > /dev/null 2>&1; then if which _$cmd > /dev/null 2>&1; then
compdef _$cmd bundled_$cmd compdef _$cmd bundled_$cmd=$cmd
fi fi
done done
...@@ -113,9 +113,6 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i' ...@@ -113,9 +113,6 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc' alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
# Functions ################################################################# # Functions #################################################################
# create a simple script that can be used to 'duplicate' a system # create a simple script that can be used to 'duplicate' a system
apt-copy() { apt-copy() {
...@@ -132,6 +129,41 @@ apt-copy() { ...@@ -132,6 +129,41 @@ apt-copy() {
chmod +x apt-copy.sh chmod +x apt-copy.sh
} }
# Prints apt history
# Usage:
# apt-history install
# apt-history upgrade
# apt-history remove
# apt-history rollback
# apt-history list
# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
apt-history () {
case "$1" in
install)
zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
;;
upgrade|remove)
zgrep --no-filename $1 $(ls -rt /var/log/dpkg*)
;;
rollback)
zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) | \
grep "$2" -A10000000 | \
grep "$3" -B10000000 | \
awk '{print $4"="$5}'
;;
list)
zcat $(ls -rt /var/log/dpkg*)
;;
*)
echo "Parameters:"
echo " install - Lists all packages that have been installed."
echo " upgrade - Lists all packages that have been upgraded."
echo " remove - Lists all packages that have been removed."
echo " rollback - Lists rollback information."
echo " list - Lists all contains of dpkg logs."
;;
esac
}
# Kernel-package building shortcut # Kernel-package building shortcut
kerndeb () { kerndeb () {
......
...@@ -220,3 +220,4 @@ _managepy() { ...@@ -220,3 +220,4 @@ _managepy() {
compdef _managepy manage.py compdef _managepy manage.py
compdef _managepy django compdef _managepy django
compdef _managepy django-manage
...@@ -78,8 +78,3 @@ function extract() { ...@@ -78,8 +78,3 @@ function extract() {
alias x=extract alias x=extract
# add extract completion function to path
fpath=($ZSH/plugins/extract $fpath)
autoload -U compinit
compinit -i
...@@ -9,7 +9,7 @@ alias gup='git fetch && git rebase' ...@@ -9,7 +9,7 @@ alias gup='git fetch && git rebase'
compdef _git gup=git-fetch compdef _git gup=git-fetch
alias gp='git push' alias gp='git push'
compdef _git gp=git-push compdef _git gp=git-push
gdv() { git-diff -w "$@" | view - } gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff compdef _git gdv=git-diff
alias gc='git commit -v' alias gc='git commit -v'
compdef _git gc=git-commit compdef _git gc=git-commit
...@@ -17,6 +17,7 @@ alias gca='git commit -v -a' ...@@ -17,6 +17,7 @@ alias gca='git commit -v -a'
compdef _git gca=git-commit compdef _git gca=git-commit
alias gco='git checkout' alias gco='git checkout'
compdef _git gco=git-checkout compdef _git gco=git-checkout
alias gcm='git checkout master'
alias gb='git branch' alias gb='git branch'
compdef _git gb=git-branch compdef _git gb=git-branch
alias gba='git branch -a' alias gba='git branch -a'
...@@ -35,6 +36,8 @@ alias ga='git add' ...@@ -35,6 +36,8 @@ alias ga='git add'
compdef _git ga=git-add compdef _git ga=git-add
alias gm='git merge' alias gm='git merge'
compdef _git gm=git-merge compdef _git gm=git-merge
alias grh='git reset HEAD'
alias grhh='git reset HEAD --hard'
# Git and svn mix # Git and svn mix
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
......
# Setup hub function for git, if it is available; http://github.com/defunkt/hub # Setup hub function for git, if it is available; http://github.com/defunkt/hub
if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
# eval `hub alias -s zsh` # eval `hub alias -s zsh`
function git(){hub "$@"} function git(){
if ! (( $+_has_working_hub )); then
hub --version &> /dev/null
_has_working_hub=$(($? == 0))
fi
if (( $_has_working_hub )) ; then
hub "$@"
else
command git "$@"
fi
}
fi fi
# Functions ################################################################# # Functions #################################################################
......
#---oh-my-zsh plugin : task Autocomplete for Jake tool---
# Jake : https://github.com/mde/jake
# Warning : Jakefile should have the right case : Jakefile or jakefile
# Tested on : MacOSX 10.7 (Lion), Ubuntu 11.10
# Author : Alexandre Lacheze (@al3xstrat)
# Inspiration : http://weblog.rubyonrails.org/2006/3/9/fast-rake-task-completion-for-zsh
function _jake () {
if [ -f Jakefile ]||[ -f jakefile ]; then
compadd `jake -T | cut -d " " -f 2 | sed -E "s/.\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"`
fi
}
compdef _jake jake
\ No newline at end of file
...@@ -26,7 +26,7 @@ _knife() { ...@@ -26,7 +26,7 @@ _knife() {
case $state in case $state in
knifecmd) knifecmd)
compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
;; ;;
knifesubcmd) knifesubcmd)
case $words[2] in case $words[2] in
...@@ -42,6 +42,9 @@ _knife() { ...@@ -42,6 +42,9 @@ _knife() {
cookbook) cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
;; ;;
environment)
compadd -Q "$@" list create delete edit show "from file"
;;
node) node)
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete" compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
;; ;;
...@@ -138,27 +141,31 @@ _knife_options3() { ...@@ -138,27 +141,31 @@ _knife_options3() {
# The chef_x_remote functions use knife to get a list of objects of type x on the server # The chef_x_remote functions use knife to get a list of objects of type x on the server
_chef_roles_remote() { _chef_roles_remote() {
(knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_clients_remote() { _chef_clients_remote() {
(knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_nodes_remote() { _chef_nodes_remote() {
(knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_cookbooks_remote() { _chef_cookbooks_remote() {
(knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_sitecookbooks_remote() { _chef_sitecookbooks_remote() {
(knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
} }
_chef_data_bags_remote() { _chef_data_bags_remote() {
(knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}') (knife data bag list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_environments_remote() {
(knife environment list | awk '{print $1}')
} }
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server # The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
......
# Mercurial # Mercurial
alias hgc='hg commit -v' alias hgc='hg commit'
alias hgb='hg branch -v' alias hgb='hg branch'
alias hgba='hg branches' alias hgba='hg branches'
alias hgco='hg checkout' alias hgco='hg checkout'
alias hgd='hg diff' alias hgd='hg diff'
alias hged='hg diffmerge' alias hged='hg diffmerge'
# pull and update # pull and update
alias hgl='hg pull -u -v' alias hgl='hg pull -u'
alias hgp='hg push -v' alias hgp='hg push'
alias hgs='hg status -v' alias hgs='hg status'
# this is the 'git commit --amend' equivalent # this is the 'git commit --amend' equivalent
alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip' alias hgca='hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip'
if [[ -x `which nc` ]]; then
alias nyan='nc -v miku.acm.uiuc.edu 23' # nyan cat
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment