Skip to content

Instantly share code, notes, and snippets.

@vpnwall-services
Last active April 23, 2018 18:15
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 vpnwall-services/535bcb6476266ff473ef8fa357a8d1d7 to your computer and use it in GitHub Desktop.
Save vpnwall-services/535bcb6476266ff473ef8fa357a8d1d7 to your computer and use it in GitHub Desktop.
[Zsh Auto Installer] Zsh automated installer #linux #zsh #installer
#!/bin/bash
apt-get update ; apt-get upgrade -y
apt-get install tmux zsh htop git -y
wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
chmod +x install.sh
sed -i 's/env zsh//g'
./install.sh
cat << EOF > /root/.oh-my-zsh/themes/robbyrussell.zsh-theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
PROMPT='$USER@%{$fg_bold[white]%}%M %{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
EOF
cat << EOF > /etc/tmux.conf
#------------------------------------------------------------------------------
# DEFAULT CONFIGURATION
#------------------------------------------------------------------------------
# default colors configuration (needed for vim)
set -g default-terminal "screen-256color"
# use your mouse to select pane
set -g mouse on
# not sure what these settings are for
set-option -g status-keys vi
set-window-option -g mode-keys vi
# windows starts at 1
set -g base-index 1
# display messages for a second
set -g display-time 1000
# prevent tmux to rename windows
set -g set-titles off
setw -g automatic-rename off
# Set window notifications
set-window-option -g monitor-activity on
set -g visual-activity on
#------------------------------------------------------------------------------
# SHORTCUT
#------------------------------------------------------------------------------
# changing default prefix to CTRL+x
#set -g prefix C-x
#unbind C-b
#bind C-x send-prefix
# reload .tmux.conf file
#bind r source ~/.tmux.conf
# ctrl+left/right cycles thru windows
bind-key -n C-right next
bind-key -n C-left prev
# alt+directions navigates through panes
bind-key -n M-left select-pane -L
bind-key -n M-right select-pane -R
bind-key -n M-up select-pane -U
bind-key -n M-down select-pane -D
# quit tmux
bind \ kill-server
# Copy pasta
bind P paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
bind-key -t vi-copy 'r' rectangle-toggle
#------------------------------------------------------------------------------
# COLOURS
#------------------------------------------------------------------------------
# color0 == black
# color15 == white
# color124 == red
# color240 == gray
# color250 == lightgray
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# PANE
#------------------------------------------------------------------------------
# not active pane separator
set -g pane-border-fg colour244
set -g pane-border-bg default
# active pane separator
set -g pane-active-border-fg colour124
set -g pane-active-border-bg default
#------------------------------------------------------------------------------
# STATUSBAR
#------------------------------------------------------------------------------
# default statusbar colors
set -g status-fg colour235
set -g status-bg colour250
set -g status-attr dim
# current or active window in status bar
set-window-option -g window-status-current-fg colour15
set-window-option -g window-status-current-bg colour0
set-window-option -g window-status-current-format ' #W '
# alerted window in status bar. Windows which have an alert (bell, activity or content).
#set-window-option -g window-status-alert-fg colour124
#set-window-option -g window-status-alert-bg colour15
# command/message line colors
set -g message-fg colour15
set -g message-bg colour124
set -g message-attr dim
# left side of status bar
set -g status-left-length 30
set -g status-left ' #S | #(hostname | cut -d. -f 1) '
# right side of status bar
set -g status-right-length 30
set -g status-right '%Y-%m-%d | %H:%M '
# status bar options
set-option -g status-justify centre # alignment of windows
set-window-option -g window-status-format ' #W ' # Inactive windows in status bar
EOF
#sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="af-magic"/g' /root/.zshrc
cat << EOF >> /root/.zshrc
export PATH="/root/armitage:/opt/metasploit-framework:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
alias ducks='du -cks * | sort -rn | head'
alias macgitpush="git add * ; git commit -m 'updated now' ; git push -u origin master"
alias agi="apt-get install -y --force-yes"
alias tmux='tmux -u'
alias nano='nano -F -c -i'
alias ntfy="ntfy -b pushbullet -o access_token $TOKEN send $1"
alias agi="apt-get install -y --force-yes"
alias macsaltjobs="salt-run jobs.active"
alias mackillsalt="salt '*' saltutil.kill_job $1"
EOF
echo "Oh My Zsh is installed and configured ... "
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment