From 3a0c1747692ae1e7e9f904a624a4bda29873de87 Mon Sep 17 00:00:00 2001 From: sneak Date: Sat, 11 Apr 2020 16:11:49 -0700 Subject: [PATCH] fix some bugs --- Makefile | 8 +++++++- build/packages.txt | 11 +++++++++++ build/run.sh | 6 ++++++ build/user.sh | 32 ++++++++++++++++++++++---------- root/home/user/.vimrc | 4 ++-- root/home/user/.zshrc | 2 +- 6 files changed, 49 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 7df6b70..e408d6d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ .PHONY: build + build: - sudo docker build . 2>&1 | tee -a build.log + docker build . 2>&1 | tee -a build.log + +export DOCKER_HOST := ssh://datavi.be +export UBUNTU_MIRROR := http://de.archive.ubuntu.com/ubuntu +buildremote: + docker build --build-arg UBUNTU_MIRROR=$(UBUNTU_MIRROR) . 2>&1 | tee -a build.log diff --git a/build/packages.txt b/build/packages.txt index c628b94..38b16b6 100644 --- a/build/packages.txt +++ b/build/packages.txt @@ -40,19 +40,27 @@ ldap-utils libasound2 libatk1.0-0 libboost-all-dev +libbz2-dev libdb++-dev +libffi-dev libgconf-2-4 libgtk-3-0 libjpeg-dev +liblzma-dev +libncurses5-dev libnss3 libnss-mdns libpng-dev +libreadline-dev +libsqlite3-dev libssl-dev libtool libxcursor1 libxml2 libxml2-dev +libxmlsec1-dev libxslt1-dev +llvm locales lsof mailutils @@ -93,6 +101,7 @@ sudo tcpdump telnet texlive-latex-base +tk-dev tmux tree ttf-wqy-microhei @@ -103,6 +112,8 @@ vim-gtk wamerican-insane wget xterm +xz-utils zfsutils-linux zip +zlib1g-dev zsh diff --git a/build/run.sh b/build/run.sh index a88a464..104f10c 100644 --- a/build/run.sh +++ b/build/run.sh @@ -19,6 +19,8 @@ SSH_HOST_KEY_FILES=" ssh_host_rsa_key.pub " +locale-gen en_US.UTF-8 + for FN in $SSH_HOST_KEY_FILES ; do ln -s /hostroot/etc/ssh/$FN /etc/ssh/$FN done @@ -34,10 +36,14 @@ pip3 install black # install prettier # install vim-go +mkdir -p /home/user/.ssh +cp /root/.ssh/authorized_keys /home/user/.ssh/authorized_keys echo chown -Rv $UID_TO_ADD:$GID_TO_ADD /home/user chown -Rv $UID_TO_ADD:$GID_TO_ADD /home/user chsh --shell $(which zsh) $USERNAME_TO_ADD +echo "$USERNAME_TO_ADD ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user + sudo \ --set-home \ --non-interactive \ diff --git a/build/user.sh b/build/user.sh index 1d8d0ac..99c516d 100644 --- a/build/user.sh +++ b/build/user.sh @@ -2,12 +2,13 @@ set -x -env - TD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)" U="$USERNAME_TO_ADD" +export LC_ALL=en_US +export LANG=en_US.UTF-8 + # original home OH="/hosthome" # link ~/.home to original home @@ -25,15 +26,26 @@ bash /tmp/installomz.sh --unattended --keep-zshrc # link in ssh key from original home mkdir -p ~/.ssh -ln -s ~/.home/.ssh/id_rsa ~/.ssh/id_rsa -ln -s ~/.home/.ssh/id_rsa.pub ~/.ssh/id_rsa.pub +ln -s ~/.home/Documents/sync/secrets/ssh/pixel16/id_rsa ~/.ssh/id_rsa +ln -s ~/.home/Documents/sync/secrets/ssh/pixel16/id_rsa.pub ~/.ssh/id_rsa.pub # install pyenv -git clone https://github.com/pyenv/pyenv.git ~/.pyenv -# FIXME install a python version +git clone -n https://github.com/pyenv/pyenv.git ~/.pyenv +pushd ~/.pyenv +git checkout 3e0f5e798ca16cd9389c4c8805038ac2c0d45cae +popd -git clone https://github.com/nvm-sh/nvm.git ~/.nvm -# FIXME install an nvm version +export PYENV_ROOT="$HOME/.pyenv" +export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" +pyenv install 3.8.2 -# move this to runtime FIXME -#DEVDIR="$( cd ~/.home/dev >/dev/null 2>&1 && pwd -P)" +git clone -n https://github.com/nvm-sh/nvm.git ~/.nvm +pushd ~/.nvm +git checkout 73438e339e242fce0cba443e5c4322ac996e9197 +popd + +export NVM_DIR="~/.nvm" +source "$NVM_DIR/nvm.sh" + +nvm install node diff --git a/root/home/user/.vimrc b/root/home/user/.vimrc index c4ad235..dc87d2a 100644 --- a/root/home/user/.vimrc +++ b/root/home/user/.vimrc @@ -7,7 +7,7 @@ silent !mkdir -p ~/.vim/autoload > /dev/null 2>&1 silent !mkdir -p ~/.vim/plugged > /dev/null 2>&1 if empty(glob('~/.vim/autoload/plug.vim')) - silent !curl -fLo ~/.paths/sneak-sync/dotfiles/vim/autoload/plug.vim --create-dirs + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif @@ -16,7 +16,7 @@ source ~/.vim/autoload/plug.vim call plug#begin('~/.vim/plugged') -Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } +" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " Plug 'roxma/vim-hug-neovim-rpc' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' diff --git a/root/home/user/.zshrc b/root/home/user/.zshrc index 34be52a..3bb8d06 100644 --- a/root/home/user/.zshrc +++ b/root/home/user/.zshrc @@ -68,7 +68,7 @@ ZSH_THEME="robbyrussell" # 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=(git) +plugins=(git git-prompt) source $ZSH/oh-my-zsh.sh