Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function git_time_since_commit() {
- if git rev-parse --git-dir > /dev/null 2>&1; then
- # Only proceed if there is actually a commit.
- if git log -n 1 > /dev/null 2>&1; then
- # Get the last commit.
- last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
- now=`date +%s`
- seconds_since_last_commit=$((now-last_commit))
- # Totals
- MINUTES=$((seconds_since_last_commit / 60))
- HOURS=$((seconds_since_last_commit/3600))
- # Sub-hours and sub-minutes
- DAYS=$((seconds_since_last_commit / 86400))
- SUB_HOURS=$((HOURS % 24))
- SUB_MINUTES=$((MINUTES % 60))
- if [[ -n $(git status -s 2> /dev/null) ]]; then
- if [ "$MINUTES" -gt 30 ]; then
- COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG"
- elif [ "$MINUTES" -gt 10 ]; then
- COLOR="$ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM"
- else
- COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT"
- fi
- else
- COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
- fi
- if [ "$HOURS" -gt 24 ]; then
- echo "($COLOR${DAYS}d${SUB_HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
- elif [ "$MINUTES" -gt 60 ]; then
- echo "($COLOR${HOURS}h${SUB_MINUTES}m%{$reset_color%}|"
- else
- echo "($COLOR${MINUTES}m%{$reset_color%}|"
- fi
- else
- COLOR="$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL"
- echo "($COLOR~|"
- fi
- fi
- }
- function prompt_char() {
- git branch >/dev/null 2>/dev/null && echo "%{$fg[green]%}±%{$reset_color%}" && return
- hg root >/dev/null 2>/dev/null && echo "%{$fg_bold[red]%}☿%{$reset_color%}" && return
- echo "%{$fg[cyan]%}◯ %{$reset_color%}"
- }
- # Colors vary depending on time lapsed.
- ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
- ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
- ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
- ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
- # Determine the time since last commit. If branch is clean,
- # use a neutral color, otherwise colors will vary according to time.# /etc/zsh/zshrc: system-wide .zshrc file for zsh(1).
- #
- # This file is sourced only for interactive shells. It
- # should contain commands to set up aliases, functions,
- # options, key bindings, etc.
- #
- # Global Order: zshenv, zprofile, zshrc, zlogin
- READNULLCMD=${PAGER:-/usr/bin/pager}
- # An array to note missing features to ease diagnosis in case of problems.
- typeset -ga debian_missing_features
- if [[ -z "${DEBIAN_PREVENT_KEYBOARD_CHANGES-}" ]] &&
- [[ "$TERM" != 'emacs' ]]
- then
- typeset -A key
- key=(
- BackSpace "${terminfo[kbs]}"
- Home "${terminfo[khome]}"
- End "${terminfo[kend]}"
- Insert "${terminfo[kich1]}"
- Delete "${terminfo[kdch1]}"
- Up "${terminfo[kcuu1]}"
- Down "${terminfo[kcud1]}"
- Left "${terminfo[kcub1]}"
- Right "${terminfo[kcuf1]}"
- PageUp "${terminfo[kpp]}"
- PageDown "${terminfo[knp]}"
- )
- function bind2maps () {
- local i sequence widget
- local -a maps
- while [[ "$1" != "--" ]]; do
- maps+=( "$1" )
- shift
- done
- shift
- sequence="${key[$1]}"
- widget="$2"
- [[ -z "$sequence" ]] && return 1
- for i in "${maps[@]}"; do
- bindkey -M "$i" "$sequence" "$widget"
- done
- }
- bind2maps emacs -- BackSpace backward-delete-char
- bind2maps viins -- BackSpace vi-backward-delete-char
- bind2maps vicmd -- BackSpace vi-backward-char
- bind2maps emacs -- Home beginning-of-line
- bind2maps viins vicmd -- Home vi-beginning-of-line
- bind2maps emacs -- End end-of-line
- bind2maps viins vicmd -- End vi-end-of-line
- bind2maps emacs viins -- Insert overwrite-mode
- bind2maps vicmd -- Insert vi-insert
- bind2maps emacs -- Delete delete-char
- bind2maps viins vicmd -- Delete vi-delete-char
- bind2maps emacs viins vicmd -- Up up-line-or-history
- bind2maps emacs viins vicmd -- Down down-line-or-history
- bind2maps emacs -- Left backward-char
- bind2maps viins vicmd -- Left vi-backward-char
- bind2maps emacs -- Right forward-char
- bind2maps viins vicmd -- Right vi-forward-char
- # Make sure the terminal is in application mode, when zle is
- # active. Only then are the values from $terminfo valid.
- if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
- function zle-line-init () {
- emulate -L zsh
- printf '%s' ${terminfo[smkx]}
- }
- function zle-line-finish () {
- emulate -L zsh
- printf '%s' ${terminfo[rmkx]}
- }
- zle -N zle-line-init
- zle -N zle-line-finish
- else
- for i in {s,r}mkx; do
- (( ${+terminfo[$i]} )) || debian_missing_features+=($i)
- done
- unset i
- fi
- unfunction bind2maps
- fi # [[ -z "$DEBIAN_PREVENT_KEYBOARD_CHANGES" ]] && [[ "$TERM" != 'emacs' ]]
- zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \
- /usr/local/bin \
- /usr/sbin \
- /usr/bin \
- /sbin \
- /bin \
- /usr/X11R6/bin
- (( ${+aliases[run-help]} )) && unalias run-help
- autoload -Uz run-help
- # If you don't want compinit called here, place the line
- # skip_global_compinit=1
- # in your $ZDOTDIR/.zshenv or $ZDOTDIR/.zprofile
- if [[ -z "$skip_global_compinit" ]]; then
- autoload -U compinit
- compinit
- fi
- # Set up the prompt
- autoload -Uz promptinit
- promptinit
- prompt agnoster
- setopt histignorealldups sharehistory
- # Use emacs keybindings even if our EDITOR is set to vi
- bindkey -e
- # Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
- HISTSIZE=1000
- SAVEHIST=1000
- HISTFILE=~/.zsh_history
- # Use modern completion system
- autoload -Uz compinit
- compinit
- zstyle ':completion:*' auto-description 'specify: %d'
- zstyle ':completion:*' completer _expand _complete _correct _approximate
- zstyle ':completion:*' format 'Completing %d'
- zstyle ':completion:*' group-name ''
- zstyle ':completion:*' menu select=2
- eval "$(dircolors -b)"
- zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
- zstyle ':completion:*' list-colors ''
- zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
- zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
- zstyle ':completion:*' menu select=long
- zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
- zstyle ':completion:*' use-compctl false
- zstyle ':completion:*' verbose true
- zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
- zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
- #----------------------------
- # EXPORTED ITEMS AND ALIASES #
- #----------------------------
- # export GOPATH=$HOME/go
- # Normal color names
- CYAN="$(printf '\033[0;36m')"
- BLUE="$(printf '\033[0;34m')"
- BROWN="$(printf '\033[0;33m')"
- DARKGRAY="$(printf '\033[0;30m')"
- GRAY="$(printf '\033[0;37m')"
- GREEN="$(printf '\033[1;32m')"
- LIGHTBLUE="$(printf '\033[0;94m')"
- MAGENTA="$(printf '\033[1;35m')"
- PURPLE="$(printf '\033[0;35m')"
- RED="$(printf '\033[1;31m')"
- YELLOW="$(printf '\033[1;33m')"
- WHITE="$(printf '\033[1;37m')"
- # Markup
- BOLD="${WHITE}"
- # With background
- BG_BLUE="$(printf '\033[0;44m')"
- # Semantic names
- HEADER="${WHITE}"
- NORMAL="$(printf '\033[0m')"
- WARNING="${RED}"
- SECTION="${YELLOW}"
- NOTICE="${YELLOW}"
- OK="${GREEN}"
- BAD="${RED}"
- white='\033[0m'
- red='\033[31m'
- green='\033[32m'
- orange='\033[33m'
- blue='\033[34m'
- blink='\e[5m'
- purple='\033[35m'
- cyan='\033[36m'
- gray='\033[37m'
- # If you come from bash you might have to change your $PATH.
- PATH=$HOME/bin:/usr/local/bin:$PATH:/imp/bin/src:/imp/Tether/node/deps/uv/src/ares/c-ares:$HOME/Cl0neMast3r:/imp/.local/bin:/imp/UMS-7.4.0/ums-7.4.0
- # Path to your oh-my-zsh installation.
- ZSH="/imp/.oh-my-zsh"
- SAVE_FILE="$HOME/tracked-scripts"
- # 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="agnoster"
- # Set list of themes to load
- # Setting this variable when ZSH_THEME=random
- # cause zsh load theme from this variable instead of
- # looking in ~/.oh-my-zsh/themes/
- # An empty array have no effect
- # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
- # 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.
- # You can set one of the optional three formats:
- # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
- # or set a custom format using the strftime function format specifications,
- # see 'man strftime' for details.
- # 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=(
- adb
- coffee
- catimg
- history
- copyfile
- ant
- debian
- httpie
- sudo
- oc
- nanorc
- git
- )
- source $ZSH/oh-my-zsh.sh
- setopt auto_cd
- setopt multios
- setopt prompt_subst
- alias colors='cat $HOME/colors'
- alias itso=source
- alias 'sss=service --status-all'
- alias 'rm=rm -rf'
- alias 'HD=$HOME/Desktop'
- alias 'cpp=clippaste'
- alias 'cpc=clipcopy'
- alias 'hts=history'
- alias ''
- alias 'its.mkpw=apg'
- alias 'its.mkpw=apg /imperial/bin/its.mkpw'
- alias '..=cd ..; clear; ls'
- alias 'nautsc=~/.local/share/nautilus/scripts'
- alias 'ifc=ifconfig'
- alias 'clipc=clipcopy'
- alias 'clipp=clippaste'
- alias 'itmed=/media/$(echo `whoami`)'
- alias 'wget=wget2 -c --force-progress $*'
- alias 'cp=cp -gR -r -u -v'
- alias 'pv=pv -tpeba $*'
- alias 'music=USER='/media/"$(echo $LOGNAME)"/MY_MUSIC'; ls $USER'
- alias 'song=USER='/media/"$(echo $LOGNAME)"/MY_MUSIC/'; read song < <( zenity --title "ITS Music" --width=560 --text "Play Songs" --forms --add-entry "SONG:" ); mpv $USER/$song '
- alias 'mv=mv -ng'
- alias 'gxm=gxmessage -title "ITS_ imperialerial TeK. Solutions" -center -geometry 500x500'
- alias itsearch='cd /; sudo find . -print | grep -FzZ "$*" | grep "$*"'
- alias 'apts=apt search $*'
- alias 'TORB=/imp/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US'
- alias 'dr3=cat /imperial/.local/share/torbrowser/tor-browser-linux64-8.0.1_en-US/tor-browser_en-US/.dr3'
- alias '7zl=7z l $*'
- alias 'sit=sizeit $*'
- alias 'media.space=df -ah /media/imperial/** /'
- alias 'fsp=media.space'
- alias 'kl=keep list'
- alias 'kn=keep new'
- alias 'jj=java -jar $*'
- alias 'ddl=drivedl $*'
- alias 'mp4v=mv *.mp4 $*'
- wine_exes=/media/$(echo `whoami`)/SD_CARD/wine-executalbes
- alias 'ses=service stop $*'
- alias 'se=service $*'
- alias 'sdcmv=mv -gt /media/imperial/SD_CARD/ $*'
- alias 'a=alias'
- MUSIC=/media/$(echo `whoami`)/MY_MUSIC
- MERKURY=/media/imperial/MERKURY
- home=/imperial
- alias 'findexes=find . -type -f -executable'
- alias 'findexes=find . -type f -executable'
- alias 'sadbp=sudo adb push $*'
- alias 'sadbs=sudo adb shell'
- alias 'sadbp=sudo adb pull $*'
- alias 'sadb=sudo adb $*'
- alias 'ff=firefox $*'
- alias 'findmp4=sudo find / -iname "*.mp4"'
- alias 'itx=its.chx $*'
- DLS=/imperial/Downloads
- httpservdir=/usr/local/lib/node_modules/http-server
- alias 'rmdu=sudo fdupes -rsnASdNI'
- alias 'ac=cat $*'
- ISOS=/media/imperial/MY_BACKUPS/isos
- BACKUPS=/media/imperial/60GB
- xvid=/media/imperial/MEDIA/xvids
- alias 'la=ls -a'
- alias 'sadbpu=sudo adb push $*'
- alias 'sse=sudo service $*'
- alias 'sdpki=sudo dpkg -i $*'
- alias 'spt=sudo apt $*'
- APT=/etc/apt
- alias 'mp3v=mv *.mp3 $*'
- alias 'itpc=pcmanfm $*'
- nginx_dir=/etc/nginx
- alias 'ffp=ffplay $*'
- alias 'snan=sudo nano $*'
- alias 'srm=sudo rm $*'
- alias 'psx=ps -aux'
- alias 'mpl=mplayer $*'
- itslogo
- ISOS=/media/imperial/BACKUPS/isos
- ISOS=/media/imperial/MY_BACKUPS/isos
- ARMITAGE=/usr/share/armitage
- alias 'snin=sudo nano $*'
- XVIDS=/media/imperial/MEDIA/x
- alias 'wp=whitep'
- alias 'serve=gatling -p $*'
- alias 'itx=dtrx $*'
- alias 'chrom=chromium-browser $*'
- alias 'ebi=echobatch'
- alias 'itsys=systemctl $*'
- alias 'ccat=lolcat $*'
- alias 'pad=/usr/bin/featherpad $*'
- alias 'gitc=git clone $*'
- alias 'py3=python3 $*'
- alias 'rsync=rsync -zEavPh $*'
- itbackup1 () {
- USER="$(echo `whoami`)"
- DEST=/media/$USER/60GB
- SOURCE=$*
- rsync -zEavPh $SOURCE $DEST
- df $BACKUPS
- }
- alias 'itbackup=itbackup1'
- alias 'pngmv=mv *.png ~/Pictures'
- alias 'jpegmv=mv *.jpeg ~/Pictures'
- alias 'elfread=eu-readelf $*'
- alias 'elfread=eu-readelf -a $*'
- alias 'itadvertise=clear;sign "
- v1ral_its@netc.it
- https://pastebin.com/u/v1ral_ITS
- 919-916-6406
- "'
- #alias 'alias Z=/usr/lib/dosemu/drive_z'
- #alias 'alias Z=/usr/lib/dosemu/drive_z'
- #alias 'alias Z=/usr/lib/dosemu/drive_z'
- #alias Z=cd /usr/lib/dosemu/drive_z
- alias 'Z=/usr/lib/dosemu/drive_z'
- alias 'it-server=/usr/local/lib/node_modules/http-server/bin/http-server $*'
- alias 'ITBB=/media/imperial/MY_BACKUPS/BACKUPS'
- alias 'gmpv=gnome-mpv $*'
- itbackup3 () {
- echo -e "Destination Folder:"
- read DEST
- echo -e "Source Folder:"
- read SOURCE
- rsync -zEavPh $SOURCE $DEST
- df $BACKUPS/BACKUPS
- }
- alias 'itbackup2=itbackup3'
- popular1 () {
- fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
- }
- alias 'popular=popular1'
- star_craft=/media/imperial/MY_BACKUPS/starcraft.plasma-lookandfeel/org.kde.starcraft
- alias 'sstar=. $star_craft/*/**'
- alias 'mpv=mpv --shuffle $*'
- alias 'purge=RMAPT=$* ; sudo apt-get remove $RMAPT --purge'
- alias 'photorec_dir=/media/imperial/MY_BACKUPS/v1ral@ITS/home/v1ral/'
- alias ITGB='/media/imperial/60GB'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement