merge origin/master

This commit is contained in:
Jonny Barnes 2017-09-28 16:02:58 +01:00
commit e86603dac3
6 changed files with 61 additions and 9 deletions

View file

@ -14,6 +14,7 @@ test -L $HOME/.gitignore || ln -f -s $BASEDIR/gitignore $HOME/.gitignore
test -L $HOME/.hushlogin || ln -f -s $BASEDIR/hushlogin $HOME/.hushlogin test -L $HOME/.hushlogin || ln -f -s $BASEDIR/hushlogin $HOME/.hushlogin
test -d $HOME/.ncmpcpp || mkdir $HOME/.ncmpcpp test -d $HOME/.ncmpcpp || mkdir $HOME/.ncmpcpp
test -L $HOME/.ncmpcpp/config || ln -f -s $BASEDIR/ncmpcpp $HOME/.ncmpcpp/config test -L $HOME/.ncmpcpp/config || ln -f -s $BASEDIR/ncmpcpp $HOME/.ncmpcpp/config
test -L $HOME/.functions.zsh || ln -f -s $BASEDIR/functions.zsh $HOME/.functions.zsh
test -L $HOME/.zshrc || ln -f -s $BASEDIR/zshrc $HOME/.zshrc test -L $HOME/.zshrc || ln -f -s $BASEDIR/zshrc $HOME/.zshrc
# ln vim files # ln vim files

29
functions.zsh Normal file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env zsh
# Functions
# Generate TLS certs using a local CA
gencert () {
DOMAIN=$1
test -d /Users/jonny/Development/localCA && ROOT='/Users/jonny/Development/localCA'
test -d /home/jonny/git/ca && ROOT='/home/jonny/git/ca'
test -d /usr/local/opt/openssl@1.1/bin && PATH='/usr/local/opt/openssl@1.1/bin':$PATH
test -f /usr/local/etc/openssl@1.1/openssl.cnf && SSLCNF='/usr/local/etc/openssl@1.1/openssl.cnf'
test -f /etc/ssl/openssl.cnf && SSLCNF='/etc/ssl/openssl.cnf'
cd $ROOT
[[ ! -d $DOMAIN ]] && mkdir $DOMAIN
cd $DOMAIN
[[ -f key ]] && mv key key.bak
[[ -f csr ]] && mv csr csr.bak
[[ -f crt ]] && mv crt crt.bak
openssl ecparam -name secp384r1 -genkey -noout -out key
chmod 644 key
openssl req -new -sha256 -key key -subj "/C=UK/ST=England/L=Darwen/O=JMB Dev Ltd/CN=$DOMAIN" -reqexts SAN -config <(cat $SSLCNF <(printf "[SAN]\nsubjectAltName=DNS:$DOMAIN")) -out csr
openssl x509 -req -in csr -extfile <(cat $SSLCNF <(printf "[SAN]\nsubjectAltName=DNS:$DOMAIN")) -extensions SAN -CA ../jmb-ca-ecc.pem -CAkey ../jmb-ca-ecc.key -CAcreateserial -days 90 -sha256 -out crt
cd $HOME
echo 'Certs generated for $DOMAIN'
}

View file

@ -1,11 +1,15 @@
[alias] [alias]
# lg # list aliases
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset' lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset'
# lg2
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
# lastchange
lastchange = log -p --follow -n 1 lastchange = log -p --follow -n 1
plog = log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'
rank = shortlog -sn --no-merges
st = status -sb
tlog = log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative
[apply] [apply]

View file

@ -205,15 +205,15 @@ message_delay_time = 5
# #
#alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D} #alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
# #
#now_playing_prefix = $b now_playing_prefix = $r
# #
#now_playing_suffix = $/b now_playing_suffix = $/r
# #
#browser_playlist_prefix = "$2playlist$9 " #browser_playlist_prefix = "$2playlist$9 "
# #
#selected_item_prefix = $6 selected_item_prefix = $6
# #
#selected_item_suffix = $9 selected_item_suffix = $9
# #
#modified_item_prefix = $3> $9 #modified_item_prefix = $3> $9
# #

View file

@ -199,6 +199,10 @@ nnoremap <Down> :echomsg "use j"<cr>
nnoremap <Left> :echomsg "use j"<cr> nnoremap <Left> :echomsg "use j"<cr>
nnoremap <Right> :echomsg "use l"<cr> nnoremap <Right> :echomsg "use l"<cr>
" And spell-checking
autocmd FileType gitcommit setlocal spell
set complete+=kspell
" Keymap to open NERDtree " Keymap to open NERDtree
map <C-n> :NERDTreeToggle<cr> map <C-n> :NERDTreeToggle<cr>
" Autoclose when NERDtree is the last buffer " Autoclose when NERDtree is the last buffer

18
zshrc
View file

@ -58,6 +58,11 @@ bindkey -v
# Source the untracked `extra` file # Source the untracked `extra` file
test -e $HOME/.extra && source $HOME/.extra test -e $HOME/.extra && source $HOME/.extra
# Source VTE for Terminix
if [ $TERMINIX_ID ] || [ $VTE_VERSION ]; then
source /etc/profile.d/vte.sh
fi
# Determine the running OS # Determine the running OS
platform="unkown" platform="unkown"
unamestr=$(uname -s) unamestr=$(uname -s)
@ -121,10 +126,12 @@ alias bubc="brew upgrade && brew cleanup"
alias bubo="brew update && brew outdated" alias bubo="brew update && brew outdated"
alias brewcurl="/usr/local/opt/curl/bin/curl --cacert /usr/local/etc/openssl/cert.pem" alias brewcurl="/usr/local/opt/curl/bin/curl --cacert /usr/local/etc/openssl/cert.pem"
alias brewssl="/usr/local/opt/openssl@1.1/bin/openssl" alias brewssl="/usr/local/opt/openssl@1.1/bin/openssl"
alias ga="git add"
alias gf="git fetch --all; git fetch --tags"
alias gs="git status"
alias irc="ssh jmb -t '. ~/.zshrc; tmux attach -t irc'" alias irc="ssh jmb -t '. ~/.zshrc; tmux attach -t irc'"
test "$platform" = 'linux' && alias ls="ls -F --color=always" test "$platform" = 'linux' && alias ls="ls -F --color=always"
test "$platform" = 'osx' && alias ls="ls -FG" test "$platform" = 'osx' && alias ls="ls -FG"
alias phpunit="phpdbg -qrr vendor/bin/phpunit"
test "$platform" = 'linux' && alias pipup="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo pip install -U" test "$platform" = 'linux' && alias pipup="pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo pip install -U"
test "$platform" = 'osx' && alias pipup="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U" test "$platform" = 'osx' && alias pipup="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U"
alias rtor="tmux attach -t rtor" alias rtor="tmux attach -t rtor"
@ -146,7 +153,8 @@ auto-ls () {
chpwd_functions=( auto-ls $chpwd_functions ) chpwd_functions=( auto-ls $chpwd_functions )
# Go Lang stuff # Go Lang stuff
export GOPATH=$HOME/Development/go test "$platform" = 'linux' && export GOPATH=$HOME/go
test "$platform" = 'osx' && export GOPATH=$HOME/Development/go
export PATH="$PATH:/usr/local/opt/go/libexec/bin:$GOPATH/bin" export PATH="$PATH:/usr/local/opt/go/libexec/bin:$GOPATH/bin"
# GnuPG stuff # GnuPG stuff
@ -163,6 +171,9 @@ export PATH="$PATH:$HOME/.yarn/bin"
# rust/cargo bin PATH # rust/cargo bin PATH
export PATH="$PATH:$HOME/.cargo/bin" export PATH="$PATH:$HOME/.cargo/bin"
# Ruby PATH
export PATH="$PATH:$HOME/.gem/ruby/2.4.0/bin"
# Set the DEFAULT_USER variable to me (jonny) # Set the DEFAULT_USER variable to me (jonny)
export DEFAULT_USER="jonny" export DEFAULT_USER="jonny"
@ -179,4 +190,7 @@ export LS_COLORS='di=33;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43
# They are packaged correctly for Arch Linux # They are packaged correctly for Arch Linux
test "$platform" = 'osx' && fpath=(/usr/local/share/zsh-completions $fpath) test "$platform" = 'osx' && fpath=(/usr/local/share/zsh-completions $fpath)
# Source my own functions
test -e $HOME/.functions.zsh && source $HOME/.functions.zsh
test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh test -e ${HOME}/.iterm2_shell_integration.zsh && source ${HOME}/.iterm2_shell_integration.zsh