Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PATH="$HOME/bin:$PATH"
- # Enabling colors:
- alias less='less --RAW-CONTROL-CHARS'
- alias ls='ls '
- export TERM=xterm-color
- # Useful aliases:
- alias ll='ls -lah'
- alias lsd='ls -alF | grep /$'
- alias findhere='find . | grep'
- alias folders='find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn'
- alias grep='grep --color=auto'
- alias mroe='more'
- alias gerp='grep'
- # Setting up history:
- HISTSIZE=500000000 # Setting size of history file. To make sure it is sufficiently large.
- HISTFILESIZE=5000000000
- HISTCONTROL=ignoredups # Ignoring duplicates
- shopt -s histappend # Adding lines to history every time a console is closed:
- shopt -s cmdhist # Combine multiline commands into one in history
- export HISTIGNORE="&:ls:bg:fg:exit:cd:pwd:ll:findhere:folders"
- # Setting up proper history scroll:
- bind '"^[[A":history-search-backward'
- bind '"^[[B":history-search-backward'
- # Setting up PERL5LIB path:
- export PERL5LIB=$PERL5LIB:~/perl5/lib/perl5/
- # Setting up prompt:
- export PS1="\[\e[1;30m\]\A \u@\h\[\e[m\]:\[\e[1;32m\]\W\[\e[m\]$ "
- # Adding alias for remote ipython notebook:
- alias ssh='ssh -Y'
- function ipython_remote { ssh -N -f -L localhost:${1}:localhost:${1} ds26@${2}; }
- function ipython_kill {
- if [[ -z ${1} ]]; then
- echo "Port number is required! The following ports are active:"
- ps -e | grep ssh | grep localhost | perl -lane '($p) = $_ =~ /\:localhost\:(\d+)/; ($h) = $_ =~ /@(\S+)/; print "Port $p on host $h"'
- return 1;
- fi
- PID=$(ps -e | grep ssh | grep localhost:${1} | awk -F " " '{print $1}')
- if [[ -z ${PID} ]]; then
- echo "There is no ssh tunnel open on port ${1}."
- fi
- kill ${PID}
- }
- # If the profile file won't be loaded by any chance:
- source ~/.profile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement