Skip to content

Instantly share code, notes, and snippets.

@d33pcode
Last active February 8, 2016 22:18
Show Gist options
  • Select an option

  • Save d33pcode/0977d529b53c6408ef10 to your computer and use it in GitHub Desktop.

Select an option

Save d33pcode/0977d529b53c6408ef10 to your computer and use it in GitHub Desktop.
Customizing bashrc
##################################
# d33pcode's custom bashrc #
##################################
# geeky tweaks for your terminal #
##################################
#EXPORTS
export JAVA_HOME=/usr/java/latest/jre
export STUDIO_JDK=/usr/java/jdk1.7.0_79
export PATH=/opt/bin/local:/usr/lib/jvm/java-7-openjdk-amd64/bin:$PATH
export DERBY_HOME=/usr/lib/jvm/java-7-openjdk-amd64/db
export PATH=~/Dev/android-studio/bin:$PATH
export PATH=/opt:$PATH
export PATH=/bin:$PATH
export PATH=/opt/tor/:$PATH
# Useful aliases
alias install="sudo dnf install -y"
alias remove="sudo dnf remove -y"
alias update="sudo dnf update -y && sudo dnf upgrade -y"
alias search="dnf search"
alias home="cd ~"
alias disk="cd /"
alias up="cd .."
alias most-used="history | awk '{print $2}' | awk '"'BEGIN {FS="|"}{print $1}'"' | sort | uniq -c | sort -n | tail | sort -nr"
# Aliases for programs / miscellaneous..
#alias controller="sudo xboxdrv --detach-kernel-driver --led 2"
alias android-studio="/opt/android-studio/bin/studio.sh"
# Enable ls color support && add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --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 -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
#######################
# DEVELOPMENT SECTION #
#######################
# dev - aliases
alias food="envsetup && lunch"
alias mka='schedtool -B -n 1 -e ionice -n 1 make -j$(cat /proc/cpuinfo | grep "^processor" | wc -l) "$@"'
# functions
envsetup() {
WORK_PATH=$(pwd)
cd $WORK_PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
export USE_CCACHE=1
export CCACHE_DIR=./ccache
export J2SDKDIR=/usr/lib/jvm/java-1.6.0-openjdk-amd64
export PATH=/usr/lib/jvm/java-1.6.0-openjdk-amd64/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64
export DERBY_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64/db
CCHACHE_BIN_DIR=./prebuilt/linux-x86/ccache
if [ -d "./prebuilts/misc/linux-x86/ccache" ]; then
CCHACHE_BIN_DIR=./prebuilts/misc/linux-x86/ccache
fi
$CCHACHE_BIN_DIR/ccache -M 10G
. build/envsetup.sh
}
clean() {
make clean
make clobber
rm -rf out
}
full_clean() {
envsetup
lunch
make clean
make clobber
rm -rf out
rm -rf ccache
}
#################
# MISCELLANEOUS #
#################
#title function
set-title(){
ORIG=$PS1
TITLE="\e]2;$@\a"
PS1=${ORIG}${TITLE}
}
#use MARS everywhere
alias mars='java -jar ~/Mars4_5.jar'
# Include the following lines in your .bashrc and you'll only need to edit 'bash_tweaks'
# instead of modifying your bashrc
if [ -f ~/bash_tweaks ]; then
. ~/bash_tweaks
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment