Not committing using gpg.
This commit is contained in:
parent
ce5ac16ca3
commit
17c80363a2
115
.gitignore
vendored
115
.gitignore
vendored
@ -1,10 +1,55 @@
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Archives template
|
||||
# It's better to unpack these files and commit the raw source because
|
||||
# git has its own built in compression methods.
|
||||
*.7z
|
||||
*.jar
|
||||
*.rar
|
||||
*.zip
|
||||
*.gz
|
||||
*.bzip
|
||||
*.bz2
|
||||
*.xz
|
||||
*.lzma
|
||||
*.cab
|
||||
|
||||
#packing-only formats
|
||||
*.iso
|
||||
*.tar
|
||||
|
||||
#package management formats
|
||||
*.dmg
|
||||
*.xpi
|
||||
*.gem
|
||||
*.egg
|
||||
*.deb
|
||||
*.rpm
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
### Windows template
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
### JetBrains template
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
|
||||
|
||||
*.iml
|
||||
|
||||
/dist
|
||||
## Directory-based project format:
|
||||
.idea/
|
||||
# if you remove the above rule, at least ignore the following:
|
||||
@ -47,6 +92,55 @@ atlassian-ide-plugin.xml
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
### Xcode template
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
### OSX template
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
### Node template
|
||||
# Logs
|
||||
logs
|
||||
@ -77,3 +171,20 @@ build/Release
|
||||
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
|
||||
node_modules
|
||||
|
||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/tmp
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/bower_components
|
||||
|
||||
# misc
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage/*
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
testem.log
|
||||
|
115
Dev dotfiles/.gitignore
vendored
115
Dev dotfiles/.gitignore
vendored
@ -1,10 +1,55 @@
|
||||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Archives template
|
||||
# It's better to unpack these files and commit the raw source because
|
||||
# git has its own built in compression methods.
|
||||
*.7z
|
||||
*.jar
|
||||
*.rar
|
||||
*.zip
|
||||
*.gz
|
||||
*.bzip
|
||||
*.bz2
|
||||
*.xz
|
||||
*.lzma
|
||||
*.cab
|
||||
|
||||
#packing-only formats
|
||||
*.iso
|
||||
*.tar
|
||||
|
||||
#package management formats
|
||||
*.dmg
|
||||
*.xpi
|
||||
*.gem
|
||||
*.egg
|
||||
*.deb
|
||||
*.rpm
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
### Windows template
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
### JetBrains template
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
|
||||
|
||||
*.iml
|
||||
|
||||
/dist
|
||||
## Directory-based project format:
|
||||
.idea/
|
||||
# if you remove the above rule, at least ignore the following:
|
||||
@ -47,6 +92,55 @@ atlassian-ide-plugin.xml
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
### Xcode template
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## Build generated
|
||||
build/
|
||||
DerivedData
|
||||
|
||||
## Various settings
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
|
||||
## Other
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
*.xcuserstate
|
||||
### OSX template
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
### Node template
|
||||
# Logs
|
||||
logs
|
||||
@ -77,3 +171,20 @@ build/Release
|
||||
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
|
||||
node_modules
|
||||
|
||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
/tmp
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/bower_components
|
||||
|
||||
# misc
|
||||
/.sass-cache
|
||||
/connect.lock
|
||||
/coverage/*
|
||||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
testem.log
|
||||
|
@ -1,12 +0,0 @@
|
||||
alias ls='ls -h --color=auto'
|
||||
alias snano='sudo nano'
|
||||
|
||||
#alias ll='ls -l'
|
||||
#alias la='ls -A'
|
||||
#alias l='ls -CF'
|
||||
|
||||
alias top='htop'
|
||||
alias h='history|grep'
|
||||
alias f='find|grep'
|
||||
alias df='df -h'
|
||||
alias size='du -sh ./*'
|
@ -1,28 +0,0 @@
|
||||
altscreen on
|
||||
autodetach on
|
||||
defbce on
|
||||
deflogin on
|
||||
|
||||
vbell off
|
||||
vbell_msg ""
|
||||
bell_msg "!!! Ding !!!"
|
||||
|
||||
termcapinfo xterm|xterms|xs|rxvt ti@:te@
|
||||
terminfo xterm|xterms|xs|rxvt ti@:te@:
|
||||
term screen-256color
|
||||
|
||||
#caption always "%{= kc}%H (system load: %l)%-21=%{= .m}%D %d.%m.%Y %0c"
|
||||
defscrollback 2048
|
||||
startup_message off
|
||||
hardstatus on
|
||||
hardstatus alwayslastline
|
||||
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'
|
||||
|
||||
bind ' ' windowlist -b
|
||||
bind ',' prev
|
||||
bind '.' next
|
||||
|
||||
#let pgup/pgdn scroll under urxvt (see .Xdefaults)
|
||||
bindkey "^[[5;2~" eval "copy" "stuff ^u"
|
||||
bindkey -m "^[[5;2~" stuff ^u
|
||||
bindkey -m "^[[6;2~" stuff ^d
|
@ -3,10 +3,16 @@ NVM="$HOME/.nvm"
|
||||
NVM_VERSION="5.7.0"
|
||||
DEV="$HOME/dev"
|
||||
LIVE="$HOME/live"
|
||||
STAGING="$HOME/staging"
|
||||
SERVER="O-BrandServer"
|
||||
FRONT="O-Brand"
|
||||
SWAP="/swapfile"
|
||||
DBSETUP="obrand-admin-server/dbrebuild.sh"
|
||||
PKG_MANAGER=$( command -v yum || command -v apt-get ) || echo "Neither yum nor apt-get found"
|
||||
PKG_DEVICE=$(basename $PKG_MANAGER)
|
||||
UPDATE=no
|
||||
DATABASE=no
|
||||
NGINX=no
|
||||
|
||||
fancy_echo() {
|
||||
local fmt="$1"; shift
|
||||
@ -15,17 +21,63 @@ fancy_echo() {
|
||||
printf "\n$fmt\n" "$@"
|
||||
}
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
-u|--update)
|
||||
UPDATE=YES
|
||||
shift # past argument=value
|
||||
;;
|
||||
-d|--database)
|
||||
DATABASE=YES
|
||||
shift # past argument=value
|
||||
;;
|
||||
-n|--nginx)
|
||||
NGINX=YES
|
||||
shift # past argument=value
|
||||
;;
|
||||
|
||||
--default)
|
||||
DEFAULT=YES
|
||||
shift # past argument with no value
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
fancy_echo "Installing Obrand Admin Server ..."
|
||||
## Update initial packages
|
||||
|
||||
fancy_echo Cleaning...
|
||||
|
||||
if [ $(basename $PKG_MANAGER) = "yum" ]; then
|
||||
if [ ! -d "$DEV" ]; then
|
||||
mkdir -p $DEV
|
||||
fi
|
||||
|
||||
if [ ! -d "$LIVE" ]; then
|
||||
mkdir -p $LIVE
|
||||
fi
|
||||
|
||||
if [ ! -d "$STAGING" ]; then
|
||||
rm -rf $STAGING
|
||||
mkdir -p $STAGING
|
||||
else
|
||||
mkdir -p $STAGING
|
||||
fi
|
||||
|
||||
|
||||
if [[ $UPDATE = "yes" ]]; then
|
||||
if [ $(basename $PKG_MANAGER) = "yum" ]; then
|
||||
sudo yum --assumeyes upgrade
|
||||
sudo yum --assumeyes install git make automake gcc gcc-c++ kernel-devel nginx htop screen wget curl postgresql postgresql-contrib
|
||||
else
|
||||
else
|
||||
sudo apt-get -y -q --force-yes update
|
||||
sudo apt-get -y -q --force-yes upgrade
|
||||
sudo apt-get --assume-yes install build-essential git nginx htop screen wget curl postgresql postgresql-contrib
|
||||
fi
|
||||
fi
|
||||
|
||||
# set up and install swap file
|
||||
@ -68,36 +120,59 @@ fi
|
||||
cd $DEV
|
||||
|
||||
# Get latest version of Obrand Admin
|
||||
git clone https://censis.visualstudio.com/DefaultCollection/_git/O-Brand
|
||||
|
||||
if [ ! -d "$DEV/$FRONT/.git" ]; then
|
||||
git clone https://censis.visualstudio.com/DefaultCollection/_git/O-Brand
|
||||
else
|
||||
cd $DEV/$FRONT
|
||||
git pull origin master
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -d "$DEV/$SERVER/.git" ]; then
|
||||
git clone https://censis.visualstudio.com/DefaultCollection/O-Brand/_git/O-BrandServer
|
||||
else
|
||||
cd $DEV/$SERVER
|
||||
git pull origin master
|
||||
|
||||
fi
|
||||
|
||||
# Get latest version of Obrand Admin Server
|
||||
git clone http://gitlab.silvrtree.co.uk/martind2000/obrand-admin-server.git
|
||||
|
||||
cd $DEV/O-Brand
|
||||
cd $DEV/$FRONT
|
||||
|
||||
npm install .
|
||||
npm-install-missing
|
||||
npm install . && npm-install-missing
|
||||
bower install
|
||||
ember build --environment production
|
||||
|
||||
cd $DEV/obrand-admin-server
|
||||
cd $DEV/$SERVER
|
||||
|
||||
npm install . && npm-install-missing
|
||||
npm install git+http://gitlab.silvrtree.co.uk/martind2000/md-utils.git
|
||||
npm install git+http://gitlab.silvrtree.co.uk/martind2000/node-validator.git
|
||||
|
||||
cd $DEV/O-Brand/dist
|
||||
cp -ra . $DEV/obrand-admin-server/wwwroot
|
||||
rsync -uav --exclude .git $DEV/$SERVER/ $STAGING
|
||||
|
||||
cd $DEV/obrand-admin-server
|
||||
|
||||
cd $DEV/$FRONT/dist
|
||||
|
||||
cp -ra . $STAGING/wwwroot
|
||||
|
||||
if [[ $DATABASE = "yes" ]]; then
|
||||
|
||||
echo Setting up Database server...
|
||||
|
||||
sudo su - postgres -c "$DEV/$DBSETUP"
|
||||
node dbconfig.js
|
||||
# sudo su - postgres -c "$DEV/$DBSETUP"
|
||||
# node dbconfig.js
|
||||
fi
|
||||
|
||||
|
||||
echo Copying...
|
||||
rsync -uav --exclude .git $DEV/obrand-admin-server/ $LIVE
|
||||
rsync -uav --exclude .git $STAGING/ $LIVE
|
||||
|
||||
# Configure nginx
|
||||
if [[ $NGINX = "yes" ]]; then
|
||||
|
||||
sudo fuser -k 80/tcp
|
||||
|
||||
sudo wget https://dl.dropboxusercontent.com/u/233909/obrand/obrand.nginx -O /etc/nginx/sites-available/obrand && sudo ln -s /etc/nginx/sites-available/obrand /etc/nginx/sites-enabled/obrand
|
||||
@ -107,3 +182,4 @@ sudo rm /etc/nginx/sites-enabled/default
|
||||
npm set progress=true
|
||||
sudo /etc/init.d/nginx restart
|
||||
|
||||
fi
|
41
shell_dotfiles/_aliases
Normal file
41
shell_dotfiles/_aliases
Normal file
@ -0,0 +1,41 @@
|
||||
# alias ls='ls -h --color=auto'
|
||||
alias snano='sudo nano'
|
||||
|
||||
#alias ll='ls -l'
|
||||
#alias la='ls -A'
|
||||
#alias l='ls -CF'
|
||||
|
||||
alias top='htop'
|
||||
alias h='history|grep'
|
||||
alias f='find|grep'
|
||||
alias df='df -h'
|
||||
alias size='du -sh ./*'
|
||||
|
||||
|
||||
|
||||
# Detect which `ls` flavor is in use
|
||||
if ls --color > /dev/null 2>&1; then # GNU `ls`
|
||||
colorflag="--color"
|
||||
else # OS X `ls`
|
||||
colorflag="-G"
|
||||
fi
|
||||
|
||||
# List all files colorized in long format
|
||||
alias l="ls -lF ${colorflag}"
|
||||
|
||||
# List all files colorized in long format, including dot files
|
||||
alias la="ls -laF ${colorflag}"
|
||||
|
||||
# List only directories
|
||||
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
|
||||
|
||||
# Always use color output for `ls`
|
||||
alias ls="command ls ${colorflag}"
|
||||
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
|
||||
|
||||
|
||||
# Always enable colored `grep` output
|
||||
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
43
shell_dotfiles/_bash_profile_osx
Normal file
43
shell_dotfiles/_bash_profile_osx
Normal file
@ -0,0 +1,43 @@
|
||||
PATH=/Users/martin/dev/tools:$PATH
|
||||
HTTP_PROXY=
|
||||
# http://wwwcache.open.ac.uk:80
|
||||
export PATH=/Library/PostgreSQL/9.5/bin:$PATH
|
||||
export HTTP_PROXY
|
||||
export JAVA_HOME=$(/usr/libexec/java_home)
|
||||
|
||||
for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do
|
||||
[ -r "$file" ] && [ -f "$file" ] && source "$file";
|
||||
done;
|
||||
unset file;
|
||||
|
||||
##
|
||||
# Your previous /Users/martin/.bash_profile file was backed up as /Users/martin/.bash_profile.macports-saved_2012-04-20_at_13:53:29
|
||||
##
|
||||
|
||||
# MacPorts Installer addition on 2012-04-20_at_13:53:29: adding an appropriate PATH variable for use with MacPorts.
|
||||
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
|
||||
# Finished adapting your PATH environment variable for use with MacPorts.
|
||||
|
||||
|
||||
##
|
||||
# Your previous /Users/martin/.bash_profile file was backed up as /Users/martin/.bash_profile.macports-saved_2012-11-05_at_14:28:31
|
||||
##
|
||||
|
||||
# MacPorts Installer addition on 2012-11-05_at_14:28:31: adding an appropriate PATH variable for use with MacPorts.
|
||||
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
|
||||
# Finished adapting your PATH environment variable for use with MacPorts.
|
||||
|
||||
|
||||
##
|
||||
# Your previous /Users/martin/.bash_profile file was backed up as /Users/martin/.bash_profile.macports-saved_2012-11-07_at_10:22:38
|
||||
##
|
||||
|
||||
# MacPorts Installer addition on 2012-11-07_at_10:22:38: adding an appropriate PATH variable for use with MacPorts.
|
||||
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
|
||||
# Finished adapting your PATH environment variable for use with MacPorts.
|
||||
|
||||
export PATH="$PATH:$HOME/android-sdk-macosx/tools:$HOME/android-sdk-macosx/platform-tools:"
|
||||
|
||||
|
||||
[[ -s /Users/martin/.nvm/nvm.sh ]] && . /Users/martin/.nvm/nvm.sh # This loads NVM
|
||||
|
120
shell_dotfiles/_bash_prompt
Normal file
120
shell_dotfiles/_bash_prompt
Normal file
@ -0,0 +1,120 @@
|
||||
# Shell prompt based on the Solarized Dark theme.
|
||||
# Screenshot: http://i.imgur.com/EkEtphC.png
|
||||
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
|
||||
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
|
||||
|
||||
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
|
||||
export TERM='gnome-256color';
|
||||
elif infocmp xterm-256color >/dev/null 2>&1; then
|
||||
export TERM='xterm-256color';
|
||||
fi;
|
||||
|
||||
prompt_git() {
|
||||
local s='';
|
||||
local branchName='';
|
||||
|
||||
# Check if the current directory is in a Git repository.
|
||||
if [ $(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}") == '0' ]; then
|
||||
|
||||
# check if the current directory is in .git before running git checks
|
||||
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
|
||||
|
||||
# Ensure the index is up to date.
|
||||
git update-index --really-refresh -q &>/dev/null;
|
||||
|
||||
# Check for uncommitted changes in the index.
|
||||
if ! $(git diff --quiet --ignore-submodules --cached); then
|
||||
s+='+';
|
||||
fi;
|
||||
|
||||
# Check for unstaged changes.
|
||||
if ! $(git diff-files --quiet --ignore-submodules --); then
|
||||
s+='!';
|
||||
fi;
|
||||
|
||||
# Check for untracked files.
|
||||
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
|
||||
s+='?';
|
||||
fi;
|
||||
|
||||
# Check for stashed files.
|
||||
if $(git rev-parse --verify refs/stash &>/dev/null); then
|
||||
s+='$';
|
||||
fi;
|
||||
|
||||
fi;
|
||||
|
||||
# Get the short symbolic ref.
|
||||
# If HEAD isn’t a symbolic ref, get the short SHA for the latest commit
|
||||
# Otherwise, just give up.
|
||||
branchName="$(git symbolic-ref --quiet --short HEAD 2> /dev/null || \
|
||||
git rev-parse --short HEAD 2> /dev/null || \
|
||||
echo '(unknown)')";
|
||||
|
||||
[ -n "${s}" ] && s=" [${s}]";
|
||||
|
||||
echo -e "${1}${branchName}${2}${s}";
|
||||
else
|
||||
return;
|
||||
fi;
|
||||
}
|
||||
|
||||
if tput setaf 1 &> /dev/null; then
|
||||
tput sgr0; # reset colors
|
||||
bold=$(tput bold);
|
||||
reset=$(tput sgr0);
|
||||
# Solarized colors, taken from http://git.io/solarized-colors.
|
||||
black=$(tput setaf 0);
|
||||
blue=$(tput setaf 33);
|
||||
cyan=$(tput setaf 37);
|
||||
green=$(tput setaf 64);
|
||||
orange=$(tput setaf 166);
|
||||
purple=$(tput setaf 125);
|
||||
red=$(tput setaf 124);
|
||||
violet=$(tput setaf 61);
|
||||
white=$(tput setaf 15);
|
||||
yellow=$(tput setaf 136);
|
||||
else
|
||||
bold='';
|
||||
reset="\e[0m";
|
||||
black="\e[1;30m";
|
||||
blue="\e[1;34m";
|
||||
cyan="\e[1;36m";
|
||||
green="\e[1;32m";
|
||||
orange="\e[1;33m";
|
||||
purple="\e[1;35m";
|
||||
red="\e[1;31m";
|
||||
violet="\e[1;35m";
|
||||
white="\e[1;37m";
|
||||
yellow="\e[1;33m";
|
||||
fi;
|
||||
|
||||
# Highlight the user name when logged in as root.
|
||||
if [[ "${USER}" == "root" ]]; then
|
||||
userStyle="${red}";
|
||||
else
|
||||
userStyle="${orange}";
|
||||
fi;
|
||||
|
||||
# Highlight the hostname when connected via SSH.
|
||||
if [[ "${SSH_TTY}" ]]; then
|
||||
hostStyle="${bold}${red}";
|
||||
else
|
||||
hostStyle="${yellow}";
|
||||
fi;
|
||||
|
||||
# Set the terminal title and prompt.
|
||||
PS1="\[\033]0;\W\007\]"; # working directory base name
|
||||
PS1+="\[${bold}\]\n"; # newline
|
||||
PS1+="\[${userStyle}\]\u"; # username
|
||||
PS1+="\[${white}\] at ";
|
||||
PS1+="\[${hostStyle}\]\h"; # host
|
||||
PS1+="\[${white}\] in ";
|
||||
PS1+="\[${green}\]\w"; # working directory full path
|
||||
PS1+="\$(prompt_git \"\[${white}\] on \[${violet}\]\" \"\[${blue}\]\")"; # Git repository details
|
||||
PS1+="\n";
|
||||
PS1+="\[${white}\]\$ \[${reset}\]"; # `$` (and reset color)
|
||||
export PS1;
|
||||
|
||||
PS2="\[${yellow}\]→ \[${reset}\]";
|
||||
export PS2;
|
191
shell_dotfiles/_gitconfig
Normal file
191
shell_dotfiles/_gitconfig
Normal file
@ -0,0 +1,191 @@
|
||||
[alias]
|
||||
|
||||
# View abbreviated SHA, description, and history graph of the latest 20 commits
|
||||
l = log --pretty=oneline -n 20 --graph --abbrev-commit
|
||||
|
||||
# View the current working tree status using the short format
|
||||
s = status -s
|
||||
|
||||
# Show the diff between the latest commit and the current state
|
||||
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
|
||||
|
||||
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
|
||||
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
|
||||
|
||||
# Pull in remote changes for the current repository and all its submodules
|
||||
p = !"git pull; git submodule foreach git pull origin master"
|
||||
|
||||
# Clone a repository including all submodules
|
||||
c = clone --recursive
|
||||
|
||||
# Commit all changes
|
||||
ca = !git add -A && git commit -av
|
||||
|
||||
# Switch to a branch, creating it if necessary
|
||||
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
|
||||
|
||||
# Show verbose output about tags, branches or remotes
|
||||
tags = tag -l
|
||||
branches = branch -a
|
||||
remotes = remote -v
|
||||
|
||||
# Amend the currently staged files to the latest commit
|
||||
amend = commit --amend --reuse-message=HEAD
|
||||
|
||||
# Credit an author on the latest commit
|
||||
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
|
||||
|
||||
# Interactive rebase with the given number of latest commits
|
||||
reb = "!r() { git rebase -i HEAD~$1; }; r"
|
||||
|
||||
# Remove the old tag with this name and tag the latest commit with it.
|
||||
retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
|
||||
|
||||
# Find branches containing commit
|
||||
fb = "!f() { git branch -a --contains $1; }; f"
|
||||
|
||||
# Find tags containing commit
|
||||
ft = "!f() { git describe --always --contains $1; }; f"
|
||||
|
||||
# Find commits by source code
|
||||
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
|
||||
|
||||
# Find commits by commit message
|
||||
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
|
||||
|
||||
# Remove branches that have already been merged with master
|
||||
# a.k.a. ‘delete merged’
|
||||
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
|
||||
|
||||
# List contributors with number of commits
|
||||
contributors = shortlog --summary --numbered
|
||||
|
||||
# Merge GitHub pull request on top of the current branch or,
|
||||
# if a branch name is specified, on top of the specified branch
|
||||
mpr = "!f() { \
|
||||
declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \
|
||||
declare branch=\"${2:-$currentBranch}\"; \
|
||||
if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \
|
||||
git fetch origin refs/pull/$1/head:pr/$1 && \
|
||||
git checkout -B $branch && \
|
||||
git rebase $branch pr/$1 && \
|
||||
git checkout -B $branch && \
|
||||
git merge pr/$1 && \
|
||||
git branch -D pr/$1 && \
|
||||
git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
|
||||
fi \
|
||||
}; f"
|
||||
|
||||
[apply]
|
||||
|
||||
# Detect whitespace errors when applying a patch
|
||||
whitespace = fix
|
||||
|
||||
[core]
|
||||
|
||||
# Use custom `.gitignore` and `.gitattributes`
|
||||
excludesfile = ~/.gitignore
|
||||
attributesfile = ~/.gitattributes
|
||||
|
||||
# Treat spaces before tabs and all kinds of trailing whitespace as an error
|
||||
# [default] trailing-space: looks for spaces at the end of a line
|
||||
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
|
||||
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
|
||||
|
||||
# Make `git rebase` safer on OS X
|
||||
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
|
||||
trustctime = false
|
||||
|
||||
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
|
||||
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
|
||||
precomposeunicode = false
|
||||
|
||||
[color]
|
||||
branch = always
|
||||
diff = always
|
||||
grep = always
|
||||
interactive = always
|
||||
pager = true
|
||||
showbranch = auto
|
||||
status = auto
|
||||
ui = always
|
||||
|
||||
[color "interactive"]
|
||||
error = red bold
|
||||
|
||||
[color "branch"]
|
||||
|
||||
current = yellow reverse
|
||||
local = yellow
|
||||
remote = green
|
||||
|
||||
[color "diff"]
|
||||
|
||||
meta = yellow bold
|
||||
frag = magenta bold # line info
|
||||
old = red # deletions
|
||||
new = green # additions
|
||||
whitespace = white reverse
|
||||
|
||||
[color "status"]
|
||||
|
||||
added = yellow
|
||||
changed = green
|
||||
untracked = cyan
|
||||
branch = magenta
|
||||
|
||||
[commit]
|
||||
|
||||
# https://help.github.com/articles/signing-commits-using-gpg/
|
||||
# gpgsign = true
|
||||
|
||||
[diff]
|
||||
|
||||
# Detect copies as well as renames
|
||||
renames = copies
|
||||
|
||||
[diff "bin"]
|
||||
|
||||
# Use `hexdump` to diff binary files
|
||||
textconv = hexdump -v -C
|
||||
|
||||
[help]
|
||||
|
||||
# Automatically correct and execute mistyped commands
|
||||
autocorrect = 1
|
||||
|
||||
[merge]
|
||||
|
||||
# Include summaries of merged commits in newly created merge commit messages
|
||||
log = true
|
||||
|
||||
[push]
|
||||
|
||||
# Use the Git 1.x.x default to avoid errors on machines with old Git
|
||||
# installations. To use `simple` instead, add this to your `~/.extra` file:
|
||||
# `git config --global push.default simple`. See http://git.io/mMah-w.
|
||||
default = matching
|
||||
# Make `git push` push relevant annotated tags when pushing branches out.
|
||||
followTags = true
|
||||
|
||||
# URL shorthands
|
||||
|
||||
[url "git@github.com:"]
|
||||
|
||||
insteadOf = "gh:"
|
||||
pushInsteadOf = "github:"
|
||||
pushInsteadOf = "git://github.com/"
|
||||
|
||||
[url "git://github.com/"]
|
||||
|
||||
insteadOf = "github:"
|
||||
|
||||
[url "git@gist.github.com:"]
|
||||
|
||||
insteadOf = "gst:"
|
||||
pushInsteadOf = "gist:"
|
||||
pushInsteadOf = "git://gist.github.com/"
|
||||
|
||||
[url "git://gist.github.com/"]
|
||||
|
||||
insteadOf = "gist:"
|
0
shell_dotfiles/_nanorc
Normal file
0
shell_dotfiles/_nanorc
Normal file
55
shell_dotfiles/_screenrc
Normal file
55
shell_dotfiles/_screenrc
Normal file
@ -0,0 +1,55 @@
|
||||
altscreen on
|
||||
defbce on
|
||||
|
||||
vbell off
|
||||
vbell_msg ""
|
||||
bell_msg "!!! Ding !!!"
|
||||
|
||||
termcapinfo xterm-255color|xterm-color|screen-256color ti@:te@
|
||||
terminfo xterm-255color|xterm-color|screen-256color ti@:te@
|
||||
term screen-256color
|
||||
|
||||
terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
|
||||
|
||||
# fix for residual editor text. sometimes when you run an editor and
|
||||
# close it, some of its text may stay visible. this fixes that
|
||||
# problem.
|
||||
|
||||
|
||||
# ===============================================================
|
||||
# VARIABLES - Boolean values (on/off)
|
||||
# ===============================================================
|
||||
autodetach on # default: on
|
||||
crlf off # default: off
|
||||
# deflogin off # default: on
|
||||
# defsilence off # default: off
|
||||
hardcopy_append on # default: off
|
||||
nethack on # default: off
|
||||
startup_message off # default: on
|
||||
vbell off # default: ???
|
||||
|
||||
#
|
||||
# ===============================================================
|
||||
# VARIABLES - Number values
|
||||
# ===============================================================
|
||||
defscrollback 5000 # default: 100
|
||||
# msgminwait 3 # default: 1
|
||||
silencewait 15 # default: 30
|
||||
|
||||
|
||||
|
||||
#caption always "%{= kc}%H (system load: %l)%-21=%{= .m}%D %d.%m.%Y %0c"
|
||||
#caption always "%?%F%{=b Kw}%:%{=u kR}%? %h %-024= %C%a %D %d %M %Y%{= db}"
|
||||
|
||||
hardstatus on
|
||||
hardstatus alwayslastline
|
||||
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m-%d %{W}%c %{g}]'
|
||||
|
||||
bind ' ' windowlist -b
|
||||
bind ',' prev
|
||||
bind '.' next
|
||||
|
||||
#let pgup/pgdn scroll under urxvt (see .Xdefaults)
|
||||
bindkey "^[[5;2~" eval "copy" "stuff ^u"
|
||||
bindkey -m "^[[5;2~" stuff ^u
|
||||
bindkey -m "^[[6;2~" stuff ^d
|
38
shell_dotfiles/_wgetrc
Normal file
38
shell_dotfiles/_wgetrc
Normal file
@ -0,0 +1,38 @@
|
||||
# Use the server-provided last modification date, if available
|
||||
timestamping = on
|
||||
|
||||
# Do not go up in the directory structure when downloading recursively
|
||||
no_parent = on
|
||||
|
||||
# Wait 60 seconds before timing out. This applies to all timeouts: DNS, connect and read. (The default read timeout is 15 minutes!)
|
||||
timeout = 60
|
||||
|
||||
# Retry a few times when a download fails, but don’t overdo it. (The default is 20!)
|
||||
tries = 3
|
||||
|
||||
# Retry even when the connection was refused
|
||||
retry_connrefused = on
|
||||
|
||||
# Use the last component of a redirection URL for the local file name
|
||||
trust_server_names = on
|
||||
|
||||
# Follow FTP links from HTML documents by default
|
||||
follow_ftp = on
|
||||
|
||||
# Add a `.html` extension to `text/html` or `application/xhtml+xml` files that lack one, or a `.css` extension to `text/css` files that lack one
|
||||
adjust_extension = on
|
||||
|
||||
# Use UTF-8 as the default system encoding
|
||||
# Disabled as it makes `wget` builds that don’t support this feature unusable.
|
||||
# Does anyone know how to conditionally configure a wget setting?
|
||||
# http://unix.stackexchange.com/q/34730/6040
|
||||
#local_encoding = UTF-8
|
||||
|
||||
# Ignore `robots.txt` and `<meta name=robots content=nofollow>`
|
||||
robots = off
|
||||
|
||||
# Print the HTTP and FTP server responses
|
||||
server_response = on
|
||||
|
||||
# Disguise as IE 9 on Windows 7
|
||||
user_agent = Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
|
Loading…
Reference in New Issue
Block a user