Skip to content

Instantly share code, notes, and snippets.

@hroncok
Last active February 27, 2020 12:23
Show Gist options
  • Save hroncok/85ba7e7e49400124c805 to your computer and use it in GitHub Desktop.
Save hroncok/85ba7e7e49400124c805 to your computer and use it in GitHub Desktop.
.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Expand history size
HISTSIZE=100000
export EDITOR=micro
watchlog() {
watch --color -n ${2:-5} "wget -qO- '$1' | tail -n ${3:-50}"
}
watchlogz() {
watch --color -n ${2:-5} "wget -qO- '$1' | gzip -d | tail -n ${3:-50}"
}
_rpmspec_p() {
{ rpmspec -P $1 2>&1 1>&3 | grep -v 'extra tokens at the end' | grep -v '^$' 1>&2; } 3>&1
}
sourceget() {
spectool -g <(_rpmspec_p ${1:-$(fedpkg gimmespec)})
}
hg_dirty() {
hg status 2> /dev/null | awk '{print $1}' | sort | uniq | tr -d '\n'
}
hg_branch() {
[[ `hg branch 2> /dev/null` ]] && echo -n ' (' && echo -n `hg branch 2> /dev/null` && echo -n `hg_dirty` && echo ')'
}
source /usr/share/git-core/contrib/completion/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
jobscount() {
local stopped=$(jobs -sp | wc -l)
local running=$(jobs -rp | wc -l)
((running+stopped)) && echo -n " (${running}/${stopped})"
}
#export PS1='[\[\e[1;34m\]\W\[\e[m\]\[\e[1;36m\]$(jobscount)\e[1;33m$(declare -F __git_ps1 &>/dev/null && __git_ps1 " (%s)")$(hg_branch)\[\e[m\]]\$ '
export PS1='[\[\e[1;34m\]\W\[\e[m\]\[\e[1;33m\]$(declare -F __git_ps1 &>/dev/null && __git_ps1 " (%s)")$(hg_branch)\[\e[m\]]\$ '
# Red Hat automatic proxy settings
#export auto_proxy=https://hdn.corp.redhat.com/proxy.pac
# Java stuff
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
alias nano='micro'
alias u='micro'
alias editrc='micro ~/.bashrc'
alias loadrc='. ~/.bashrc'
alias bumpspec=rpmdev-bumpspec
alias mplayer=mpv
alias makej='make -j`/usr/bin/nproc`'
alias o='exo-open'
alias p='pygmentize -O style=friendly'
alias i3='ipython3 --no-confirm-exit --no-banner'
alias i2='ipython2 --no-confirm-exit --no-banner'
alias ipypy3='~/.local/share/virtualenvs/ipypy3/bin/pypy3 -m IPython --no-confirm-exit --no-banner'
alias copy='xclip -selection c'
alias pb='git push && fedpkg build --nowait'
alias dnf='sudo dnf'
#alias repoquery='dnf repoquery'
alias ls='exa'
# Fedora Kerberos
alias koji="kswitch -p [email protected] || kinit [email protected] && koji"
alias fedpkg="kswitch -p [email protected] || kinit [email protected] && fedpkg"
# Hub
eval "$(hub alias -s)"
# added by travis gem
[ -f /home/churchyard/.travis/travis.sh ] && source /home/churchyard/.travis/travis.sh
# git diff
gdiff() {
diff -u "$@" | colordiff | less -R
}
export VAGRANT_DEFAULT_PROVIDER=virtualbox
# autojump_add_to_database is only added when su - $(whoami)
export PROMPT_COMMAND="history -a; autojump_add_to_database; $PROMPT_COMMAND"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment