From ea03ebc291ce0a77fabac7b7cb6f07e17b610656 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Thu, 5 Oct 2017 13:17:39 +0200 Subject: [PATCH] Bash stuff --- bash/alias.bash | 6 ++++-- bash/bashrc.bash | 14 ++++++++------ bash/functions_internal.bash | 9 +++++++-- bash/history.bash | 2 +- bash/path.bash | 6 +++--- bin/chmod-help | 0 bin/cron-help | 10 ++++++++++ bin/flush-route-table | 4 ++++ 8 files changed, 37 insertions(+), 14 deletions(-) mode change 100644 => 100755 bin/chmod-help create mode 100755 bin/cron-help create mode 100755 bin/flush-route-table diff --git a/bash/alias.bash b/bash/alias.bash index 14010b8..520479c 100644 --- a/bash/alias.bash +++ b/bash/alias.bash @@ -1,7 +1,9 @@ # General alias ll="ls -lAFh" -alias subl="/Applications/Sublime\ Text\ 3.app/Contents/SharedSupport/bin/subl" +alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" +alias sub="subl ." +alias sdot="subl ~/Dotfiles" # Git alias git="git-achievements" @@ -16,7 +18,7 @@ alias gp="git push" alias gs="git status -sb" alias gu="git up" alias gcl="git co -" -alias gml="git merge -" +alias gml="git merge - --no-edit" # Ruby alias bd="bundle install --jobs=8 --path vendor/bundle" diff --git a/bash/bashrc.bash b/bash/bashrc.bash index 7675558..f82a64f 100644 --- a/bash/bashrc.bash +++ b/bash/bashrc.bash @@ -1,3 +1,6 @@ +# Enable debug +# set -xv + export TERM=xterm-256color export EDITOR=vim @@ -9,10 +12,11 @@ export EDITOR=vim export PROJECTS=$HOME/Code # Go -export GOROOT=$PROJECTS/go -export GOPATH=$HOME/go +export GOROOT=/usr/local/golang +export GOPATH=/usr/local/gopath +export CGO_ENABLED=0 -export SSL_CERT_FILE="/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt" +# Bash stuff function __bash_import { source $HOME/.bash/$1.bash; } __bash_import "functions_internal" @@ -36,6 +40,4 @@ fi # Misc # -# . $HOME/.config/on_reboot.sh - -test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" +# export SSL_CERT_FILE="/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt" diff --git a/bash/functions_internal.bash b/bash/functions_internal.bash index 6ac84de..0e18847 100644 --- a/bash/functions_internal.bash +++ b/bash/functions_internal.bash @@ -1,6 +1,6 @@ function __bash_basedir { local full=$(pwd) - if [ $full == "/" ] + if [ "$full" == "/" ] then echo $full else @@ -13,5 +13,10 @@ function __bash_escape { } function __bash_is_empty { - if [ "$1" == "" ]; then return 0; else return 1; fi + if [ "$1" == "" ] + then + return 0 + else + return 1 + fi } diff --git a/bash/history.bash b/bash/history.bash index 1b4a1d5..17f7574 100644 --- a/bash/history.bash +++ b/bash/history.bash @@ -1,6 +1,6 @@ shopt -s histappend # Append history instead of rewriting it shopt -s cmdhist # Use one command per line -HISTCONTROL=ignoreboth # Don’t store specific lines +HISTCONTROL=ignoreboth # Don’t store specific lines (ignoredups + ignorespace) HISTTIMEFORMAT='%F %T ' # Record timestamps HISTFILESIZE=1000000 # Allow a larger history file HISTSIZE=1000000 # Allow a longer history diff --git a/bash/path.bash b/bash/path.bash index 0236d40..f6b62a0 100644 --- a/bash/path.bash +++ b/bash/path.bash @@ -1,16 +1,16 @@ export PATH=/usr/local/bin:$PATH # Homebrew tools export PATH=$PATH:/usr/local/sbin # Homebrew apps -export PATH=$PATH:$HOME/.dotfiles/bin # My stuff +export PATH=$PATH:$HOME/Dotfiles/bin # My stuff # NodeJS # export PATH=$PATH:/usr/local/share/npm/bin # Ruby -export PATH=$PATH:$HOME/.rbenv/plugins/ruby-build/bin # rbenv plugins +export PATH=$HOME/.rbenv/versions/2.4.0/bin:$PATH # Gem binaries export PATH=$HOME/.rbenv/shims:$PATH # Gem binaries # git achievements -export PATH=$PATH:$HOME/.misc/git-achievements +export PATH=$PATH:$PROJECTS/git-achievements # Go export PATH=$PATH:$GOROOT/bin # Go runtime binaries diff --git a/bin/chmod-help b/bin/chmod-help old mode 100644 new mode 100755 diff --git a/bin/cron-help b/bin/cron-help new file mode 100755 index 0000000..d76ac3a --- /dev/null +++ b/bin/cron-help @@ -0,0 +1,10 @@ +#!/bin/bash +cat <