From f280cc02c41bd3948424333780a2fe06ffd5cbe3 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 31 Aug 2017 21:54:13 +0200 Subject: [PATCH] Add Vim for better development experience. --- 01-basic.sh | 9 +++------ 99-cleanup.sh | 14 +++++++------- basic/root/.vimrc.txt | 2 ++ 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 basic/root/.vimrc.txt diff --git a/01-basic.sh b/01-basic.sh index f750caf..58fd3c0 100644 --- a/01-basic.sh +++ b/01-basic.sh @@ -7,7 +7,7 @@ apt-get -y purge bsdmainutils dictionaries-common emacsen-common iamerican ibrit # Install useful packages apt-get -y update -apt-get -y --no-install-recommends install bash-completion ca-certificates git ntp openssl sudo unzip +apt-get -y --no-install-recommends install bash-completion ca-certificates git ntp openssl sudo unzip vim ###### @@ -19,6 +19,7 @@ apt-get -y --no-install-recommends install openssh-server # Copy profile files cp ${SOURCE_DIR}/basic/root/.bashrc /root/.bashrc +cp ${SOURCE_DIR}/basic/root/.vimrc /root/.vimrc cp ${SOURCE_DIR}/basic/root/.ssh/authorized_keys /root/.ssh/authorized_keys # Remove default user @@ -58,7 +59,7 @@ update-grub ##### # Install packages -apt-get --no-install-recommends install lxc debootstrap rsync dnsmasq-base xz-utils +apt-get -y --no-install-recommends install lxc debootstrap rsync dnsmasq-base xz-utils # Configure LXC cp ${SOURCE_DIR}/basic/etc/default/lxc-net /etc/default/lxc-net @@ -79,10 +80,6 @@ apt-get -y --no-install-recommends install nginx-light uwsgi uwsgi-plugin-python openssl req -x509 -new -out /etc/ssl/certs/services.pem -keyout /etc/ssl/private/services.key -nodes -days 3654 -subj "/C=CZ/CN=$(hostname -f)" chmod 640 /etc/ssl/private/services.key -# Create Diffie-Hellman param -openssl dhparam -out /etc/ssl/dhparam.pem 2048 -chmod 640 /etc/ssl/dhparam.pem - # Modify default nginx site mkdir /etc/nginx/apps-available /etc/nginx/apps-enabled mkdir /srv/portal diff --git a/99-cleanup.sh b/99-cleanup.sh index 413cf7c..0799b0b 100644 --- a/99-cleanup.sh +++ b/99-cleanup.sh @@ -1,14 +1,14 @@ #!/bin/bash -# Remove git metadata -find / -name '.git*' -exec rm -rf {} \; - -# Remove SSH settings -rm -rf /root/.ssh/ - # Remove packages not necessary for release -apt-get -y purge git openssh-server +apt-get -y purge git openssh-server vim apt-get -y --purge autoremove # Clean package cache apt-get -y clean + +# Remove user settings +rm -rf /root/* /root/.* + +# Remove git metadata +find / -name '.git*' -exec rm -rf {} \; diff --git a/basic/root/.vimrc.txt b/basic/root/.vimrc.txt new file mode 100644 index 0000000..15b0c7d --- /dev/null +++ b/basic/root/.vimrc.txt @@ -0,0 +1,2 @@ +runtime! defaults.vim +set mouse-=a