From 73181f925ae9f3aab80e064eeecc19fb1dae7f27 Mon Sep 17 00:00:00 2001 From: computer Date: Tue, 7 Dec 2021 13:08:34 -0500 Subject: [PATCH] updating zsh configuration --- .../custom/plugins/zsh-autosuggestions | 1 + .../plugins/zsh-history-substring-search | 1 + .../custom/plugins/zsh-syntax-highlighting | 1 + hasql.nixc.us/user-data.sh | 15 +++++-- hasql.nixc.us/zsh-setup.sh | 41 +++++++++++++------ 5 files changed, 44 insertions(+), 15 deletions(-) create mode 160000 hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-autosuggestions create mode 160000 hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-history-substring-search create mode 160000 hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting diff --git a/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-autosuggestions b/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-autosuggestions new file mode 160000 index 0000000..a411ef3 --- /dev/null +++ b/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-autosuggestions @@ -0,0 +1 @@ +Subproject commit a411ef3e0992d4839f0732ebeb9823024afaaaa8 diff --git a/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-history-substring-search b/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-history-substring-search new file mode 160000 index 0000000..4abed97 --- /dev/null +++ b/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-history-substring-search @@ -0,0 +1 @@ +Subproject commit 4abed97b6e67eb5590b39bcd59080aa23192f25d diff --git a/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting b/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting new file mode 160000 index 0000000..c7caf57 --- /dev/null +++ b/hasql.nixc.us/echo/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting @@ -0,0 +1 @@ +Subproject commit c7caf57ca805abd54f11f756fda6395dd4187f8a diff --git a/hasql.nixc.us/user-data.sh b/hasql.nixc.us/user-data.sh index b89a7d3..022102b 100644 --- a/hasql.nixc.us/user-data.sh +++ b/hasql.nixc.us/user-data.sh @@ -25,10 +25,14 @@ echo 'master: nacl.nixc.us' > /etc/salt/minion.d/99-master-address.conf ## Installing Glusterfs-7 https://www.digitalocean.com/community/tutorials/how-to-create-a-redundant-storage-pool-using-glusterfs-on-ubuntu-20-04 echo |add-apt-repository ppa:gluster/glusterfs-7 +## Install Container Top ctop +echo "deb http://packages.azlux.fr/debian/ buster main" | sudo tee /etc/apt/sources.list.d/azlux.list +wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add - + ## Installing packages apt-get update apt-get dist-upgrade -y -apt-get install -y iftop htop glances zsh glusterfs-server glusterfs-client salt-minion +apt-get install -y asciinema iftop htop glances zsh glusterfs-server glusterfs-client salt-minion docker-ctop ## Install docker-compose and docker using convenience scripts curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose @@ -36,6 +40,11 @@ chmod +x /usr/local/bin/docker-compose curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh +## Install CTOP Container Top +wget https://github.com/bcicen/ctop/releases/download/0.7.6/ctop-0.7.6-linux-amd64 -O /usr/local/bin/ctop +chmod +x /usr/local/bin/ctop + ## Force install ohmyzsh on first login -curl -o /root/zsh-setup.sh https://digitalocean-user-data:sHEG3NTC6og8pCJDTF6EPYb8jLmbskx5Ns@git.nixc.us/Colin_/do-userdata/raw/branch/master/hasql.nixc.us/zsh-setup.sh -echo bash /root/zsh-setup.sh >> /root/.profile +curl -o /root/zsh-setup.sh https://digitalocean-user-data:sHEG3NTC6og8pCJDTF6EPYb8jLmbskx5Ns@git.nixc.us/Colin_/do-userdata/raw/branch/master/hasql.nixc.us/zsh-setup.sh && \ +echo bash /root/zsh-setup.sh >> /root/.profile && \ +source ~/.profile diff --git a/hasql.nixc.us/zsh-setup.sh b/hasql.nixc.us/zsh-setup.sh index f9f76b5..ceb1427 100644 --- a/hasql.nixc.us/zsh-setup.sh +++ b/hasql.nixc.us/zsh-setup.sh @@ -1,29 +1,46 @@ #!/usr/bin/env bash ## Setup ZSH and ohmyzsh theme -# cd /root/ +# cd ~/ +USRDIR=$(echo ~) sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended # echo y|sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" -sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="pygmalion"/' /root/.zshrc -echo 'export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address)' >> /root/.zshrc -echo 'export PUBLIC_IPV6=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv6/address)' >> /root/.zshrc -echo 'export SENTRY_DSN=https://d7eb76933ae046c9a4fd3d29572b1462:3aba191d95a648118e78cc5f81cbd92c@sentry.adventuresinnewmedia.com/43' >> /root/.zshrc +sed -i'' -e 's@ZSH_THEME="robbyrussell"@ZSH_THEME="pygmalion"@' $USRDIR/.zshrc +#echo 'export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address)' >> $USRDIR/.zshrc +#echo 'export PUBLIC_IPV6=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv6/address)' >> $USRDIR/.zshrc +#echo 'export SENTRY_DSN=https://d7eb76933ae046c9a4fd3d29572b1462:3aba191d95a648118e78cc5f81cbd92c@sentry.adventuresinnewmedia.com/43' >> $USRDIR/.zshrc ## Install Plugins ## Auto Suggestions - git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions + git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$USRDIR/.oh-my-zsh/custom}/plugins/zsh-autosuggestions ## Syntax Highlighting - git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$USRDIR/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ## History Substring search. - git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search + git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-$USRDIR/.oh-my-zsh/custom}/plugins/zsh-history-substring-search + ## ZSH Command Execution Time + git clone https://github.com/popstas/zsh-command-time.git ${ZSH_CUSTOM:-$USRDIR/.oh-my-zsh/custom/plugins/command-time + ## Configure plugins and envvars. + cat <> ~/.zshrc + # If command execution time above min. time, plugins will not output time. + ZSH_COMMAND_TIME_MIN_SECONDS=3 + + # Message to display (set to "" for disable). + ZSH_COMMAND_TIME_MSG="Execution time: %s" + + # Message color. + ZSH_COMMAND_TIME_COLOR="cyan" + + # Exclude some commands + ZSH_COMMAND_TIME_EXCLUDE=(vim mcedit nano) +EOF ## Enable plugins -sed -i 's\plugins=(git)\plugins=(git cp colored-man-pages docker docker-compose extract iterm2 python rsync safe-paste transfer ubuntu zsh-navigation-tools zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search)\' /root/.zshrc +sed -i'' -e 's@plugins=(git)@plugins=(git cp colored-man-pages docker docker-compose extract iterm2 python rsync safe-paste transfer ubuntu zsh-navigation-tools zsh-autosuggestions zsh-syntax-highlighting zsh-history-substring-search command-time)@' $USRDIR/.zshrc ## Cleanup -sed -i 's\bash /root/zsh-setup.sh\\' /root/.profile -rm -f /root/zsh-setup.sh +sed -i'' -e 's@bash $USRDIR/zsh-setup.sh@@' $USRDIR/.profile +rm -f $USRDIR/zsh-setup.sh echo "Relog into terminal finished bootstrapping server" chsh -s $(which zsh) zsh -source /root/.zshrc +source $USRDIR/.zshrc