Commit af25b226e9340b52563f8bf55a53812916438250

Authored by mj
1 parent c971203eb9
Exists in master and in 2 other branches 02-merge, dev

FIX install & zshrc

Showing 3 changed files with 16 additions and 9 deletions Inline Diff

1 #@IgnoreInspection AddShebang 1 #@IgnoreInspection AddShebang
2 # ENVIRONMENT: 2 # ENVIRONMENT:
3 export GJ_DEVENV=local_aptproxy 3 export GJ_DEVENV=local_aptproxy
4 4
5 export ZCFG=~/.config/zsh-config 5 export ZCFG=~/.config/zsh-config
6 # Path to your oh-my-zsh installation. 6 # Path to your oh-my-zsh installation.
7 export ZSH=$ZCFG/tools/oh-my-zsh 7 export ZSH=$ZCFG/packages/oh-my-zsh
8 8
9 export LANG=en_US.UTF-8 9 export LANG=en_US.UTF-8
10 10
11 # Compilation flags 11 # Compilation flags
12 export ARCHFLAGS="-arch x86_64" 12 export ARCHFLAGS="-arch x86_64"
13 13
14 # Themes are in (...)/oh-my-zsh/themes/ or "random" 14 # Themes are in (...)/oh-my-zsh/themes/ or "random"
15 ZSH_THEME="muse" 15 ZSH_THEME="muse"
16 16
17 CASE_SENSITIVE="true" 17 CASE_SENSITIVE="true"
18 DISABLE_AUTO_UPDATE="true" 18 DISABLE_AUTO_UPDATE="true"
19 DISABLE_AUTO_TITLE="true" 19 DISABLE_AUTO_TITLE="true"
20 ENABLE_CORRECTION="true" 20 ENABLE_CORRECTION="true"
21 COMPLETION_WAITING_DOTS="true" 21 COMPLETION_WAITING_DOTS="true"
22 DISABLE_UNTRACKED_FILES_DIRTY="true" 22 DISABLE_UNTRACKED_FILES_DIRTY="true"
23 HIST_STAMPS="dd.mm.yyyy" 23 HIST_STAMPS="dd.mm.yyyy"
24 ZSH_CUSTOM=ZCFG/custom 24 ZSH_CUSTOM=ZCFG/custom
25 25
26 plugins=(command-not-found common-aliases debian dirhistory git history history-substring-search systemadmin zsh_reload 26 plugins=(command-not-found common-aliases debian dirhistory git history history-substring-search systemadmin zsh_reload
27 pip python virtualenv virtualenvwrapper 27 pip python virtualenv virtualenvwrapper
28 meteor node npm 28 meteor node npm
29 ) 29 )
30 30
31 if [ -f ~/.config/zsh-config/templates/bash_aliases ]; then 31 if [ -f ~/.config/zsh-config/templates/bash_aliases ]; then
32 . ~/.config/zsh-config/templates/bash_aliases 32 . ~/.config/zsh-config/templates/bash_aliases
33 fi 33 fi
34 34
35 # User configuration 35 # User configuration
36 export PATH=$HOME/bin:/usr/local/bin:$PATH 36 export PATH=$HOME/bin:/usr/local/bin:$PATH
37 # export MANPATH="/usr/local/man:$MANPATH" 37 # export MANPATH="/usr/local/man:$MANPATH"
38 38
39 source $ZSH/oh-my-zsh.sh 39 source $ZSH/oh-my-zsh.sh
40 40
41 # ANTIGEN: 41 # ANTIGEN:
42 # 42 #
43 # source $ZCFG/tools/antigen/antigen.zsh 43 # source $ZCFG/packages/antigen/antigen.zsh
44 # 44 #
45 # MUST: 45 # MUST:
46 #antigen bundle extract 46 #antigen bundle extract
47 # 47 #
48 # 48 #
49 # NICE: 49 # NICE:
50 #antigen bundle iwhois 50 #antigen bundle iwhois
51 #antigen bundle screen 51 #antigen bundle screen
52 #antigen bundle ssh-agent 52 #antigen bundle ssh-agent
53 #antigen bundle web-search 53 #antigen bundle web-search
54 # # if webdev: 54 # # if webdev:
55 #antigen bundle catimg 55 #antigen bundle catimg
56 # 56 #
57 # docker: 57 # docker:
58 #antigen bundle docker 58 #antigen bundle docker
59 # 59 #
60 # kde: 60 # kde:
61 #antigen bundle kate 61 #antigen bundle kate
62 # 62 #
63 # removed: 63 # removed:
64 #antigen bundle autoenv 64 #antigen bundle autoenv
65 #antigen bundle iwhois 65 #antigen bundle iwhois
66 #antigen bundle per-directory-history 66 #antigen bundle per-directory-history
67 #antigen bundle screen 67 #antigen bundle screen
68 # 68 #
69 # THEME #---------- 69 # THEME #----------
70 # 70 #
71 #antigen theme muse 71 #antigen theme muse
72 # 72 #
73 #antigen apply 73 #antigen apply
74 74
75 # ssh 75 # ssh
76 # export SSH_KEY_PATH="~/.ssh/id_rsa" 76 # export SSH_KEY_PATH="~/.ssh/id_rsa"
77 # zstyle :omz:plugins:ssh-agent agent-forwarding on 77 # zstyle :omz:plugins:ssh-agent agent-forwarding on
78 78
79 # Preferred editor for local and remote sessions 79 # Preferred editor for local and remote sessions
80 # if [[ -n $SSH_CONNECTION ]]; then 80 # if [[ -n $SSH_CONNECTION ]]; then
81 # export EDITOR='vim' 81 # export EDITOR='vim'
82 # else 82 # else
83 # export EDITOR='mvim' 83 # export EDITOR='mvim'
84 # fi 84 # fi
1 #@IgnoreInspection AddShebang 1 #@IgnoreInspection AddShebang
2 # ** Initiate with: ** 2 #
3 # cd && wget http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh -O -| sh 3 # ** Initiate with: **
4 # ----------------------------------------------------------------------------------- 4 # cd && curl -L http://git.str8.biz/mj/zsh-config/raw/master/tools/install.sh | sh
5 #
6 # ---------------------------------------------------------------------------------------------
7 #
8 # gj@ubuntu4docker:~$ touch install.sh
9 # gj@ubuntu4docker:~$ rm install.sh && nano install.sh && chmod +x install.sh && ./install.sh
10 #
11 ################################################################################################
5 12
6 set -e 13 set -e
7 14
8 if [ "$SHELL" != "$(which zsh)" ]; then 15 if [ "$SHELL" != "$(which zsh)" ]; then
9 echo "$(which zsh)" 16 echo "$(which zsh)"
10 sudo echo "enter pass...." 17 sudo echo "enter pass...."
11 18
12 echo "ok" 19 echo "ok"
13 20
14 sudo apt-get -yq install curl dialog nano zsh 21 sudo apt-get -yq install curl dialog git nano zsh
15 #sudo apt-get -yq python-setuptools 22 #sudo apt-get -yq python-setuptools
16 23
17 #sudo easy_install pip 24 #sudo easy_install pip
18 #sudo pip install virtualenvwrapper 25 #sudo pip install virtualenvwrapper
19 fi 26 fi
20 27
21 if [ false ]; then 28 if [ 1 == 2 ]; then
22 mkvirtualenv cb-meteor 29 mkvirtualenv cb-meteor
23 pip install nodeenv 30 pip install nodeenv
24 nodeenv -p 31 nodeenv -p
25 # curl https://install.meteor.com/ | sh 32 # curl https://install.meteor.com/ | sh
26 fi 33 fi
27 34
28 if [ ! -n "$ZCNF" ]; then 35 if [ ! -n "$ZCNF" ]; then
29 ZCNF=~/.config/zsh-config 36 ZCNF=~/.config/zsh-config
30 fi 37 fi
31 38
32 if [ ! -n "$ZSH" ]; then 39 if [ ! -n "$ZSH" ]; then
33 ZSH=$ZCNF/tools/oh-my-zsh 40 ZSH=$ZCNF/packages/oh-my-zsh
34 fi 41 fi
35 42
36 echo "\033[0;34mCleaning...\033[0m" 43 echo "\033[0;34mCleaning...\033[0m"
37 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then 44 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then
38 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then 45 if [ -d ~/.config/zsh-config ] || [ -h ~/.config/zsh-config ]; then
39 rm -rf ~/.config/zsh-config 46 rm -rf ~/.config/zsh-config
40 fi 47 fi
41 # if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then 48 # if [ -d ~/.config/oh-my-zsh ] || [ -h ~/.config/oh-my-zsh ]; then
42 # rm -rf ~/.config/oh-my-zsh 49 # rm -rf ~/.config/oh-my-zsh
43 # fi 50 # fi
44 if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then 51 if [ -d ~/.config/antigen ] || [ -h ~/.config/antigen ]; then
45 rm -rf ~/.config/antigen 52 rm -rf ~/.config/antigen
46 fi 53 fi
47 fi 54 fi
48 55
49 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then 56 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
50 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf 57 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf
51 fi 58 fi
52 # 59 #
53 # BASH: 60 # BASH:
54 # 61 #
55 if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then 62 if [ -f ~/.bashrc ] || [ -h ~/.bashrc ]; then
56 mv ~/.bashrc ~/.bashrc.pre-zsh-cnf 63 mv ~/.bashrc ~/.bashrc.pre-zsh-cnf
57 fi 64 fi
58 if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then 65 if [ -f ~/.bash_aliases ] || [ -h ~/.bash_aliases ]; then
59 rm ~/.bash_aliases 66 rm ~/.bash_aliases
60 fi 67 fi
61 68
62 echo "\033[0;34mCloning Zsh Config...\033[0m" 69 echo "\033[0;34mCloning Zsh Config...\033[0m"
63 hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || { 70 hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF || {
64 echo "can't clone repo.." 71 echo "can't clone repo.."
65 exit 1 72 exit 1
66 } 73 }
67 74
68 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" 75 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m"
69 ln -s $ZCNF/templates/zshrc.sh ~/.zshrc 76 ln -s $ZCNF/templates/zshrc.sh ~/.zshrc
70 ln -s $ZCNF/templates/bashrc.sh ~/.bashrc 77 ln -s $ZCNF/templates/bashrc.sh ~/.bashrc
71 ln -s $ZCNF/templates/bash_aliases.sh ~/.bash_aliases 78 ln -s $ZCNF/templates/bash_aliases.sh ~/.bash_aliases
72 sed -i -e "/^export ZSH=/ c\\ 79 sed -i -e "/^export ZSH=/ c\\
73 export ZSH=$ZSH 80 export ZSH=$ZSH
74 " ~/.zshrc 81 " ~/.zshrc
75 82
76 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" 83 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
77 sed -i -e "/export PATH=/ c\\ 84 sed -i -e "/export PATH=/ c\\
78 export PATH=\"$PATH\" 85 export PATH=\"$PATH\"
79 " ~/.zshrc 86 " ~/.zshrc
80 87
81 if [ "$SHELL" != "$(which zsh)" ]; then 88 if [ "$SHELL" != "$(which zsh)" ]; then
82 echo "\033[0;34mTime to change your default shell to zsh!\033[0m" 89 echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
83 echo "chsh -s $(which zsh)" 90 echo "chsh -s $(which zsh)"
84 fi 91 fi
85 92
86 echo "\033[0;32m"' __ __ '"\033[0m" 93 echo "\033[0;32m"' __ __ '"\033[0m"
87 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" 94 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
88 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" 95 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
89 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" 96 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
90 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" 97 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
91 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" 98 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m"
92 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" 99 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m"
93 echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" 100 echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m"
94 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" 101 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m"
95 #env zsh 102 #env zsh
96 #. ~/.zshrc 103 #. ~/.zshrc
97 104
tools/sys_base_install.sh
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
3 # ** Initiate with: ** 3 # ** Initiate with: **
4 # cd && wget http://git.str8.biz/mj/zsh-config/raw/master/tools/sys_base_install.sh -O | sh 4 # cd && wget http://git.str8.biz/mj/zsh-config/raw/master/tools/sys_base_install.sh -O | sh
5 # ------------------------------------------------------------------------------------------- 5 # -------------------------------------------------------------------------------------------
6 6
7 set -e 7 set -e
8 8
9 export GJ_DEVENV="local_aptproxy" 9 export GJ_DEVENV="local_aptproxy"
10 export GJ_SHELL="bash" 10 export GJ_SHELL="bash"
11 11
12 # ** Helper Functions ** 12 # ** Helper Functions **
13 # ---------------------- 13 # ----------------------
14 14
15 function set_apt_proxy { 15 function set_apt_proxy {
16 if [[ "$GJ_DEVENV" == "local_aptproxy" ]]; then 16 if [[ "$GJ_DEVENV" == "local_aptproxy" ]]; then
17 echo "Setting apt-proxy: srvths" 17 echo "Setting apt-proxy: srvths"
18 printf 'Acquire::http { Proxy "http://192.168.188.110:3142"; };\nAcquire::https { Proxy "https://"; };\n' > /etc/apt/apt.conf.d/02proxy 18 printf 'Acquire::http { Proxy "http://192.168.188.110:3142"; };\nAcquire::https { Proxy "https://"; };\n' > /etc/apt/apt.conf.d/02proxy
19 elif [[ "$GJ_DEVENV" == "hetzner_server" ]]; then 19 elif [[ "$GJ_DEVENV" == "hetzner_server" ]]; then
20 echo "Setting apt-mirror: hetzner mirror" 20 echo "Setting apt-mirror: hetzner mirror"
21 echo 'deb ftp://mirror.hetzner.de/debian/packages wheezy main contrib non-free' > /etc/apt/sources.list.d/hetzner.list 21 echo 'deb ftp://mirror.hetzner.de/debian/packages wheezy main contrib non-free' > /etc/apt/sources.list.d/hetzner.list
22 echo 'deb ftp://mirror.hetzner.de/debian/security wheezy/updates main contrib non-free' >> /etc/apt/sources.list.d/hetzner.list 22 echo 'deb ftp://mirror.hetzner.de/debian/security wheezy/updates main contrib non-free' >> /etc/apt/sources.list.d/hetzner.list
23 fi 23 fi
24 } 24 }
25 25
26 function get_shell_config { 26 function get_shell_config {
27 apt-get -yq install apt-utils curl git nano zsh 27 apt-get -yq install apt-utils curl git nano zsh
28 mkdir ~/.config 28 mkdir ~/.config
29 echo "cloning zsh config.." 29 echo "cloning zsh config.."
30 hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF 30 hash git >/dev/null 2>&1 && env git clone --depth=1 http://git.str8.biz/mj/zsh-config.git $ZCNF
31 } 31 }
32 32
33 set_apt_proxy 33 set_apt_proxy
34 34
35 set -e 35 set -e
36 36
37 if [ ! -n "$ZCNF" ]; then 37 if [ ! -n "$ZCNF" ]; then
38 ZCNF=~/.config/zsh-config 38 ZCNF=~/.config/zsh-config
39 fi 39 fi
40 40
41 if [ ! -n "$ZSH" ]; then 41 if [ ! -n "$ZSH" ]; then
42 ZSH=$ZCNF/tools/oh-my-zsh 42 ZSH=$ZCNF/packages/oh-my-zsh
43 fi 43 fi
44 44
45 #export DEBIAN_FRONTEND=noninteractive 45 #export DEBIAN_FRONTEND=noninteractive
46 46
47 apt-get update 47 apt-get update
48 48
49 if [ "$GJ_SHELL" != "zsh" ]; then 49 if [ "$GJ_SHELL" != "zsh" ]; then
50 get_shell_config 50 get_shell_config
51 fi 51 fi
52 52
53 apt-get -yq upgrade && apt-get -yq dist-upgrade 53 apt-get -yq upgrade && apt-get -yq dist-upgrade
54 apt-get -yq install locales-all localepurge makepasswd python-setuptools 54 apt-get -yq install locales-all localepurge makepasswd python-setuptools
55 apt-get -yq autoremove && apt-get -yq clean 55 apt-get -yq autoremove && apt-get -yq clean
56 56
57 dpkg-reconfigure localepurge 57 dpkg-reconfigure localepurge
58 dpkg-reconfigure tzdata 58 dpkg-reconfigure tzdata
59 59
60 easy_install pip 60 easy_install pip
61 pip install autoenv 61 pip install autoenv
62 mkdir .autoenv && ln -s /usr/local/bin/activate.sh .autoenv/activate.sh 62 mkdir .autoenv && ln -s /usr/local/bin/activate.sh .autoenv/activate.sh
63 63
64 echo "\033[0;34mLooking for an existing zsh config...\033[0m" 64 echo "\033[0;34mLooking for an existing zsh config...\033[0m"
65 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then 65 if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
66 echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-zsh-cnf\033[0m"; 66 echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-zsh-cnf\033[0m";
67 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf; 67 mv ~/.zshrc ~/.zshrc.pre-zsh-cnf;
68 fi 68 fi
69 69
70 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m" 70 echo "\033[0;34mUsing the Zsh Config template file and adding it to ~/.zshrc\033[0m"
71 ln -s $ZCNF/templates/zshrc ~/.zshrc 71 ln -s $ZCNF/templates/zshrc ~/.zshrc
72 ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases 72 ln -s $ZCNF/templates/bash_aliases ~/.bash_aliases
73 sed -i -e "/^export ZSH=/ c\\ 73 sed -i -e "/^export ZSH=/ c\\
74 export ZSH=$ZSH 74 export ZSH=$ZSH
75 " ~/.zshrc 75 " ~/.zshrc
76 76
77 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" 77 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
78 sed -i -e "/export PATH=/ c\\ 78 sed -i -e "/export PATH=/ c\\
79 export PATH=\"$PATH\" 79 export PATH=\"$PATH\"
80 " ~/.zshrc 80 " ~/.zshrc
81 81
82 if [ "$SHELL" != "$(which zsh)" ]; then 82 if [ "$SHELL" != "$(which zsh)" ]; then
83 echo "\033[0;34mTime to change your default shell to zsh!\033[0m" 83 echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
84 chsh -s `which zsh` 84 chsh -s `which zsh`
85 fi 85 fi
86 86
87 echo "\033[0;32m"' __ __ '"\033[0m" 87 echo "\033[0;32m"' __ __ '"\033[0m"
88 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" 88 echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
89 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" 89 echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
90 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" 90 echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
91 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" 91 echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
92 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m" 92 echo "\033[0;32m"' /____/ ....is now installed!'"\033[0m"
93 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m" 93 echo "\n\n \033[0;32mPlease look over the ~/.zshrc file to select plugins, themes, and options.\033[0m"
94 echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m" 94 echo "\n\n \033[0;32mp.s. Follow us at http://twitter.com/ohmyzsh.\033[0m"
95 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m" 95 echo "\n\n \033[0;32mp.p.s. Get stickers and t-shirts at http://shop.planetargon.com.\033[0m"
96 env zsh 96 env zsh
97 . ~/.zshrc 97 . ~/.zshrc
98 98