Skip to content

Instantly share code, notes, and snippets.

@netravnen
Created September 13, 2019 13:23
Show Gist options
  • Save netravnen/5555ff987e91f6c750a7aa4ecca98e49 to your computer and use it in GitHub Desktop.
Save netravnen/5555ff987e91f6c750a7aa4ecca98e49 to your computer and use it in GitHub Desktop.
Quick basic bash profile
# $HOME/.bashrc: executed by bash(1) for non-login shells.
export GPG_TTY=$(tty)
# If not running interactively, do not do anything
[ -z "$PS1" ] && return
HISTCONTROL=ignoreboth
HISTCONTROL=ignoredups
HISTCONTROL=ignorespace
HISTFILESIZE=25000
HISTIGNORE="ls:bg:fg:history"
HISTSIZE=25000
HISTTIMEFORMAT="%F %T "
PROMPT_COMMAND="history -a"
shopt -s cmdhist
shopt -s histappend
shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if [ -x /usr/bin/dircolors ] ; then eval "$(dircolors -b)" ; fi
if [ -f /etc/bash_completion ] && ! shopt -oq posix ; then source /etc/bash_completion ; fi
if [ -d $HOME/bin ] ; then PATH="$HOME/bin:$PATH" ; fi
if [ -d $HOME/bin/xlogin ] ; then PATH="$HOME/bin/xlogin:$PATH" ; fi
if [ -f $HOME/.bash_aliases ] ; then source $HOME/.bash_aliases ; fi
if [ -f /usr/local/bin/virtualenvwrapper.sh ] ; then source /usr/local/bin/virtualenvwrapper.sh ; fi
if [ -d $HOME/.cargo/env ] ; then source $HOME/.cargo/env ; fi
# PS1
parse_git_branch() { git branch 2> /dev/null | sed -e "/^[^*]/d" -e "s/* \(.*\)/ (\1)/"; };
_dt="\D{%Y-%m-%d}T\tZ"
_username="\u"
_hostname="$(hostname --short).$(hostname --domain)"
_currentdir="\w"
BLUE="\[\033[0;34m\]"
DARK_BLUE="\[\033[1;34m\]"
RED="\[\e[0;31m\]"
DARK_RED="\[\033[1;31m\]"
BROWN="\[\e[0;33m\]"
NO_COLOR="\[\e[m\]"
export PS1="\n$BROWN[$_dt] $_username @ $RED$_hostname$BROWN > $_currentdir$NO_COLOR \$(parse_git_branch)\n$BLUE\\$\[$(tput sgr0)\]$NO_COLOR "
6p() { curl -s -F "content=<${1--}" -F ttl=604800 -w "%{redirect_url}\n" -o /dev/null https://p.6core.net/; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment