-
-
Save JamesWCCheng/159f068bd0bc9c4384fc71826fa58332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[ -r ~/.bashrc ]] && . ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
[ -r ~/.bash_aliases ] && . ~/.bash_aliases | |
[ -r /etc/bash_completion ] && . /etc/bash_completion | |
[ -r ~/.bash_completion ] && . ~/.bash_completion | |
export EDITOR=vim | |
export PATH="/opt/local/bin:/opt/local/sbin:$PATH" | |
export PATH="$HOME/.local/bin:$HOME/.local/sbin:$PATH" | |
export HISTCONTROL=ignoreboth:erasedups | |
export HISTFILESIZE=1000000 | |
export HISTSIZE=1000000 | |
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND" | |
shopt -s histappend | |
shopt -s checkwinsize | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="\u@\h:\W \$(parse_git_branch)\\$ " | |
[ -r ~/.bashrc_loader ] && . ~/.bashrc_loader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GTK_IM_MODULE=ibus | |
export XMODIFIERS=@im=ibus | |
export QT_IM_MODULE=ibus | |
################################ | |
# SSH-Agent # | |
################################ | |
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 | |
for pkey in ~/.ssh/id_ecdsa ~/.ssh/id_rsa | |
do | |
test -f $pkey && chmod 600 $pkey && /usr/bin/ssh-add $pkey; | |
done | |
} | |
# Source SSH settings, if applicable | |
if [ -f "${SSH_ENV}" ]; then | |
. "${SSH_ENV}" > /dev/null | |
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { | |
start_agent; | |
} | |
else | |
start_agent; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################ | |
# Platform Dependent Files # | |
################################ | |
PLATFORM=$(uname -s) | |
BASHRC_PLATFORM=~/.bashrc_${PLATFORM,,} | |
[ -r $BASHRC_PLATFORM ] && . $BASHRC_PLATFORM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim: set sw=4 ts=4 sts=4 et fileencoding=utf-8 : | |
import os | |
import sys | |
BASE_DIR = os.path.abspath(os.path.dirname(__file__)) | |
TARGET_DIR = os.environ['HOME'] | |
FILES = filter(lambda f: f.startswith('dot.'), os.listdir(BASE_DIR)) | |
def main(argv): | |
for f in FILES: | |
link_name = os.path.join(TARGET_DIR, f[3:]) | |
target_name = os.path.join(BASE_DIR, f) | |
if os.path.islink(link_name): | |
os.unlink(link_name) | |
print 'Installing %s' % link_name | |
os.symlink(target_name, link_name) | |
if __name__ == '__main__': | |
try: | |
main(sys.argv) | |
except KeyboardInterrupt: | |
print 'abort' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment