Skip to content

Instantly share code, notes, and snippets.

@theironsamurai
Last active May 23, 2020 22:20

Revisions

  1. theironsamurai revised this gist Oct 22, 2015. 1 changed file with 15 additions and 15 deletions.
    30 changes: 15 additions & 15 deletions .bash_aliases.sh
    Original file line number Diff line number Diff line change
    @@ -4,37 +4,36 @@ export ALTERNATE_EDITOR="emacs"
    export EDITOR="emacsclient -t"

    # Haskell
    export PATH="$HOME/.cabal/bin":$PATH
    # export PATH="$HOME/.cabal/bin":$PATH

    # Clojure
    export PATH="$HOME/.lein":$PATH
    # export PATH="$HOME/.lein":$PATH

    # ClojureScript

    export CLOJURESCRIPT_HOME=$HOME/clojurescript
    # export CLOJURESCRIPT_HOME=$HOME/clojurescript

    # Python

    export WORKON_HOME=$HOME/.virtualenvs
    export PROJECT_HOME=$HOME/snakepit
    # export WORKON_HOME=$HOME/.virtualenvs
    # export PROJECT_HOME=$HOME/snakepit
    # source /usr/bin/virtualenvwrapper.sh

    # Ruby Paths
    export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
    # export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

    # PATH="`ruby -e 'puts Gem.user_dir'`/bin:$PATH"

    # Tell Bundler to install Gems (on Arch) to the user dir
    # export GEM_HOME=$(ruby -e 'puts Gem.user_dir')

    # Tab completion for RVM
    [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion
    # [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion

    # NVM
    if [ -s ~/.nvm/nvm.sh ]; then
    NVM_DIR=~/.nvm
    source ~/.nvm/nvm.sh
    fi
    # if [ -s ~/.nvm/nvm.sh ]; then
    # NVM_DIR=~/.nvm
    # source ~/.nvm/nvm.sh
    # fi

    # Super-Spy Aliases!
    alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
    @@ -82,7 +81,8 @@ alias cdbbbb="cd ../../../.."
    alias cdscribe="cd ~/.emacs.d/personal"

    # Jekyll
    alias jsw="jekyll serve -w"
    # alias jsw="jekyll serve -w"

    # Git
    alias gitlazy="git add --all && git commit -m 'lazy commit' && git push"

    @@ -144,6 +144,6 @@ prompt

    # Auto load Screenfetch (just uncomment once you've installed it)
    # NOTE: on Fedora, you'll need to install 'screenfetch-dev', rather than
    # just 'Screenfetch' on Arch
    # just 'screenfetch' on Arch and Ubuntu

    screenfetch
    screenfetch
  2. theironsamurai revised this gist Jan 13, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_aliases.sh
    Original file line number Diff line number Diff line change
    @@ -62,6 +62,7 @@ alias ec="emacsclient -c"
    alias demacs="emacs --daemon"
    alias kemacs="emacsclient -e '(kill-emacs)'"
    alias etb="et .bashrc"
    alias E="SUDO_EDITOR=\"emacsclient -t -a emacs\" sudoedit"

    # iPython
    alias etip="et ~/.config/ipython/profile_default/ipython_config.py"
  3. theironsamurai renamed this gist Jan 13, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. theironsamurai created this gist Jan 13, 2015.
    148 changes: 148 additions & 0 deletions .bash_aliases
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,148 @@
    # Bash_Aliases on Ubuntu

    export ALTERNATE_EDITOR="emacs"
    export EDITOR="emacsclient -t"

    # Haskell
    export PATH="$HOME/.cabal/bin":$PATH

    # Clojure
    export PATH="$HOME/.lein":$PATH

    # ClojureScript

    export CLOJURESCRIPT_HOME=$HOME/clojurescript

    # Python

    export WORKON_HOME=$HOME/.virtualenvs
    export PROJECT_HOME=$HOME/snakepit
    # source /usr/bin/virtualenvwrapper.sh

    # Ruby Paths
    export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

    # PATH="`ruby -e 'puts Gem.user_dir'`/bin:$PATH"

    # Tell Bundler to install Gems (on Arch) to the user dir
    # export GEM_HOME=$(ruby -e 'puts Gem.user_dir')

    # Tab completion for RVM
    [[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion

    # NVM
    if [ -s ~/.nvm/nvm.sh ]; then
    NVM_DIR=~/.nvm
    source ~/.nvm/nvm.sh
    fi

    # Super-Spy Aliases!
    alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
    alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
    alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
    alias grep='grep --color=tty -d skip'
    alias cp="cp -i" # confirm before overwriting something
    alias df='df -h' # human-readable sizes
    alias free='free -m' # show sizes in MB
    alias sbash="source .bashrc"
    # Arch-Based Specific
    alias pac="pacaur -S"

    # Ubuntu-specific
    alias ubi="sudo apt-get install"
    alias ubi-up="sudo apt-get update"
    alias ubi-upg="sudo apt-get upgrade"
    alias ubi-upd="sudo apt-get dist-upgrade"
    alias ubi-add="sudo add-apt-repository"

    # Emacs
    alias etp='emacsclient -t PKGBUILD'
    alias et="emacsclient -t"
    alias ec="emacsclient -c"
    alias demacs="emacs --daemon"
    alias kemacs="emacsclient -e '(kill-emacs)'"
    alias etb="et .bashrc"

    # iPython
    alias etip="et ~/.config/ipython/profile_default/ipython_config.py"
    alias etipn="et ~/.config/ipython/profile_default/ipython_notebook_config.py"
    alias ipn="ipython notebook"
    alias ipc="nbconvert"
    alias ipm="nbconvert --to markdown"

    # Dir
    alias cdhome="cd ~/"
    alias cdh="cd ~/"
    alias cdw="cd ~/writing"
    alias cdb="cd .."
    alias cdbb="cd ../.."
    alias cdbbb="cd ../../.."
    alias cdbbbb="cd ../../../.."
    alias cdscribe="cd ~/.emacs.d/personal"

    # Jekyll
    alias jsw="jekyll serve -w"
    # Git
    alias gitlazy="git add --all && git commit -m 'lazy commit' && git push"

    # ex - archive extractor
    # usage: ex <file>
    ex ()
    {
    if [ -f $1 ] ; then
    case $1 in
    *.tar.bz2) tar xjf $1 ;;
    *.tar.gz) tar xzf $1 ;;
    *.bz2) bunzip2 $1 ;;
    *.rar) unrar x $1 ;;
    *.gz) gunzip $1 ;;
    *.tar) tar xf $1 ;;
    *.tbz2) tar xjf $1 ;;
    *.tgz) tar xzf $1 ;;
    *.zip) unzip $1 ;;
    *.Z) uncompress $1;;
    *.7z) 7z x $1 ;;
    *) echo "'$1' cannot be extracted via ex()" ;;
    esac
    else
    echo "'$1' is not a valid file"
    fi
    }

    # CUSTOM BASH COLOR PROMPT
    # 30m - Black
    # 31m - Red
    # 32m - Green
    # 33m - Yellow
    # 34m - Blue
    # 35m - Purple
    # 36m - Cyan
    # 37m - White
    # 0 - Normal
    # 1 - Bold
    function prompt {
    local BLACK="\[\033[0;30m\]"
    local BLACKBOLD="\[\033[1;30m\]"
    local RED="\[\033[0;31m\]"
    local REDBOLD="\[\033[1;31m\]"
    local GREEN="\[\033[0;32m\]"
    local GREENBOLD="\[\033[1;32m\]"
    local YELLOW="\[\033[0;33m\]"
    local YELLOWBOLD="\[\033[1;33m\]"
    local BLUE="\[\033[0;34m\]"
    local BLUEBOLD="\[\033[1;34m\]"
    local PURPLE="\[\033[0;35m\]"
    local PURPLEBOLD="\[\033[1;35m\]"
    local CYAN="\[\033[0;36m\]"
    local CYANBOLD="\[\033[1;36m\]"
    local WHITE="\[\033[0;37m\]"
    local WHITEBOLD="\[\033[1;37m\]"
    export PS1="\n$CYAN\T\n$GREENBOLD \u$YELLOWBOLD@$PURPLEBOLD\h\[\033[00m\]:$CYANBOLD[\w]\[\033[00m\] \\$ "
    }
    prompt

    # Auto load Screenfetch (just uncomment once you've installed it)
    # NOTE: on Fedora, you'll need to install 'screenfetch-dev', rather than
    # just 'Screenfetch' on Arch

    screenfetch