WS-2017.2 <fergalm@localhost Overwrite remote git@github.com:fergalmoran/dotfiles.git to local

This commit is contained in:
Fergal Moran
2017-08-21 19:35:44 +01:00
parent b72d64124c
commit 02ed9ee573
30 changed files with 0 additions and 1129 deletions

3
.gitignore vendored
View File

@@ -1,3 +0,0 @@
pwfonts/
bin/bin
.private.env

View File

@@ -1 +0,0 @@
My unix dotfiles (check vimfiles for my vim config)

View File

@@ -1,77 +0,0 @@
IP=$(hostname -I | cut -d' ' -f1)
HOSTNAME=`hostname -s`
alias ls="ls -alh"
#Django stuff
alias djrun="source /home/fergalm/dev/personal/deepsouthsounds.com/dss.docker/api_env && python manage.py runserver 0.0.0.0:8001"
alias djshell="python manage.py shell_plus --use-pythonrc --ipython"
alias djdb="python manage.py dbshell"
alias djmigrate="python manage.py schemamigration spa --auto"
alias wole="source ./env/bin/activate"
alias dss="cd ~/dev/personal/deepsouthsounds.com/dss.api && workon dss.api"
alias dss_radio="cd ~/dev/personal/deepsouthsounds.com/dss.radio && workon dss.radio && docker start dssdocker_icecast_1"
alias pgdo="sudo -u postgres"
alias pgadmin="docker run -it --rm -v /home/fergalm/working/pgadmin-data:/pgadmin-data --net=host fergalmoran/pgadmin4:latest; xdg-open http://localhost:5050"
alias runmssql="docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=cTXu1nJLCpC/c' -p 1433:1433 -v /home/fergalm/working/mssql-data:/var/opt/mssql -d microsoft/mssql-server-linux"
alias tor="docker run -i -t --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:ro paulczar/torbrowser"
alias sqlw="/opt/SqlWorkbench/sqlworkbench.sh &"
alias se="/opt/StorageExplorer/StorageExplorer > /dev/null 2>&1 &"
alias dbv="dbeaver > /dev/null 2>&1 &"
alias rsl="rslsync --config /home/fergalm/.config/resilio-sync/config.json"
alias reloadbashrc="source ~/.bashrc"
alias server="livereload -p 9999 --host $IP"
alias upd="sudo apt update && sudo apt dist-upgrade && sudo apt autoremove"
alias psql="sudo -u postgres psql deepsouthsounds"
alias code="/usr/bin/code-insiders"
alias c="/usr/bin/code-insiders ."
alias dbstatus="dropbox.py status"
alias dbignore='find `pwd` -type d -regex ".*\(node_modules\|temp\|tmp\|bower_components\|cache\)$" -prune -exec dropbox exclude add {} \;'
alias dbrm="find . -name \*\'s\ conflicted\ copy\ \* -exec rm {} \;"
alias ping="ping -O"
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
alias iotop='sudo iotop'
alias rmq=' sudo rabbitmqctl'
alias congo='node /srv/dev/working/congo/server.js'
alias zap='/home/fergalm/working/ZAP/zap.sh > /dev/null 2>&1 &'
alias git-browse="xdg-open \`git remote -v | grep git@github.com | grep fetch | head -1 | cut -f2 | cut -d' ' -f1 | sed -e's/:/\//' -e 's/git@/http:\/\//'\`"
alias andconnect='adb connect 10.1.1.102:5555'
doAgFind(){
ag --ignore-dir node_modules --ignore-dir bower_components $1
}
alias ag=doAgFind
doGrepSearch(){
find | grep $1
}
alias f=doGrepSearch
doPsKill(){
sudo ps aux | grep -ie $1 | awk '{print $2}' | xargs kill -9
}
alias pskill=doPsKill
alias dcx="docker-compose -H podnoms.com:2376 --tlsverify --tlscacert /mnt/niles/sharing/docker-tls/podnoms/ca.pem --tlscert /mnt/niles/sharing/docker-tls/podnoms/cert.pem --tlskey /mnt/niles/sharing/docker-tls/podnoms/key.pem"
case $HOSTNAME in
(NILES) alias dockerx="docker --tlsverify -H=podnoms.com:2376 --tlscacert=/srv/sharing/docker-tls/podnoms/ca.pem --tlscert=/srv/sharing/docker-tls/podnoms/cert.pem --tlskey=/srv/sharing/docker-tls/podnoms/key.pem";;
(EDDIE) alias dockerx="docker --tlsverify -H=podnoms.com:2376 --tlscacert=/mnt/niles/sharing/docker-tls/podnoms/ca.pem --tlscert=/mnt/niles/sharing/docker-tls/podnoms/cert.pem --tlskey=/mnt/niles/sharing/docker-tls/podnoms/key.pem";;
esac
if type "$docker" > /dev/null; then
alias docker-nuke="docker rm $(docker ps -a -q) && docker rmi $(docker images -q)"
alias dc='docker-compose'
alias docker-rm-untagged='docker rmi -f $(docker images | grep "^<none>" | awk "{print $3}")'
fi
alias tmux="TERM=screen-256color-bce tmux attach || TERM=screen-256color-bce tmux"

View File

@@ -1,37 +0,0 @@
function pips() {
echo $'\n'$1 >> requirements.txt; pip install $1
}
cb() {
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m'
# Check that xclip is installed.
if ! type xclip > /dev/null 2>&1; then
echo -e "$_wrn_col""You must have the 'xclip' program installed.\e[0m"
# Check user is not root (root doesn't have access to user xorg server)
elif [[ "$USER" == "root" ]]; then
echo -e "$_wrn_col""Must be regular user (not root) to copy a file to the clipboard.\e[0m"
else
# If no tty, data should be available on stdin
if ! [[ "$( tty )" == /dev/* ]]; then
input="$(< /dev/stdin)"
# Else, fetch input from params
else
input="$*"
fi
if [ -z "$input" ]; then # If no input, print usage message.
echo "Copies a string to the clipboard."
echo "Usage: cb <string>"
echo " echo <string> | cb"
else
# Copy input to clipboard
echo -n "$input" | xclip -selection c
# Truncate text for status
if [ ${#input} -gt 80 ]; then input="$(echo $input | cut -c1-80)$_trn_col...\e[0m"; fi
# Print status.
echo -e "$_scs_col""Copied to clipboard:\e[0m $input"
fi
fi
}
function gi() { curl -L -s https://www.gitignore.io/api/\$@ ;}

View File

@@ -1,45 +0,0 @@
# NODE-COMPLETE
# Custom command line tab completion for Node.js
#
shopt -s progcomp
for f in $(command ls ~/.node-completion); do
f="$HOME/.node-completion/$f"
test -f "$f" && . "$f"
done
#
# NODE-COMPLETE
# Custom command line tab completion for Node.js
#
shopt -s progcomp
for f in $(command ls ~/.node-completion); do
f="$HOME/.node-completion/$f"
test -f "$f" && . "$f"
done
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
_byobu_sourced=1 . /usr/bin/byobu-launch 2>/dev/null || true

View File

@@ -1,269 +0,0 @@
#!/usr/bin/env bash
# Sexy bash prompt by twolfson
# https://github.com/twolfson/sexy-bash-prompt
# Forked from gf3, https://gist.github.com/gf3/306785
# If we are on a colored terminal
if tput setaf 1 &> /dev/null; then
# Reset the shell from our `if` check
tput sgr0 &> /dev/null
# If you would like to customize your colors, use
# # Attribution: http://linuxtidbits.wordpress.com/2008/08/11/output-color-on-bash-scripts/
# for i in $(seq 0 $(tput colors)); do
# echo " $(tput setaf $i)Text$(tput sgr0) $(tput bold)$(tput setaf $i)Text$(tput sgr0) $(tput sgr 0 1)$(tput setaf $i)Text$(tput sgr0) \$(tput setaf $i)"
# done
# Save common color actions
sexy_bash_prompt_bold="$(tput bold)"
sexy_bash_prompt_reset="$(tput sgr0)"
# If the terminal supports at least 256 colors, write out our 256 color based set
if [[ "$(tput colors)" -ge 256 ]] &> /dev/null; then
sexy_bash_prompt_user_color="$sexy_bash_prompt_bold$(tput setaf 27)" # BOLD BLUE
sexy_bash_prompt_preposition_color="$sexy_bash_prompt_bold$(tput setaf 7)" # BOLD WHITE
sexy_bash_prompt_device_color="$sexy_bash_prompt_bold$(tput setaf 39)" # BOLD CYAN
sexy_bash_prompt_dir_color="$sexy_bash_prompt_bold$(tput setaf 76)" # BOLD GREEN
sexy_bash_prompt_git_status_color="$sexy_bash_prompt_bold$(tput setaf 154)" # BOLD YELLOW
sexy_bash_prompt_git_progress_color="$sexy_bash_prompt_bold$(tput setaf 9)" # BOLD RED
else
# Otherwise, use colors from our set of 8
sexy_bash_prompt_user_color="$sexy_bash_prompt_bold$(tput setaf 4)" # BOLD BLUE
sexy_bash_prompt_preposition_color="$sexy_bash_prompt_bold$(tput setaf 7)" # BOLD WHITE
sexy_bash_prompt_device_color="$sexy_bash_prompt_bold$(tput setaf 6)" # BOLD CYAN
sexy_bash_prompt_dir_color="$sexy_bash_prompt_bold$(tput setaf 2)" # BOLD GREEN
sexy_bash_prompt_git_status_color="$sexy_bash_prompt_bold$(tput setaf 3)" # BOLD YELLOW
sexy_bash_prompt_git_progress_color="$sexy_bash_prompt_bold$(tput setaf 1)" # BOLD RED
fi
sexy_bash_prompt_symbol_color="$sexy_bash_prompt_bold" # BOLD
else
# Otherwise, use ANSI escape sequences for coloring
# If you would like to customize your colors, use
# DEV: 30-39 lines up 0-9 from `tput`
# for i in $(seq 0 109); do
# echo -n -e "\033[1;${i}mText$(tput sgr0) "
# echo "\033[1;${i}m"
# done
sexy_bash_prompt_reset="\033[m"
sexy_bash_prompt_user_color="\033[1;34m" # BLUE
sexy_bash_prompt_preposition_color="\033[1;37m" # WHITE
sexy_bash_prompt_device_color="\033[1;36m" # CYAN
sexy_bash_prompt_dir_color="\033[1;32m" # GREEN
sexy_bash_prompt_git_status_color="\033[1;33m" # YELLOW
sexy_bash_prompt_git_progress_color="\033[1;31m" # RED
sexy_bash_prompt_symbol_color="" # NORMAL
fi
# Define the default prompt terminator character '$'
if [[ "$UID" == 0 ]]; then
sexy_bash_prompt_symbol="#"
else
sexy_bash_prompt_symbol="\$"
fi
# Apply any color overrides that have been set in the environment
if [[ -n "$PROMPT_USER_COLOR" ]]; then sexy_bash_prompt_user_color="$PROMPT_USER_COLOR"; fi
if [[ -n "$PROMPT_PREPOSITION_COLOR" ]]; then sexy_bash_prompt_preposition_color="$PROMPT_PREPOSITION_COLOR"; fi
if [[ -n "$PROMPT_DEVICE_COLOR" ]]; then sexy_bash_prompt_device_color="$PROMPT_DEVICE_COLOR"; fi
if [[ -n "$PROMPT_DIR_COLOR" ]]; then sexy_bash_prompt_dir_color="$PROMPT_DIR_COLOR"; fi
if [[ -n "$PROMPT_GIT_STATUS_COLOR" ]]; then sexy_bash_prompt_git_status_color="$PROMPT_GIT_STATUS_COLOR"; fi
if [[ -n "$PROMPT_GIT_PROGRESS_COLOR" ]]; then sexy_bash_prompt_git_progress_color="$PROMPT_GIT_PROGRESS_COLOR"; fi
if [[ -n "$PROMPT_SYMBOL" ]]; then sexy_bash_prompt_symbol="$PROMPT_SYMBOL"; fi
if [[ -n "$PROMPT_SYMBOL_COLOR" ]]; then sexy_bash_prompt_symbol_color="$PROMPT_SYMBOL_COLOR"; fi
# Set up symbols
sexy_bash_prompt_synced_symbol=""
sexy_bash_prompt_dirty_synced_symbol="*"
sexy_bash_prompt_unpushed_symbol="△"
sexy_bash_prompt_dirty_unpushed_symbol="▲"
sexy_bash_prompt_unpulled_symbol="▽"
sexy_bash_prompt_dirty_unpulled_symbol="▼"
sexy_bash_prompt_unpushed_unpulled_symbol="⬡"
sexy_bash_prompt_dirty_unpushed_unpulled_symbol="⬢"
# Apply symbol overrides that have been set in the environment
# DEV: Working unicode symbols can be determined via the following gist
# **WARNING: The following gist has 64k lines and may freeze your browser**
# https://gist.github.com/twolfson/9cc7968eb6ee8b9ad877
if [[ -n "$PROMPT_SYNCED_SYMBOL" ]]; then sexy_bash_prompt_synced_symbol="$PROMPT_SYNCED_SYMBOL"; fi
if [[ -n "$PROMPT_DIRTY_SYNCED_SYMBOL" ]]; then sexy_bash_prompt_dirty_synced_symbol="$PROMPT_DIRTY_SYNCED_SYMBOL"; fi
if [[ -n "$PROMPT_UNPUSHED_SYMBOL" ]]; then sexy_bash_prompt_unpushed_symbol="$PROMPT_UNPUSHED_SYMBOL"; fi
if [[ -n "$PROMPT_DIRTY_UNPUSHED_SYMBOL" ]]; then sexy_bash_prompt_dirty_unpushed_symbol="$PROMPT_DIRTY_UNPUSHED_SYMBOL"; fi
if [[ -n "$PROMPT_UNPULLED_SYMBOL" ]]; then sexy_bash_prompt_unpulled_symbol="$PROMPT_UNPULLED_SYMBOL"; fi
if [[ -n "$PROMPT_DIRTY_UNPULLED_SYMBOL" ]]; then sexy_bash_prompt_dirty_unpulled_symbol="$PROMPT_DIRTY_UNPULLED_SYMBOL"; fi
if [[ -n "$PROMPT_UNPUSHED_UNPULLED_SYMBOL" ]]; then sexy_bash_prompt_unpushed_unpulled_symbol="$PROMPT_UNPUSHED_UNPULLED_SYMBOL"; fi
if [[ -n "$PROMPT_DIRTY_UNPUSHED_UNPULLED_SYMBOL" ]]; then sexy_bash_prompt_dirty_unpushed_unpulled_symbol="$PROMPT_DIRTY_UNPUSHED_UNPULLED_SYMBOL"; fi
function sexy_bash_prompt_get_git_branch() {
# On branches, this will return the branch name
# On non-branches, (no branch)
ref="$(git symbolic-ref HEAD 2> /dev/null | sed -e 's/refs\/heads\///')"
if [[ "$ref" != "" ]]; then
echo "$ref"
else
echo "(no branch)"
fi
}
function sexy_bash_prompt_get_git_progress() {
# Detect in-progress actions (e.g. merge, rebase)
# https://github.com/git/git/blob/v1.9-rc2/wt-status.c#L1199-L1241
git_dir="$(git rev-parse --git-dir)"
# git merge
if [[ -f "$git_dir/MERGE_HEAD" ]]; then
echo " [merge]"
elif [[ -d "$git_dir/rebase-apply" ]]; then
# git am
if [[ -f "$git_dir/rebase-apply/applying" ]]; then
echo " [am]"
# git rebase
else
echo " [rebase]"
fi
elif [[ -d "$git_dir/rebase-merge" ]]; then
# git rebase --interactive/--merge
echo " [rebase]"
elif [[ -f "$git_dir/CHERRY_PICK_HEAD" ]]; then
# git cherry-pick
echo " [cherry-pick]"
fi
if [[ -f "$git_dir/BISECT_LOG" ]]; then
# git bisect
echo " [bisect]"
fi
if [[ -f "$git_dir/REVERT_HEAD" ]]; then
# git revert --no-commit
echo " [revert]"
fi
}
sexy_bash_prompt_is_branch1_behind_branch2 () {
# $ git log origin/master..master -1
# commit 4a633f715caf26f6e9495198f89bba20f3402a32
# Author: Todd Wolfson <todd@twolfson.com>
# Date: Sun Jul 7 22:12:17 2013 -0700
#
# Unsynced commit
# Find the first log (if any) that is in branch1 but not branch2
first_log="$(git log $1..$2 -1 2> /dev/null)"
# Exit with 0 if there is a first log, 1 if there is not
[[ -n "$first_log" ]]
}
sexy_bash_prompt_branch_exists () {
# List remote branches | # Find our branch and exit with 0 or 1 if found/not found
git branch --remote 2> /dev/null | grep --quiet "$1"
}
sexy_bash_prompt_parse_git_ahead () {
# Grab the local and remote branch
branch="$(sexy_bash_prompt_get_git_branch)"
remote_branch="origin/$branch"
# $ git log origin/master..master
# commit 4a633f715caf26f6e9495198f89bba20f3402a32
# Author: Todd Wolfson <todd@twolfson.com>
# Date: Sun Jul 7 22:12:17 2013 -0700
#
# Unsynced commit
# If the remote branch is behind the local branch
# or it has not been merged into origin (remote branch doesn't exist)
if (sexy_bash_prompt_is_branch1_behind_branch2 "$remote_branch" "$branch" ||
! sexy_bash_prompt_branch_exists "$remote_branch"); then
# echo our character
echo 1
fi
}
sexy_bash_prompt_parse_git_behind () {
# Grab the branch
branch="$(sexy_bash_prompt_get_git_branch)"
remote_branch="origin/$branch"
# $ git log master..origin/master
# commit 4a633f715caf26f6e9495198f89bba20f3402a32
# Author: Todd Wolfson <todd@twolfson.com>
# Date: Sun Jul 7 22:12:17 2013 -0700
#
# Unsynced commit
# If the local branch is behind the remote branch
if sexy_bash_prompt_is_branch1_behind_branch2 "$branch" "$remote_branch"; then
# echo our character
echo 1
fi
}
function sexy_bash_prompt_parse_git_dirty() {
# If the git status has *any* changes (e.g. dirty), echo our character
if [[ -n "$(git status --porcelain 2> /dev/null)" ]]; then
echo 1
fi
}
function sexy_bash_prompt_is_on_git() {
git rev-parse 2> /dev/null
}
function sexy_bash_prompt_get_git_status() {
# Grab the git dirty and git behind
dirty_branch="$(sexy_bash_prompt_parse_git_dirty)"
branch_ahead="$(sexy_bash_prompt_parse_git_ahead)"
branch_behind="$(sexy_bash_prompt_parse_git_behind)"
# Iterate through all the cases and if it matches, then echo
if [[ "$dirty_branch" == 1 && "$branch_ahead" == 1 && "$branch_behind" == 1 ]]; then
echo "$sexy_bash_prompt_dirty_unpushed_unpulled_symbol"
elif [[ "$branch_ahead" == 1 && "$branch_behind" == 1 ]]; then
echo "$sexy_bash_prompt_unpushed_unpulled_symbol"
elif [[ "$dirty_branch" == 1 && "$branch_ahead" == 1 ]]; then
echo "$sexy_bash_prompt_dirty_unpushed_symbol"
elif [[ "$branch_ahead" == 1 ]]; then
echo "$sexy_bash_prompt_unpushed_symbol"
elif [[ "$dirty_branch" == 1 && "$branch_behind" == 1 ]]; then
echo "$sexy_bash_prompt_dirty_unpulled_symbol"
elif [[ "$branch_behind" == 1 ]]; then
echo "$sexy_bash_prompt_unpulled_symbol"
elif [[ "$dirty_branch" == 1 ]]; then
echo "$sexy_bash_prompt_dirty_synced_symbol"
else # clean
echo "$sexy_bash_prompt_synced_symbol"
fi
}
sexy_bash_prompt_get_git_info () {
# Grab the branch
branch="$(sexy_bash_prompt_get_git_branch)"
# If there are any branches
if [[ "$branch" != "" ]]; then
# Echo the branch
output="$branch"
# Add on the git status
output="$output$(sexy_bash_prompt_get_git_status)"
# Echo our output
echo "$output"
fi
}
# Define the sexy-bash-prompt
PS1="\[$sexy_bash_prompt_user_color\]\u\[$sexy_bash_prompt_reset\] \
\[$sexy_bash_prompt_preposition_color\]at\[$sexy_bash_prompt_reset\] \
\[$sexy_bash_prompt_device_color\]\h\[$sexy_bash_prompt_reset\] \
\[$sexy_bash_prompt_preposition_color\]in\[$sexy_bash_prompt_reset\] \
\[$sexy_bash_prompt_dir_color\]\w\[$sexy_bash_prompt_reset\]\
\$( sexy_bash_prompt_is_on_git && \
echo -n \" \[$sexy_bash_prompt_preposition_color\]on\[$sexy_bash_prompt_reset\] \" && \
echo -n \"\[$sexy_bash_prompt_git_status_color\]\$(sexy_bash_prompt_get_git_info)\" && \
echo -n \"\[$sexy_bash_prompt_git_progress_color\]\$(sexy_bash_prompt_get_git_progress)\" && \
echo -n \"\[$sexy_bash_prompt_preposition_color\]\")\n\[$sexy_bash_prompt_reset\]\
\[$sexy_bash_prompt_symbol_color\]$sexy_bash_prompt_symbol \[$sexy_bash_prompt_reset\]"

139
bashrc
View File

@@ -1,139 +0,0 @@
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
#use known hosts for bash autocomplete - this needs "HashKnown Hosts no" in ~/.ssh/config
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
# Include functions file
if [ -f ~/.bash_functions ]; then
source ~/.bash_functions
fi
. ~/dotfiles/z.sh
export ANDROID_SDK=/opt/android-sdk-linux/
export PATH=$PATH:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools/:/opt/genymotion
export SENCHA_CMD_3_0_0="/home/fergalm/dev/sencha/Sencha/Cmd/4.0.0.203"
export PATH=$SENCHA_CMD_3_0_0:~/bin/:$PATH
export OPENNI2_INCLUDE=/home/fergalm/dev/kinect/lib/OpenNI-Linux-x64-2.2/Include
export OPENNI2_REDIST=/home/fergalm/dev/kinect/lib/OpenNI-Linux-x64-2.2/Redist
source ~/.bash_prompt
source ~/dotfiles/git-flow-completion.bash
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
shopt -s histappend # append to history, don't overwrite it
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
VIRTUALENVWRAPPER=/usr/local/bin/virtualenvwrapper.sh
if [ -f $VIRTUALENVWRAPPER ];
then
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/dev/personal
source /usr/local/bin/virtualenvwrapper.sh
fi
export PATH=$PATH:/opt/mssql-tools/bin
if [ -x /usr/games/cowsay -a -x /usr/games/fortune ]; then
fortune | cowsay
fi

2
bin/az
View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
/home/fergalm/lib/azure-cli/bin/python -m azure.cli "$@"

View File

@@ -1,3 +0,0 @@
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Clean", "id": "mybash"}' -H 'content-type: application/json' http://daphne/jsonrpc
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json' http://daphne/jsonrpc

View File

@@ -1,6 +0,0 @@
cd ~/.vim/bundle
for i in `ls`; do
cd "$i"
git pull
cd ..
done

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,225 +0,0 @@
#!bash
#
# git-flow-completion
# ===================
#
# Bash completion support for [git-flow](http://github.com/nvie/gitflow)
#
# The contained completion routines provide support for completing:
#
# * git-flow init and version
# * feature, hotfix and release branches
# * remote feature, hotfix and release branch names
#
#
# Installation
# ------------
#
# To achieve git-flow completion nirvana:
#
# 0. Install git-completion.
#
# 1. Install this file. Either:
#
# a. Place it in a `bash-completion.d` folder:
#
# * /etc/bash-completion.d
# * /usr/local/etc/bash-completion.d
# * ~/bash-completion.d
#
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
# your .bashrc:
#
# source ~/.git-flow-completion.sh
#
# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
# $command case in _git:
#
# flow) _git_flow ;;
#
#
# The Fine Print
# --------------
#
# Copyright (c) 2010-2015 [Justin Hileman](http://justinhileman.com)
#
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
_git_flow ()
{
local subcommands="init feature release hotfix support help version"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
init)
__git_flow_init
return
;;
feature)
__git_flow_feature
return
;;
release)
__git_flow_release
return
;;
hotfix)
__git_flow_hotfix
return
;;
support)
__git_flow_support
return
;;
*)
COMPREPLY=()
;;
esac
}
__git_flow_init ()
{
local subcommands="help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
}
__git_flow_feature ()
{
local subcommands="list start finish publish track diff rebase checkout pull help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
pull)
__gitcomp "$(__git_remotes)"
return
;;
checkout|finish|diff|rebase)
__gitcomp "$(__git_flow_list_branches 'feature')"
return
;;
publish)
__gitcomp "$(comm -23 <(__git_flow_list_branches 'feature') <(__git_flow_list_remote_branches 'feature'))"
return
;;
track)
__gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'feature') <(__git_flow_list_branches 'feature'))"
return
;;
*)
COMPREPLY=()
;;
esac
}
__git_flow_release ()
{
local subcommands="list start finish track publish help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
finish)
__gitcomp "$(__git_flow_list_branches 'release')"
return
;;
publish)
__gitcomp "$(comm -23 <(__git_flow_list_branches 'release') <(__git_flow_list_remote_branches 'release'))"
return
;;
track)
__gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'release') <(__git_flow_list_branches 'release'))"
return
;;
*)
COMPREPLY=()
;;
esac
}
__git_flow_hotfix ()
{
local subcommands="list start finish track publish help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
finish)
__gitcomp "$(__git_flow_list_branches 'hotfix')"
return
;;
publish)
__gitcomp "$(comm -23 <(__git_flow_list_branches 'hotfix') <(__git_flow_list_remote_branches 'hotfix'))"
return
;;
track)
__gitcomp "$(comm -23 <(__git_flow_list_remote_branches 'hotfix') <(__git_flow_list_branches 'hotfix'))"
return
;;
*)
COMPREPLY=()
;;
esac
}
__git_flow_support ()
{
local subcommands="list start help"
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
__gitcomp "$subcommands"
return
fi
case "$subcommand" in
*)
COMPREPLY=()
;;
esac
}
__git_flow_prefix ()
{
case "$1" in
feature|release|hotfix)
git config "gitflow.prefix.$1" 2> /dev/null || echo "$1/"
return
;;
esac
}
__git_flow_list_branches ()
{
local prefix="$(__git_flow_prefix $1)"
git branch --no-color 2> /dev/null | tr -d ' |*' | grep --color=never "^$prefix" | sed s,^$prefix,, | sort
}
__git_flow_list_remote_branches ()
{
local prefix="$(__git_flow_prefix $1)"
local origin="$(git config gitflow.origin 2> /dev/null || echo "origin")"
git branch --no-color -r 2> /dev/null | sed "s/^ *//g" | grep --color=never "^$origin/$prefix" | sed s,^$origin/$prefix,, | sort
}
# alias __git_find_on_cmdline for backwards compatibility
if [ -z "`type -t __git_find_on_cmdline`" ]; then
alias __git_find_on_cmdline=__git_find_subcommand
fi

View File

@@ -1,85 +0,0 @@
# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
############################
########## Variables
dir=~/dotfiles # dotfiles directory
olddir=~/dotfiles_old # old dotfiles backup directory
files="tmux.conf zshrc bash_aliases bash_functions sqliterc Xresources" # list of files/folders to symlink in homedir
##########
# create dotfiles_old in homedir
echo "Creating $olddir for backup of any existing dotfiles in ~"
mkdir -p $olddir
echo "...done"
# change to the dotfiles directory
echo "Changing to the $dir directory"
cd $dir
echo "...done"
# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks
for file in $files; do
echo "Moving any existing dotfiles from ~ to $olddir"
mv ~/.$file ~/dotfiles_old/
echo "Creating symlink to $file in home directory."
ln -s $dir/$file ~/.$file
done
# merge Xresources
xrdb -merge ~/.Xresources
sudo cp -r fonts/* /usr/share/fonts/opentype
fc-cache -f -v
sudo fc-cache -f -v
git clone https://github.com/powerline/fonts.git pwfonts
cd pwfonts && ./install.sh
OMF=~/.oh-my-zsh/oh-my-zsh.sh
if [ ! -f $OMF ]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
#install git flow completion
git clone https://github.com/bobthecow/git-flow-completion ~/.oh-my-zsh/custom/plugins/git-flow-completion
# Setup default locales
sudo locale-gen "en_IE.UTF-8"
#install default packages
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt update
sudo apt-get install -y exuberant-ctags build-essential cmake python-dev python3-dev libssl-dev vim-youcompleteme autojump nodejs htop ncdu python-pip python3-pip byobu zsh vim-gtk python-setuptools neovim tree git-extras cowsay fortune winbind libpq-dev xclip whois
sudo pip install --upgrade pip
sudo pip install --upgrade neovim
sudo pip3 install --upgrade neovim
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 60
sudo update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60
sudo pip install livereload speedtest-cli virtualenv virtualenvwrapper
sudo npm install -g goops
chsh -s /bin/zsh
git clone git@github.com:fergalmoran/vimfiles.git ~/.vim
ln -s ~/.vim/.vimrc ~/.vimrc
cd ~/.vim
git submodule init
git submodule update
vim +BundleInstall +qall
git config --global user.email "fergal.moran@gmail.com"
git config --global user.name "Fergal Moran"
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20for%20Powerline%20Nerd%20Font%20Complete.otf

View File

@@ -1,2 +0,0 @@
node_modules/
.sync/

View File

@@ -1,2 +0,0 @@
.headers ON
.mode column

142
tmux.conf
View File

@@ -1,142 +0,0 @@
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
# bind C-a send-prefix
unbind C-b
setw -g mode-keys vi
set -sg escape-time 0
######################
### DESIGN CHANGES ###
######################
## Status bar design
# status line
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2
# messaging
set -g message-fg black
set -g message-bg yellow
set -g message-command-fg blue
set -g message-command-bg black
#window mode
setw -g mode-bg colour6
setw -g mode-fg colour0
# window status
setw -g window-status-format " #F#I:#W#F "
setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-bg colour0
setw -g window-status-current-fg colour11
setw -g window-status-current-attr dim
setw -g window-status-bg green
setw -g window-status-fg black
setw -g window-status-attr reverse
# Info on left (I don't have a session display for now)
set -g status-left ''
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
set -g default-terminal "screen-256color"
# The modes {
setw -g clock-mode-colour colour135
setw -g mode-attr bold
setw -g mode-fg colour196
setw -g mode-bg colour238
# }
# The panes {
# split panes using | and -
bind | split-window -h
bind _ split-window -v
unbind '"'
unbind %
bind k confirm kill-window
bind K confirm kill-server
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1
bind r source-file ~/.tmux.conf
# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
set -g pane-border-bg colour235
set -g pane-border-fg colour238
set -g pane-active-border-bg colour236
set -g pane-active-border-fg colour51
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
set -g default-terminal "screen-256color"
# set-window-option -g mode-mouse on
# set-option -g mode-mouse on
# set-option -g mouse-select-pane on
# set-option -g mouse-resize-pane on
# }
# The statusbar {
set -g status-position bottom
set -g status-bg colour234
set -g status-fg colour137
set -g status-attr dim
set -g status-left ''
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S '
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-fg colour81
setw -g window-status-current-bg colour238
setw -g window-status-current-attr bold
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-fg colour138
setw -g window-status-bg colour235
setw -g window-status-attr none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
setw -g window-status-bell-attr bold
setw -g window-status-bell-fg colour255
setw -g window-status-bell-bg colour1
# }
# The messages {
set -g message-attr bold
set -g message-fg colour232
set -g message-bg colour166
# }
# Setup tmux resurrect
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'

91
zshrc
View File

@@ -1,91 +0,0 @@
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/dotfiles/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="muse"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git, thefuck, git-flow-completion, virtualenvwrapper)
source $ZSH/oh-my-zsh.sh
source /usr/share/autojump/autojump.sh
source /usr/local/bin/virtualenvwrapper.sh
source ~/.oh-my-zsh/custom/plugins/git-flow-completion/git-flow-completion.zsh
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='gvim'
fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
source ~/.bash_aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
export PATH=$PATH:/home/fergalm/dotfiles/bin:/opt/android/sdk/platform-tools/
source '/home/fergalm/lib/azure-cli/az.completion'
source '/home/fergalm/dotfiles/.private.env'
# If not running interactively, do not do anything
#[[ $- != *i* ]] && return
#[[ -z "$TMUX" ]] && exec tmux