Skip to content

Instantly share code, notes, and snippets.

@Kronuz
Created April 5, 2018 14:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kronuz/9cb23a0a263e774e33793fe0fb6f2806 to your computer and use it in GitHub Desktop.
Save Kronuz/9cb23a0a263e774e33793fe0fb6f2806 to your computer and use it in GitHub Desktop.
profile
#!/bin/sh
################################################################################
dubalu() {
if [ -z "$DUBALU_LEGEND" -o -n "$1" ]; then
if [ -t 1 -o "$1" = "color" ]; then
printf '\n'
printf ' \033[1;38;2;189;74;10m8888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m8888888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m888888K\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m8888888o.\033[0m \033[1;38;2;200;200;200mo8888888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m8888888o\033[0m \033[1;38;2;200;200;200m`V8888o.\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m,A8"\033[0m \033[1;38;2;189;74;10m`Y88888b.\033[0m \033[1;38;2;200;200;200m.d88\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m"88b.\033[0m \033[1;38;2;200;200;200m`Y88\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m.8888b\033[0m \033[1;38;2;189;74;10m8888888b\033[0m \033[1;38;2;200;200;200m+888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m8888\033[0m \033[1;38;2;200;200;200m888+,d888888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m\n'
printf ' \033[1;38;2;189;74;10m88888$\033[0m \033[1;38;2;189;74;10mY8888888\033[0m \033[1;38;2;200;200;200m`888o,8888\033[0m \033[1;38;2;200;200;200ml88+.888\033[0m \033[1;38;2;200;200;200m8888,d88P\033[0m \033[1;38;2;200;200;200m88X`\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200ml88+.888\033[0m\n'
printf ' \033[1;38;2;189;74;10m"888P\033[0m \033[1;38;2;189;74;10m"Y888P"\033[0m \033[1;38;2;200;200;200m"888888"\033[0m \033[1;38;2;200;200;200m"Y888PY\033[0m \033[1;38;2;200;200;200m"88888P"\033[0m \033[1;38;2;200;200;200m`Y8888PY\033[0m \033[1;38;2;200;200;200m888\033[0m \033[1;38;2;200;200;200m"Y888PY\033[0m\n'
printf ' \033[1;38;2;189;74;10m`""`\033[0m\n'
printf '\n'
else
printf '\n'
printf ' d8888 8888 8888 888\n'
printf ' 8888888 8888 8888 888\n'
printf ' 888888K 8888 8888 888\n'
printf ' 8888888o. o8888888 888 888 8888888o `V8888o. 888 888 888\n'
printf ' ,A8" `Y88888b. .d88 8888 888 888 8888 "88b. `Y88 888 888 888\n'
printf ' .8888b 8888888b +888 8888 888 888 8888 888+,d888888 888 888 888\n'
printf ' 88888$ Y8888888 `888o,8888 l88+.888 8888,d88P 88X` 888 888 l88+.888\n'
printf ' "888P "Y888P" "888888" "Y888PY "88888P" `Y8888PY 888 "Y888PY\n'
printf ' `""`\n'
printf '\n'
fi
export DUBALU_LEGEND=PRINTED
fi
}
################################################################################
# /etc/profile
################################################################################
export IP="$(/sbin/ifconfig | grep 'inet ' | grep -v '127.0.0.1' | head -1 | awk '{print $2;}')"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
export PYTHONIOENCODING='utf-8'
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
export LC_CTYPE='UTF-8'
# Fix pstree on FreeBSD jails and remove leading 0 in process numbers:
alias pstree='/bin/sh -c "echo root 0 0 0 [kernel]; echo root 1 0 1 /sbin/init --; ps -axwwo user,pid,ppid,pgid,command" | /usr/local/bin/pstree -f - | sed "s/ 0*/ /g"'
alias gup='/bin/sh -c "/usr/local/bin/knock && git stash && git pull --rebase && (git stash pop; git push)"'
# alias ls='ls -IG' # Do not add -A (-I) and colorize output
alias vi='vim -N' # Less compatible (with vi) vim mode
# Add ANSI color to less/more (for git and others):
export LESS=-RFX
export MORE=-RFX
# Make Sublime Text the default editor when available
# only fools wouldn't do this ;-)
if command -v subl > /dev/null; then
export EDITOR="subl --wait --new-window"
export VISUAL="subl --wait --new-window"
else
export VISUAL=vim
export EDITOR=vim
alias subl=vim
fi
# Man colors (for colored pages only):
#export MANCOLOR=1 # Needs patched grotty for both MANCOLOR and LESS_TERMCAP_* to work
export MANWIDTH=tty
export GROFF_OLD_SCHEME=1
export LESS_TERMCAP_me=$(printf '\033[0m') # end mode
export LESS_TERMCAP_mb=$(printf '\033[05m\033[38;05;173m') # begin blinking
export LESS_TERMCAP_md=$(printf '\033[01m\033[38;05;173m') # begin bold
export LESS_TERMCAP_se=$(printf '\033[0m') # end standout-mode
export LESS_TERMCAP_so=$(printf '\033[01;44;33m') # begin standout-mode - info box
export LESS_TERMCAP_us=$(printf '\033[04m\033[38;05;113m') # begin underline
export LESS_TERMCAP_ue=$(printf '\033[0m') # end underline
# Grep colors
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;37'
# Add highlight to less/more (needs ports/textproc/source-highlight):
if [ -x "/usr/local/bin/ccat" ]; then
alias cat="/usr/local/bin/ccat"
export LESSOPEN="| /usr/local/bin/ccat %s --highlight"
fi
if [ -s "/shared/tools.sh" ]; then
. "/shared/tools.sh"
fi
# Google Cloud SDK PATH and shell command completion for gcloud:
if [ -d "/usr/local/google-cloud-sdk" ]; then
. "/usr/local/google-cloud-sdk/path.zsh.inc"
. "/usr/local/google-cloud-sdk/completion.zsh.inc"
fi
################################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment