From eccf576f7c3b53ae956bd66687ac1133695c3b49 Mon Sep 17 00:00:00 2001 From: ViktorBarzin Date: Sun, 21 May 2017 12:16:27 +0300 Subject: [PATCH] adding aliases and zshrc --- .bash_aliases | 42 +++++++++++++++++++++++ .bashrc | 75 +++++++++++------------------------------ .zshrc | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 56 deletions(-) create mode 100644 .bash_aliases create mode 100644 .zshrc diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..93d7ac2 --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,42 @@ +alias ls='ls --color=auto' +alias utorrent='utserver -settingspath /opt/utorrent-servealpha-v3_3/' +#alias dir='dir --color=auto' +#alias vdir='vdir --color=auto' +alias pycharm='bash /usr/share/pycharm-community-2016.2.3/bin/pycharm.sh' +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' +alias android-studio='bash /usr/share/android-studio/bin/studio.sh' +alias hackbg-python='cd /home/viktor/Documents/Software_Development/python/HackBulgaria-Python/' +alias violent-python='cd /home/viktor/Documents/Software_Development/python/violent-python' +alias django='cd /home/viktor/Documents/Software_Development/python/HackBulgaria-Django/' +alias py='python3.6' +alias bye='systemctl suspend' +alias whatisopen='netstat -pnlt' +alias calc='gcalccmd' +alias pmr='python manage.py runserver' +alias nopmr="netstat -pnlt | grep -E -o -e '[0-9]+/python' | cut -d '/' -f 1 | xargs kill" +alias pmm='python manage.py migrate' +alias pmmm='python manage.py makemigrations' + +# git aliases +alias gs='git status' +alias ga='git add .' +alias gc='git commit' +alias gp='git push origin master' + +# MSR registers is responsible for lag after suspend +alias checkcpu='modprobe msr; rdmsr -a 0x19a' +alias fixcpu='wrmsr -a 0x19a 0x0' +alias daimi="egrep --color -n -i -R $1 --exclude='*.pyc'" +alias muzika="xdg-open /home/viktor/Documents/Music/njoy.m3u" +alias randomstr="tr -dc a-z1-4 50' | tr 3-4 ' ' | sed 's/^ *//' | cat -s | sed 's/ / /g' |fmt" +alias battery="upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E 'time to empty|state|to\ full|percentage'" +alias svali_papka=download_github_folder +alias omg="service NetworkManager restart" +alias zsh_fix="mv ~/.zsh_history ~/.zsh_history_bad; strings ~/.zsh_history_bad > ~/.zsh_history;fc -R ~/.zsh_history; rm ~/.zsh_history_bad" +alias whatismyip="curl ifconfig.co" + +function download_github_folder(){ + svn checkout $(echo $1 | sed "s/\/tree\/[a-zA-Z]\+/\/trunk/") +} diff --git a/.bashrc b/.bashrc index 2678f2e..406c82d 100644 --- a/.bashrc +++ b/.bashrc @@ -1,7 +1,6 @@ # ~/.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*) ;; @@ -72,56 +71,6 @@ xterm*|rxvt*) ;; esac -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - # Ne znam kakvo e tova otdolu, no ne raboti ;\ - # test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - alias utorrent='utserver -settingspath /opt/utorrent-servealpha-v3_3/' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - alias pycharm='bash /usr/share/pycharm-community-2016.2.3/bin/pycharm.sh' - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' - alias android-studio='bash /usr/share/android-studio/bin/studio.sh' - alias hackbg-python='cd /home/viktor/Documents/Software_Development/python/HackBulgaria-Python/' - alias violent-python='cd /home/viktor/Documents/Software_Development/python/violent-python' - alias django='cd /home/viktor/Documents/Software_Development/python/HackBulgaria-Django/' - alias py='python3.6' - alias bye='systemctl suspend' - alias whatisopen='netstat -pnlt' - alias calc='gcalccmd' - alias pmr='python manage.py runserver' - alias nopmr="netstat -pnlt | grep -E -o -e '[0-9]+/python' | cut -d '/' -f 1 | xargs kill" - - # git aliases - alias gs='git status' - alias ga='git add .' - alias gc='git commit' - alias gp='git push origin master' - - # MSR registers is responsible for lag after suspend - alias checkcpu='modprobe msr; rdmsr -a 0x19a' - alias fixcpu='wrmsr -a 0x19a 0x0' - alias daimi="egrep --color -n -i -R $1 --exclude='*.pyc'" - alias muzika="xdg-open /home/viktor/Documents/Music/njoy.m3u" - alias randomstr="tr -dc a-z1-4 50' | tr 3-4 ' ' | sed 's/^ *//' | cat -s | sed 's/ / /g' |fmt" - alias battery="upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E 'time to empty|state|to\ full|percentage'" - alias svali_papka=download_github_folder - - function download_github_folder(){ - svn checkout $(echo $1 | sed "s/\/tree\/[a-zA-Z]\+/\/trunk/") - } - - -fi - - -# some more ls aliases -#alias ll='ls -l' -#alias la='ls -A' -#alias l='ls -CF' # Alias definitions. # You may want to put all your additions into a separate file like @@ -146,9 +95,23 @@ fi export NVM_DIR="/root/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm -alias omg="service NetworkManager restart" -VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.5 -export VIRTUALENVWRAPPER_PYTHON -export WORKON_HOME=$HOME/.virtualenvs -source /usr/local/bin/virtualenvwrapper.sh +#VIRTUALENV_PYTHON=/usr/bin/python3.5 +#VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.5 +#export VIRTUALENV_PYTHON +#export WORKON_HOME=$HOME/.virtualenvs +#source /usr/local/bin/virtualenvwrapper.sh + +# PYTHONPATH=/usr/local/bin/python3.6 +# export PYTHONPATH + +# Below is the activation for powerline sometime in the future + +#if [ "$TERM" != "linux" ]; then +# PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" +#fi +eval "$(jump shell)" +# file share across lan - woof +# lsb_release is not supported for python3, did some stuff there to fix ;/ +# livedown - npm module for live markdown +# desktop files location - ~/.local/share/applications/ diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..d8c85d0 --- /dev/null +++ b/.zshrc @@ -0,0 +1,93 @@ +VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3.5 +source /usr/local/bin/virtualenvwrapper.sh +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. + export ZSH=/root/.oh-my-zsh + +# Set name of the theme to load. Optionally, if you set this to "random" +# it'll load a random theme each time that oh-my-zsh is loaded. +# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes +ZSH_THEME="bira" + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. Case +# sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# ssh +# export SSH_KEY_PATH="~/.ssh/rsa_id" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" +eval "$(jump shell)" + +# Load aliases +. ~/.bash_aliases +export PS1="%{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%} $terminfo[bold]%2~ $(git_prompt_info)%{$reset_color%} +╰─%B#%b ";