From 52a306784a331855c9a01362904afddd9c166b12 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Wed, 8 Feb 2017 17:38:37 +0000 Subject: [PATCH 01/11] Try and make ncmpcpp current playing song more visible --- ncmpcpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ncmpcpp b/ncmpcpp index e158d15..04bcc05 100644 --- a/ncmpcpp +++ b/ncmpcpp @@ -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} # -#now_playing_prefix = $b +now_playing_prefix = $r # -#now_playing_suffix = $/b +now_playing_suffix = $/r # #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 # From b822957a80c6c2c439341cc99aecbfb22b404b22 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Tue, 14 Feb 2017 23:11:34 +0000 Subject: [PATCH 02/11] Fix VTE error on terminix --- zshrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zshrc b/zshrc index 017857c..035435b 100644 --- a/zshrc +++ b/zshrc @@ -58,6 +58,11 @@ bindkey -v # Source the untracked `extra` file 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 platform="unkown" unamestr=$(uname -s) From 3d57591a6a0b86d0152f29b88d3ff84b3715bcbe Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 17 Feb 2017 21:23:37 +0000 Subject: [PATCH 03/11] Use OS dependent valur for GOPATH --- zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 035435b..3648584 100644 --- a/zshrc +++ b/zshrc @@ -151,7 +151,8 @@ auto-ls () { chpwd_functions=( auto-ls $chpwd_functions ) # 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" # GnuPG stuff From 297ac5e14c47e8f45446b2242b1592bfa3e6e300 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Tue, 7 Mar 2017 23:15:25 +0000 Subject: [PATCH 04/11] Add an alias to show all aliases --- gitconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitconfig b/gitconfig index 1ba6c61..ba46140 100644 --- a/gitconfig +++ b/gitconfig @@ -1,5 +1,7 @@ [alias] + # list aliases + aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort # lg lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset' # lg2 From b791dfacf3495da1363a6f41c1ba85d54d56f583 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Wed, 8 Mar 2017 13:27:03 +0000 Subject: [PATCH 05/11] Add some more aliases --- gitconfig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gitconfig b/gitconfig index ba46140..ab18430 100644 --- a/gitconfig +++ b/gitconfig @@ -2,12 +2,14 @@ # list aliases aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort - # lg + 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' - # 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 - # lastchange 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] From 1396b04eca0c0c5fcdf0aa731a6e57f4fcd11507 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Thu, 25 May 2017 14:17:21 +0100 Subject: [PATCH 06/11] Add some git aliases --- zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zshrc b/zshrc index 3648584..e7c41df 100644 --- a/zshrc +++ b/zshrc @@ -126,6 +126,9 @@ alias bubc="brew upgrade && brew cleanup" alias bubo="brew update && brew outdated" alias brewcurl="/usr/local/opt/curl/bin/curl --cacert /usr/local/etc/openssl/cert.pem" alias brewssl="/usr/local/opt/openssl/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'" test "$platform" = 'linux' && alias ls="ls -F --color=always" test "$platform" = 'osx' && alias ls="ls -FG" From b66e74a53d8be5c838b9376a1f91153bc02d869c Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 23 Jun 2017 12:46:22 +0100 Subject: [PATCH 07/11] Add ruby gems to the PATH --- zshrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zshrc b/zshrc index e7c41df..b7aafa2 100644 --- a/zshrc +++ b/zshrc @@ -172,6 +172,9 @@ export PATH="$PATH:$HOME/.yarn/bin" # rust/cargo bin PATH 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) export DEFAULT_USER="jonny" From 542cda73e6ed46ec2d64ab6712b7fee409d35d4e Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Mon, 3 Jul 2017 17:32:01 +0100 Subject: [PATCH 08/11] Add spellcheck to git commit messages --- vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 7ec5402..ee6d0c3 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -193,6 +193,10 @@ nnoremap :echomsg "use j" nnoremap :echomsg "use j" nnoremap :echomsg "use l" +" And spell-checking +autocmd FileType gitcommit setlocal spell +set complete+=kspell + " Keymap to open NERDtree map :NERDTreeToggle " Autoclose when NERDtree is the last buffer From e7020db02d6ac7858474a135a7e5d92392569327 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Thu, 6 Jul 2017 10:43:40 +0100 Subject: [PATCH 09/11] Platform specific GO paths --- zshrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index 15e1943..5f72384 100644 --- a/zshrc +++ b/zshrc @@ -146,8 +146,10 @@ auto-ls () { chpwd_functions=( auto-ls $chpwd_functions ) # Go Lang stuff -export GOPATH=$HOME/Development/go -export PATH="$PATH:/usr/local/opt/go/libexec/bin:$GOPATH/bin" +test "$platform" = 'osx' && export GOPATH="$HOME/Development/go" +test "$platform" = 'osx' && export PATH="$PATH:/usr/local/opt/go/libexec/bin:$GOPATH/bin" +test "$platform" = 'linux' && export GOPATH="$HOME/mygo" +test "$platform" = 'linux' && export PATH="$PATH:/usr/lib/go-1.7/bin:$GOPATH/bin" # GnuPG stuff GPG_TTY=`tty` From 05b91483132aeb4799c4c04ddad59300744312a2 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 7 Jul 2017 12:56:51 +0100 Subject: [PATCH 10/11] Remove phpunit alias --- zshrc | 1 - 1 file changed, 1 deletion(-) diff --git a/zshrc b/zshrc index b7aafa2..d9b8fbe 100644 --- a/zshrc +++ b/zshrc @@ -132,7 +132,6 @@ alias gs="git status" alias irc="ssh jmb -t '. ~/.zshrc; tmux attach -t irc'" test "$platform" = 'linux' && alias ls="ls -F --color=always" 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" = 'osx' && alias pipup="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U" alias rtor="tmux attach -t rtor" From 2cbef96dc0bff01375b6a33d1c957d7f339b3edf Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Mon, 11 Sep 2017 14:23:28 +0100 Subject: [PATCH 11/11] Add a functions file for custom actions --- bootstrap.sh | 1 + functions.zsh | 29 +++++++++++++++++++++++++++++ zshrc | 3 +++ 3 files changed, 33 insertions(+) create mode 100644 functions.zsh diff --git a/bootstrap.sh b/bootstrap.sh index 0e5cc90..c4e365a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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 -d $HOME/.ncmpcpp || mkdir $HOME/.ncmpcpp 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 # ln vim files diff --git a/functions.zsh b/functions.zsh new file mode 100644 index 0000000..4038253 --- /dev/null +++ b/functions.zsh @@ -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' +} \ No newline at end of file diff --git a/zshrc b/zshrc index d9b8fbe..092ee5c 100644 --- a/zshrc +++ b/zshrc @@ -190,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 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