Skip to content

Instantly share code, notes, and snippets.

@meyt
Created October 1, 2023 04:03
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 meyt/c6a369423b7fcb87e5474a53ca184937 to your computer and use it in GitHub Desktop.
Save meyt/c6a369423b7fcb87e5474a53ca184937 to your computer and use it in GitHub Desktop.
.bashrc
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# paths
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=$PATH:$HOME/.node/bin
export PATH=$PATH:$HOME/.local/bin
export PATH=$PATH:/opt/lampp/bin
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
export ANDROID_HOME="/opt/android-sdk"
export ANDROID_SDK_ROOT="$ANDROID_HOME"
export PATH=${PATH}:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools:$ANDROID_HOME/platforms:$ANDROID_HOME/tools/bin
export ZSH=/home/dobby/.oh-my-zsh
export PATH=$PATH:/opt/gradle/gradle-5.6/bin
export PATH=$PATH:$HOME/flutter/bin
export PATH=$PATH:/opt/dasht/bin
export PATH=$PATH:/opt/haskell
export PATH=$PATH:/opt/emsdk:/opt/emsdk/upstream/emscripten
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:$HOME/.cargo/bin
# colors
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
# bash completion settings (actually, these are readline settings)
bind "set completion-ignore-case on" # note: bind used instead of sticking these in .inputrc
bind "set bell-style none" # no bell
bind "set show-all-if-ambiguous On" # show list automatically, without double tab
# Turn on advanced bash completion if the file exists (get it here: http://www.caliban.org/bash/index.shtml#completion)
[ -f /etc/bash_completion ] && source /etc/bash_completion
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
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)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# my works auto-completion
source ~/.local/bin/works.sh
# git auto-completion
source /usr/share/bash-completion/completions/git
# arrow-up history search
bind '"\e[A": history-search-backward'
bind '"\eOA": history-previous-history'
# set variable identifying the chroot you work in (used in the prompt below)
[ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ] && debian_chroot="$(</etc/debian_chroot) "
export PS1='\n${debian_chroot:+($debian_chroot )}\[\e[32m\]\u@\h \[\e[93m\]$(git branch 2>/dev/null | grep '"'"'*'"'"' | colrm 1 2) \[\e[0m\]\w\n▶ '
# This runs before the prompt and sets the title of the xterm* window. If you set the title in the prompt
# weird wrapping errors occur on some systems, so this method is superior
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*} ${PWD}"; echo -ne "\007"'
# Aliases
alias pypi-publish="python setup.py sdist bdist_wheel && twine upload --skip-existing dist/*"
alias untar='tar -zxvf '
alias wget='wget -c '
alias getpass="openssl rand -base64 20"
alias ipe='curl ipinfo.io/ip'
alias c='clear'
alias setclip="xclip -selection c"
alias getclip="xclip -selection c -o"
alias curltime="curl -o /dev/null -s -w 'Total: %{time_total}\n'"
# alert when done
#trap '_start=$SECONDS' DEBUG
#PROMPT_COMMAND='(if (( SECONDS - _start > 5 )); then notify-send "Long running command
#ended"; fi)'
# Transfer.sh
transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment