Last active
December 13, 2020 09:20
-
-
Save Luxter77/0b1a15c2a85b9a7fabc5056b0b9af9e6 to your computer and use it in GitHub Desktop.
MY bashrc
This file contains hidden or 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
ppid () { ps -p ${1:-$$} -o ppid=; } | |
if [ $(ps -p $(ppid) -o comm=) != "sshd" ] | |
then | |
cat ~/.mista | |
fi | |
echo " --->" $( curl ifconfig.co --silent -m 2) "<---" | |
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/share/games:/usr/share:/usr/local/sbin:/usr/sbin:/sbin:~/.local/bin:/snap/bin:/usr/local/share/man:/usr/share/man:$PATH | |
# Locale and editor | |
export EDITOR=nano | |
export BROWSER="google-chrome '%s' &" | |
# don't put duplicate lines or lines starting with space in the history. | |
# See bash(1) for more options | |
export HISTCONTROL=ignoreboth | |
# append to the history file, don't overwrite it | |
shopt -s histappend | |
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
export HISTSIZE=10000 | |
export HISTFILESIZE=20000 | |
# check the window size after each command and, if necessary, | |
# update the values of LINES and COLUMNS. | |
shopt -s checkwinsize | |
# If set, the pattern "**" used in a pathname expansion context will | |
# match all files and zero or more directories and subdirectories. | |
shopt -s globstar | |
# make less more friendly for non-text input files, see lesspipe(1) | |
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" | |
# set variable identifying the chroot you work in (used in the prompt below) | |
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then | |
debian_chroot=$(cat /etc/debian_chroot) | |
fi | |
# set a fancy prompt (non-color, unless we know we "want" color) | |
case "$TERM" in | |
xterm-color|*-256color) color_prompt=yes;; | |
esac | |
# uncomment for a colored prompt, if the terminal has the capability; turned | |
# off by default to not distract the user: the focus in a terminal window | |
# should be on the output of commands, not on the prompt | |
#force_color_prompt=yes | |
if [ -n "$force_color_prompt" ]; then | |
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
# We have color support; assume it's compliant with Ecma-48 | |
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such | |
# a case would tend to support setf rather than setaf.) | |
color_prompt=yes | |
else | |
color_prompt= | |
fi | |
fi | |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | |
fi | |
unset color_prompt force_color_prompt | |
# If this is an xterm set the title to user@host:dir | |
case "$TERM" in | |
xterm*|rxvt*) | |
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" | |
;; | |
*) | |
;; | |
esac | |
#netinfo - shows network information for your system | |
netinfo () | |
{ | |
echo "--------------- Network Information ---------------" | |
/sbin/ifconfig | awk /'inet addr/ {print $2}' | |
/sbin/ifconfig | awk /'Bcast/ {print $3}' | |
/sbin/ifconfig | awk /'inet addr/ {print $4}' | |
/sbin/ifconfig | awk /'HWaddr/ {print $4,$5}' | |
myip=`lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/ | sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g' ` | |
echo "${myip}" | |
echo "---------------------------------------------------" | |
} | |
#extract () { | |
# if [ -f $1 ] ; then | |
# case $1 in | |
# *.tar.bz2) tar xvjf $1 ;; | |
# *.tar.gz) tar xvzf $1 ;; | |
# *.tar.xz) tar xvf $1 ;; | |
# *.bz2) bunzip2 $1 ;; | |
# *.rar) rar x $1 ;; | |
# *.gz) gunzip $1 ;; | |
# *.tar) tar xvf $1 ;; | |
# *.tbz2) tar xvjf $1 ;; | |
# *.tgz) tar xvzf $1 ;; | |
# *.zip) unzip $1 ;; | |
# *.Z) uncompress $1 ;; | |
# *.7z) 7z x $1 ;; | |
# *) echo "'$1' cannot be extracted via extract()" ;; | |
# esac | |
# else | |
# echo "'$1' is not a valid file" | |
# fi | |
#} | |
# uncomment for a colored prompt, if the terminal has the capability; turned | |
# off by default to not distract the user: the focus in a terminal window | |
# should be on the output of commands, not on the prompt | |
force_color_prompt=yes | |
if [ -n "$force_color_prompt" ]; then | |
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
# We have color support; assume it's compliant with Ecma-48 | |
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such | |
# a case would tend to support setf rather than setaf.) | |
export color_prompt=yes | |
else | |
export color_prompt= | |
fi | |
fi | |
if [ "$color_prompt" = yes ]; then | |
export PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]" | |
else | |
export PS1='┬──[\u@\h]─[\w]\n└──╼ \$ ' | |
fi | |
# Set 'man' colors | |
if [ "$color_prompt" = yes ]; then | |
man() { | |
env \ | |
export LESS_TERMCAP_mb=$'\e[01;31m' \ | |
export LESS_TERMCAP_md=$'\e[01;31m' \ | |
export LESS_TERMCAP_me=$'\e[0m' \ | |
export LESS_TERMCAP_se=$'\e[0m' \ | |
export LESS_TERMCAP_so=$'\e[01;44;33m' \ | |
export LESS_TERMCAP_ue=$'\e[0m' \ | |
export LESS_TERMCAP_us=$'\e[01;32m' \ | |
man "$@" | |
} | |
fi | |
unset color_prompt force_color_prompt | |
# If this is an xterm set the title to user@host:dir | |
case "$TERM" in | |
xterm*|rxvt*) | |
export PS1="\[\033[0;31m\]\342\224\214\342\224\200\$([[ \$? != 0 ]] && echo \"[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200\")[$(if [[ ${EUID} == 0 ]]; then echo '\[\033[01;31m\]root\[\033[01;33m\]@\[\033[01;96m\]\h'; else echo '\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h'; fi)\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\\$\[\e[0m\]" | |
;; | |
*) | |
;; | |
esac | |
# enable color support of ls and also add handy aliases | |
if [ -x /usr/bin/dircolors ]; then | |
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
alias ls='ls -v --color=auto' | |
alias dir='dir --color=auto' | |
alias vdir='vdir --color=auto' | |
alias grep='grep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias egrep='egrep --color=auto' | |
fi | |
# some more ls aliases | |
alias ll='ls -lh' | |
alias la='ls -lha' | |
alias l='ls -CF' | |
alias em='emacs -nw' | |
alias dd='dd status=progress' | |
alias _='sudo' | |
alias _i='sudo -i' | |
alias r='reset' | |
alias yup='sudo apt -y update' | |
alias yupg='sudo apt upgrade' | |
alias c='cd' | |
alias k='pkill' | |
alias pi='ping' | |
alias ipa='ip a' | |
alias plz='sudo' | |
#alias apt='dnf' | |
alias aptitude='sudo aptitude' | |
alias sudo='sudo ' | |
alias fuck='TF_CMD=$(TF_ALIAS=fuck PYTHONIOENCODING=utf-8 TF_SHELL_ALIASES=$(alias) thefuck $(fc -ln -1)) && eval $TF_CMD; history -s $TF_CMD' | |
alias c='clear' | |
alias maek='make' | |
alias cclear='echo "you idiot"; clear' | |
# Alias definitions. | |
# You may want to put all your additions into a separate file like | |
# ~/.bash_aliases, instead of adding them here directly. | |
# See /usr/share/doc/bash-doc/examples in the bash-doc package. | |
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi | |
# colored GCC warnings and errors | |
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' | |
# enable programmable completion features (you don't need to enable | |
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile | |
# sources /etc/bash.bashrc). | |
if ! shopt -oq posix; then | |
if [ -f /usr/share/bash-completion/bash_completion ]; then | |
. /usr/share/bash-completion/bash_completion | |
elif [ -f /etc/bash_completion ]; then | |
. /etc/bash_completion | |
fi | |
fi | |
# check if local bin folder exist | |
# $HOME/bin | |
# prepend it to $PATH if so | |
if [ -d $HOME/bin ]; then | |
export PATH+=:$PATH | |
fi | |
if [ -d $HOME/opt/android-ndk-r19c ]; then | |
export PATH+=:$HOME/opt/android-ndk-r19c | |
fi | |
#tput rmcup | |
export MAKEFLAGS='-j 2' | |
if [ "$(whoami)" == "lfs" ]; then | |
set +h | |
umask 022 | |
export LFS=/mnt/lfs | |
export LC_ALL=POSIX | |
export LFS_TGT=$(uname -m)-lfs-linux-gnu | |
export PATH=/tools/bin:/bin:/usr/bin | |
echo "Ready To LFS" | |
fi | |
if [ -d $HOME/opt/sphinxbase ]; then | |
export LD_LIBRARY_PATH+=:$HOME/opt/sphinxbase/src/libsphinxbase/.libs/:$HOME/opt/sphinxbase/src/libsphinxad/.libs/:$HOME/opt/pocketsphinx/src/libpocketsphinx/.libs/ | |
fi | |
if [ -d $HOME/opt/gems ]; then | |
export GEM_HOME=$HOME/opt/gems | |
export PATH+=:$HOME/opt/gems/bin | |
fi | |
#onda-setup() { | |
# if [ -d $HOME/opt/miniconda3 ]; then | |
# conda_setup="$($HOME'/opt/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" | |
# if [ $? -eq 0 ]; then | |
# eval "$conda_setup" | |
# else | |
# if [ -f $HOME"/opt/miniconda3/etc/profile.d/conda.sh" ]; then | |
# . $HOME"/opt/miniconda3/etc/profile.d/conda.sh" | |
# else | |
# export PATH=$HOME"/opt/miniconda3/bin":$PATH | |
# fi | |
# fi | |
# unset conda_setup | |
# fi | |
#} | |
if [ -d $HOME/opt/go/ ]; then | |
export GOPATH=$HOME/opt/go | |
fi | |
if [ -d $HOME/.local/share/man ]; then | |
PATH+=:$HOME/.local/share/man | |
fi | |
if [ -d $HOME/opt/cargo ]; then | |
export PATH+=:$HOME/opt/cargo/bin | |
export CARGO_HOME=$HOME/opt/cargo | |
fi | |
if [ -d /usr/local/computecpp ]; then | |
export COMPUTECPP_TOOLKIT_PATH=/usr/local/computecpp | |
export LD_LIBRARY_PATH+=:/usr/local/computecpp/lib | |
fi | |
#if [ -d $HOME/??? ]; then | |
# export PATH+=:$HOME/???:$PATH | |
#fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment