next #1

Open
sneak wants to merge 27 commits from next into master
33 changed files with 1081 additions and 176 deletions

View File

@ -4,12 +4,16 @@ name: default
steps: steps:
- name: docker - name: docker
image: plugins/docker image: plugins/docker
build_args:
- UBUNTU_MIRROR=http://de.archive.ubuntu.com/ubuntu
settings: settings:
repo: sneak/work repo: sneak/work
dry_run: true #dry_run: true
#auto_tag: true build_args:
- UBUNTU_MIRROR=http://de.archive.ubuntu.com/ubuntu
username:
from_secret: docker_username
password:
from_secret: docker_password
tags: tags:
- ${DRONE_BRANCH//\//-}-${DRONE_COMMIT_SHA:0:8}
- ${DRONE_COMMIT_SHA} - ${DRONE_COMMIT_SHA}
- ${DRONE_BRANCH} - ${DRONE_BRANCH/\//-}

View File

@ -1,42 +1,25 @@
FROM ubuntu@sha256:8e1c1ee12a539d652c371ee2f4ee66909f4f5fd8002936d8011d958f05faf989 FROM sneak/workbase
ENV DEBIAN_FRONTEND noninteractive # nix for pkgs pls
RUN mkdir /nix && chown user:user /nix
ARG UBUNTU_MIRROR=http://us.archive.ubuntu.com/ubuntu USER root
ENV HOME /root
ARG UID_TO_ADD=1000
ARG GID_TO_ADD=1000
ARG USERNAME_TO_ADD=sneak
RUN \
echo "deb $UBUNTU_MIRROR focal main universe restricted multiverse" > /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-updates main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-security main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-backports main universe restricted multiverse" >> /etc/apt/sources.list.new && \
mv /etc/apt/sources.list.new /etc/apt/sources.list
ADD https://sneak.cloud/authorized_keys /root/.ssh/authorized_keys
# we only install essential system packages here
ARG SYSTEM_PACKAGES="build-essential ca-certificates openssh-server git golang rsync runit locales"
RUN \
apt update && \
apt -y upgrade && \
apt -y install $SYSTEM_PACKAGES && \
groupadd -g $GID_TO_ADD $USERNAME_TO_ADD && \
useradd -u $UID_TO_ADD -g $GID_TO_ADD -s /bin/bash $USERNAME_TO_ADD && \
usermod -p '*' $USERNAME_TO_ADD && \
go get -v -u github.com/peterbourgon/runsvinit && \
cp /root/go/bin/runsvinit /usr/local/sbin/runsvinit && \
rm -rf /root/go && \
rm /etc/ssh/*host*key*
COPY ./setup /tmp/setup
RUN bash /tmp/setup/run.sh
COPY ./root / COPY ./root /
COPY ./root.sh /tmp/build/root.sh
COPY ./user.sh /tmp/build/user.sh
RUN bash /tmp/build/root.sh
USER user
ENV HOME /home/user
RUN bash /tmp/build/user.sh
USER root
ENV HOME /root
RUN rm -rf /tmp/build
RUN chsh --shell /home/user/.nix-profile/bin/zsh user
RUN chmod +rx /etc/service/*/run RUN chmod +rx /etc/service/*/run
CMD ["/usr/local/sbin/runsvinit"] CMD ["/usr/local/sbin/runsvinit"]

View File

@ -1,4 +1,32 @@
export DOCKER_HOST := ssh://root@meatfucker.local
default: build default: build
.PHONY: build run base full release
start:
make build
make run
build: build:
sudo docker build . 2>&1 | tee -a build.log docker build --squash -t sneak/work .
full:
cd base && make build
make build
run:
-docker rm -f work
docker run \
-d \
--name work \
--hostname work \
--net host \
-v /:/hostroot \
-v /home/sneak:/hosthome \
-v /var/run/docker.sock:/var/run/docker.sock \
sneak/work
release:
make full && make run

View File

@ -2,6 +2,13 @@
sneak's working environment sneak's working environment
# todo
* zsh configuration
* powerline setup
* test vimrc
* ssh-agent setup inside container from zshrc
# license # license
wtfpl wtfpl

63
base/Dockerfile Normal file
View File

@ -0,0 +1,63 @@
#FROM ubuntu:focal-20201008
FROM ubuntu@sha256:1d7b639619bdca2d008eca2d5293e3c43ff84cbee597ff76de3b7a7de3e84956
ENV DEBIAN_FRONTEND noninteractive
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
ARG UID_TO_ADD=1000
ARG GID_TO_ADD=1000
ARG USERNAME_TO_ADD=user
RUN apt update && apt install -y ca-certificates apt-transport-https
#RUN \
# echo "deb $UBUNTU_MIRROR focal main universe restricted multiverse" > /etc/apt/sources.list.new && \
# echo "deb $UBUNTU_MIRROR focal-updates main universe restricted multiverse" >> /etc/apt/sources.list.new && \
# echo "deb $UBUNTU_MIRROR focal-security main universe restricted multiverse" >> /etc/apt/sources.list.new && \
# echo "deb $UBUNTU_MIRROR focal-backports main universe restricted multiverse" >> /etc/apt/sources.list.new && \
# mv /etc/apt/sources.list.new /etc/apt/sources.list
RUN \
groupadd -g $GID_TO_ADD $USERNAME_TO_ADD && \
groupadd nixbld && \
useradd -u $UID_TO_ADD -g $GID_TO_ADD --home-dir /home/user -m -s /bin/bash $USERNAME_TO_ADD && \
usermod -p '*' $USERNAME_TO_ADD
ADD https://sneak.cloud/authorized_keys /root/.ssh/authorized_keys
ADD https://sneak.cloud/authorized_keys /home/user/.ssh/authorized_keys
RUN apt update && apt install -y \
anacron \
apt-transport-https \
avahi-daemon \
build-essential \
byobu \
ca-certificates \
cron \
cronic \
curl \
git \
golang \
iproute2 \
iputils-ping \
locales \
openssh-server \
rsync \
runit \
sudo \
vim \
zsh
RUN /bin/bash -c "echo -e 'Y\n\n' | /usr/local/sbin/unminimize"
RUN \
go get -v -u github.com/peterbourgon/runsvinit && \
cp /root/go/bin/runsvinit /usr/local/sbin/runsvinit && \
rm -rf /root/go && \
apt -y purge golang && \
apt -y upgrade && \
apt -y autoremove
RUN usermod --shell $(which zsh) $USERNAME_TO_ADD
CMD ["/usr/local/sbin/runsvinit"]

6
base/Makefile Normal file
View File

@ -0,0 +1,6 @@
default: build
.PHONY: build
build:
docker build --squash -t sneak/workbase .

View File

@ -1,18 +0,0 @@
#!/bin/bash
pushd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)/../"
docker build -t sneak/work .
popd
# FIXME ssh host keys
docker run \
-d \
--name work \
-v /:/hostroot \
-v /home/sneak/.ssh/id_rsa:/home/sneak/.ssh/id_rsa \
-v /home/sneak/.ssh/config:/home/sneak/.ssh/config \
-v /home/sneak/.ssh/known_hosts:/home/sneak/.ssh/known_hosts \
-v /home/sneak/Documents:/home/sneak/Documents \
-v /var/run/docker.sock:/var/run/docker.sock \
sneak/work

61
root.sh Normal file
View File

@ -0,0 +1,61 @@
#!/bin/bash
echo "##### build/root.sh"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US:en"
set -x
set -e
TD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
cd "$TD"
SSH_HOST_KEY_FILES="
ssh_host_ecdsa_key
ssh_host_ecdsa_key.pub
ssh_host_ed25519_key
ssh_host_ed25519_key.pub
ssh_host_rsa_key
ssh_host_rsa_key.pub
"
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
locale-gen en_US.UTF-8
update-locale LANG="en_US.UTF-8" LANGUAGE="en_US"
dpkg-reconfigure locales
for FN in $SSH_HOST_KEY_FILES ; do
rm -f /etc/ssh/$FN
ln -s /hostroot/etc/ssh/$FN /etc/ssh/$FN
done
#ln -s /hostroot/root /root/.home
# install other stuff here
# FIXME do these with nix:
#pip3 install -U pip
#pip3 install black
# install python packages
# install yarn
# install prettier
# install vim-go
# i don't know how to make the terraform-libvirt provider
# build with nix's libvirt, this works for now
apt update && apt install -y libvirt0
mkdir -p /home/user/.ssh
cp /root/.ssh/authorized_keys /home/user/.ssh/authorized_keys
chown -R user:user /home/user
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user
groupadd -g 131 docker
usermod -aG docker user
#mkdir -p /etc/nix
#echo 'sandbox = false' > /etc/nix/nix.conf
#chown -R user:user /nix /etc/nix

View File

@ -0,0 +1,4 @@
#!/bin/bash
mkdir -p /run/sshd
exec /usr/sbin/sshd -D

View File

@ -0,0 +1 @@
Port 1337

View File

@ -0,0 +1,82 @@
{
packageOverrides = pkgs: with pkgs; rec {
# export PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/sbin:/bin:/usr/sbin:/usr/bin
# export MANPATH=$HOME/.nix-profile/share/man:/nix/var/nix/profiles/default/share/man:/usr/share/man
#'';
work = pkgs.buildEnv {
name = "workpackages";
paths = [
basePackages
adminPackages
];
pathsToLink = [ "/share/man" "/share/doc" "/bin" "/etc" ];
extraOutputsToInstall = [ "man" "doc" ];
};
adminPackages = pkgs.buildEnv {
name = "adminPackages";
paths = [
awscli2
byobu
cmake
cdrkit
envdir
figlet
httpie
jq
libvirt
llvm
mosh
mutt
nmap
openssl
pv
rsync
runit
terraform_0_13
tmux
wget
xz
];
pathsToLink = [ "/share/man" "/share/doc" "/bin" "/etc" ];
extraOutputsToInstall = [ "man" "doc" ];
};
basePackages = pkgs.buildEnv {
name = "my-packages";
paths = [
adminPackages
aria2
byobu
cmus
coreutils-prefixed
envdir
ffmpeg
gnupg
go
httpie
jq
neofetch
neovim
nmap
nodejs
openssl
par2cmdline
pv
pwgen
rsync
runit
tmux
tor
vim
vimpager
weechat
wget
xz
yarn
zsh
];
pathsToLink = [ "/share/man" "/share/doc" "/bin" "/etc" ];
extraOutputsToInstall = [ "man" "doc" ];
};
};
}

View File

@ -0,0 +1,266 @@
" this has to be first apparently?
" i had problems when it was lower in the file.
let mapleader=","
silent !mkdir -p ~/Library/vim/plug > /dev/null 2>&1
silent !mkdir -p ~/Library/vim/backup > /dev/null 2>&1
silent !mkdir -p ~/Library/vim/undo > /dev/null 2>&1
silent !mkdir -p ~/Library/vim/swap > /dev/null 2>&1
silent !mkdir -p ~/.paths/sneak-sync/dotfiles/vim/autoload > /dev/null 2>&1
silent !mkdir -p ~/.paths/sneak-sync/dotfiles/vim/plugged > /dev/null 2>&1
if empty(glob('~/Library/vim/plug/plug.vim'))
silent !curl -fLo ~/Library/vim/plug/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
source ~/Library/vim/plug/plug.vim
"Plug 'zchee/deoplete-go', { 'for': 'go' }
"Plug 'zchee/deoplete-jedi', { 'for': 'python' }
call plug#begin('~/Library/vim/plug')
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'}
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
let g:deoplete#enable_at_startup = 1
endif
Plug 'nathanaelkane/vim-indent-guides'
let g:indent_guides_enable_on_vim_startup = 1
Plug 'tpope/vim-sensible'
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
Plug 'prettier/vim-prettier', {
\ 'do': 'yarn install',
\ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] }
let g:prettier#autoformat = 1
let g:prettier#autoformat_require_pragma = 0
"Plug 'fatih/molokai'
Plug 'morhetz/gruvbox'
Plug 'sbdchd/neoformat'
Plug 'LnL7/vim-nix'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" syntastic
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plug 'vim-syntastic/syntastic'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_go_checkers = ['go']
call plug#end()
let g:rehash256 = 1
let g:molokai_original = 1
let g:gruvbox_italic = 1
"colorscheme molokai
colorscheme gruvbox
noremap <Leader>w :w<cr>
noremap <Leader><cr> i<cr><Esc>
noremap <Leader>l :GoMetaLinter<cr>
noremap <Leader>b :GoBuild<cr>
noremap <Leader>f :Neoformat<cr>
noremap <Leader>t :NERDTreeToggle<CR>
" vim-go golang configuration:
let g:go_fmt_fail_silently = 0
let g:go_fmt_command = "goimports"
let g:go_addtags_transform = "camelcase"
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_extra_types = 1
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
let g:go_auto_type_info = 1
"highlight SyntasticErrorSign guifg=white guibg=red
"Plug 'scrooloose/nerdtree'
"Plug 'ludovicchabant/vim-gutentags'
let g:gutentags_ctags_tagfile = '.tags'
let g:gutentags_file_list_command = 'git ls-files'
let g:gutentags_generate_on_new = 1
"Plug 'majutsushi/tagbar'
"Plug 'fatih/vim-go', { 'do': 'GoUpdateBinaries', 'for': 'go' }
"Plug 'cespare/vim-toml', { 'for': 'toml' }
"call plug#end()
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
" let g:airline_left_sep = '▶'
" let g:airline_right_sep = '◀'
let g:airline_symbols.crypt = '🔒'
let g:airline_symbols.linenr = '☰'
" let g:airline_symbols.linenr = '␊'
" let g:airline_symbols.linenr = '␤'
" let g:airline_symbols.linenr = '¶'
" let g:airline_symbols.maxlinenr = ''
" let g:airline_symbols.maxlinenr = '㏑'
" let g:airline_symbols.branch = '⎇'
" let g:airline_symbols.paste = 'ρ'
" let g:airline_symbols.paste = 'Þ'
" let g:airline_symbols.paste = '∥'
" let g:airline_symbols.spell = 'Ꞩ'
" let g:airline_symbols.notexists = 'Ɇ'
" let g:airline_symbols.whitespace = 'Ξ'
fun! InitBex()
let myvar = strftime("%y%m%d.%Hh%M")
let myvar = "set backupext=.". myvar
execute myvar
endfun
map <silent> <Esc>:call InitBex()<CR>
silent call InitBex()
set relativenumber
filetype plugin indent on
syntax on
set modelines=10
"noremap <Up> ""
"noremap! <Up> <Esc>
"noremap <Down> ""
"noremap! <Down> <Esc>
"noremap <Left> ""
"noremap! <Left> <Esc>
"noremap <Right> ""
"noremap! <Right> <Esc>
"vnoremap > ><CR>gv
"vnoremap < <<CR>gv
"au BufWinLeave * silent! mkview
"au BufWinEnter * silent! loadview
au BufRead,BufNewFile *.go set filetype=go
"au BufRead,BufNewFile *.coffee set filetype=coffee
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
"nnoremap <leader><space> :noh<cr>
set bg=dark
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
set autoindent
"set signcolumn=yes
set backspace=indent,eol,start
set backup
set backupdir=~/Library/vim/backup//
set cmdheight=3
"set clipboard=unnamed
set directory=~/Library/vim/swap//
set encoding=utf-8
set expandtab
set fileencodings=utf-8
set guifont=Monaco:h16
set hidden
set ignorecase
set laststatus=2
set modeline
set nobomb
set nocompatible
set shiftwidth=4
set showcmd
set smartcase
set smarttab
set softtabstop=4
set spellfile=~/.paths/sneak-sync/dotfiles/vim/spellfile.utf-8.add
set spelllang=en
set tabstop=4
set termencoding=utf-8
set ttyfast
set tw=76
set undodir=~/Library/vim/undo//
set undofile
set wildignore+=*.pyc
set writebackup
setglobal fileencoding=utf-8
autocmd FileType make setlocal noexpandtab
autocmd FileType markdown setlocal spell
au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
autocmd BufNewFile,BufRead *.json set ft=javascript
autocmd BufWritePre *.js Neoformat
autocmd BufWritePre *.jsx Neoformat
autocmd BufWritePre *.json Neoformat
autocmd BufWritePre *.css Neoformat
"inoremap jj <Esc>
"map N Nzz
"map n nzz
"map <s-tab> <c-w><c-w>
"colorscheme koehler
hi CursorLine term=none cterm=none ctermbg=none
set t_Co=256
set foldmethod=indent
set foldminlines=5
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i use
"nnoremap <silent> <Space> @=(foldlevel('.')?'za':'l')<CR>
"vnoremap <Space> zf
nnoremap <silent> <Tab> :bn<CR>
nnoremap <silent> <Backspace> :bp<CR>
nnoremap <silent> <Leader><Enter> :ls<CR>
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
let python_no_builtin_highlight = 1
let python_no_doctest_code_highlight = 1
let python_no_doctest_highlight = 1
let python_no_exception_highlight = 1
let python_no_number_highlight = 1
let python_space_error_highlight = 1
let g:flake8_show_in_gutter=1 " show

View File

@ -0,0 +1,2 @@
export LANG="en_US.UTF-8"
export LANGUAGE="en_US:en"

View File

@ -0,0 +1,4 @@
alias unsafessh="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
alias prettier="prettier --tab-width 4"
alias gencapkey="ssh-keygen -m PEM -t rsa -b 2048 -C \"caprover\" -f ./key -q -N \"\""
alias nixup="nix-channel --update && nix-env -iA nixpkgs.$(hostname -s)"

View File

@ -0,0 +1,2 @@
export EDITOR=vim

View File

@ -0,0 +1,10 @@
export GOPATH="$HOME/dev/go"
if [[ -d /usr/local/go/bin ]]; then
export PATH="$PATH:/usr/local/go/bin"
fi
if [[ -d "$GOPATH/bin" ]]; then
export PATH="$PATH:$GOPATH/bin"
fi

View File

@ -0,0 +1,7 @@
if [[ -d "$HOME/.local/bin" ]]; then
export PATH="$PATH:$HOME/.local/bin"
fi
if [[ -d "$HOME/bin" ]]; then
export PATH="$PATH:$HOME/bin"
fi

View File

@ -0,0 +1,10 @@
export HOMEBREW_NO_ANALYTICS=1
export GATSBY_TELEMETRY_DISABLED=1
export STNOUPGRADE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export SAM_CLI_TELEMETRY=0
export AZURE_CORE_COLLECT_TELEMETRY=0
export DO_NOT_TRACK=1
if command -v gcloud >/dev/null 2>&1 >/dev/null ; then
gcloud config set disable_usage_reporting true >/dev/null 2>&1
fi

View File

@ -0,0 +1 @@
git config --global push.default matching

View File

@ -0,0 +1,6 @@
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if which pyenv 2>&1 > /dev/null ; then
eval "$(pyenv init -)"
fi

View File

@ -0,0 +1,5 @@
export NVM_DIR="$HOME/.nvm"
if [[ -e "$NVM_DIR/nvm.sh" ]]; then
source "$NVM_DIR/nvm.sh"
fi

View File

@ -0,0 +1,19 @@
if [ -n "$BASH_VERSION" ]; then
HISTSIZE=10000
# Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing)
HISTFILESIZE=2000000
# Append to history instead of overwrite
shopt -s histappend
# Ignore redundant or space commands
HISTCONTROL=ignoreboth
# Ignore more
HISTIGNORE='ls:ll:ls -alh:pwd:clear:history'
# Set time format
HISTTIMEFORMAT='%F %T '
# Multiple commands on one line show up as a single line
shopt -s cmdhist
# Append new history lines, clear the history list, re-read the history list, print prompt.
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
fi

View File

@ -0,0 +1,8 @@
if [ -n "$BASH_VERSION" ]; then
if which kubectl 2>&1 > /dev/null ; then
source <(kubectl completion bash)
fi
alias k=kubectl
complete -F __start_kubectl k
fi

View File

@ -0,0 +1,9 @@
ZGP="$HOME/Library/Homebrew/opt/zsh-git-prompt/zshrc.sh"
if [ -n "$ZSH_VERSION" ]; then
if [[ -e "$ZGP" ]]; then
source "$ZGP"
fi
export PROMPT='%m:%~ $(git_super_status)$ '
fi

View File

@ -0,0 +1 @@
export LSCOLORS=ExGxBxDxCxEgEdxbxgxcxd

16
root/home/user/.toprc Normal file
View File

@ -0,0 +1,16 @@
top's Config File (Linux processes with windows)
Id:i, Mode_altscr=0, Mode_irixps=1, Delay_time=1.0, Curwin=0
Def fieldscur=¥¨³´»½ÀÄ·º¹Å&')*+,-./012568<>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=162740, sortindx=18, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=1, msgsclr=1, headclr=3, taskclr=1
Job fieldscur=¥¦¹·º(³´Ä»½@<§Å)*+,-./012568>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=195508, sortindx=0, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=6, msgsclr=6, headclr=7, taskclr=6
Mem fieldscur=¥º»<½¾¿ÀÁMBNÃD34·Å&'()*+,-./0125689FGHIJKLOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=195508, sortindx=21, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=5, msgsclr=5, headclr=4, taskclr=5
Usr fieldscur=¥¦§¨ª°¹·ºÄÅ)+,-./1234568;<=>?@ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=195380, sortindx=3, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=3, msgsclr=3, headclr=2, taskclr=3
Fixed_widest=0, Summ_mscale=0, Task_mscale=0, Zero_suppress=0

253
root/home/user/.vimrc Normal file
View File

@ -0,0 +1,253 @@
" this has to be first apparently?
" i had problems when it was lower in the file.
let mapleader=","
silent !mkdir -p ~/Library/vim/plug > /dev/null 2>&1
silent !mkdir -p ~/Library/vim/backup > /dev/null 2>&1
silent !mkdir -p ~/Library/vim/undo > /dev/null 2>&1
silent !mkdir -p ~/Library/vim/swap > /dev/null 2>&1
silent !mkdir -p ~/.paths/sneak-sync/dotfiles/vim/autoload > /dev/null 2>&1
silent !mkdir -p ~/.paths/sneak-sync/dotfiles/vim/plugged > /dev/null 2>&1
if empty(glob('~/Library/vim/plug/plug.vim'))
silent !curl -fLo ~/Library/vim/plug/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
source ~/Library/vim/plug/plug.vim
"Plug 'zchee/deoplete-go', { 'for': 'go' }
"Plug 'zchee/deoplete-jedi', { 'for': 'python' }
call plug#begin('~/Library/vim/plug')
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'}
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
let g:deoplete#enable_at_startup = 1
endif
Plug 'tpope/vim-sensible'
Plug 'preservim/nerdtree'
Plug 'ryanoasis/vim-devicons'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
"Plug 'fatih/molokai'
Plug 'morhetz/gruvbox'
Plug 'sbdchd/neoformat'
Plug 'LnL7/vim-nix'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" syntastic
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plug 'vim-syntastic/syntastic'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_go_checkers = ['go']
call plug#end()
let g:rehash256 = 1
let g:molokai_original = 1
let g:gruvbox_italic = 1
"colorscheme molokai
colorscheme gruvbox
noremap <Leader>w :w<cr>
noremap <Leader><cr> i<cr><Esc>
noremap <Leader>l :GoMetaLinter<cr>
noremap <Leader>b :GoBuild<cr>
noremap <Leader>f :Neoformat<cr>
noremap <Leader>t :NERDTreeToggle<CR>
" vim-go golang configuration:
let g:go_fmt_fail_silently = 0
let g:go_fmt_command = "goimports"
let g:go_addtags_transform = "camelcase"
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_extra_types = 1
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
let g:go_auto_type_info = 1
"highlight SyntasticErrorSign guifg=white guibg=red
"Plug 'scrooloose/nerdtree'
"Plug 'ludovicchabant/vim-gutentags'
let g:gutentags_ctags_tagfile = '.tags'
let g:gutentags_file_list_command = 'git ls-files'
let g:gutentags_generate_on_new = 1
"Plug 'majutsushi/tagbar'
"Plug 'fatih/vim-go', { 'do': 'GoUpdateBinaries', 'for': 'go' }
"Plug 'cespare/vim-toml', { 'for': 'toml' }
"call plug#end()
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
" let g:airline_left_sep = '▶'
" let g:airline_right_sep = '◀'
let g:airline_symbols.crypt = '🔒'
let g:airline_symbols.linenr = '☰'
" let g:airline_symbols.linenr = '␊'
" let g:airline_symbols.linenr = '␤'
" let g:airline_symbols.linenr = '¶'
" let g:airline_symbols.maxlinenr = ''
" let g:airline_symbols.maxlinenr = '㏑'
" let g:airline_symbols.branch = '⎇'
" let g:airline_symbols.paste = 'ρ'
" let g:airline_symbols.paste = 'Þ'
" let g:airline_symbols.paste = '∥'
" let g:airline_symbols.spell = 'Ꞩ'
" let g:airline_symbols.notexists = 'Ɇ'
" let g:airline_symbols.whitespace = 'Ξ'
fun! InitBex()
let myvar = strftime("%y%m%d.%Hh%M")
let myvar = "set backupext=.". myvar
execute myvar
endfun
map <silent> <Esc>:call InitBex()<CR>
silent call InitBex()
set relativenumber
filetype plugin indent on
syntax on
set modelines=10
"noremap <Up> ""
"noremap! <Up> <Esc>
"noremap <Down> ""
"noremap! <Down> <Esc>
"noremap <Left> ""
"noremap! <Left> <Esc>
"noremap <Right> ""
"noremap! <Right> <Esc>
"vnoremap > ><CR>gv
"vnoremap < <<CR>gv
"au BufWinLeave * silent! mkview
"au BufWinEnter * silent! loadview
au BufRead,BufNewFile *.go set filetype=go
"au BufRead,BufNewFile *.coffee set filetype=coffee
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
"nnoremap <leader><space> :noh<cr>
set bg=dark
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
set autoindent
"set signcolumn=yes
set backspace=indent,eol,start
set backup
set backupdir=~/Library/vim/backup//
set cmdheight=3
"set clipboard=unnamed
set directory=~/Library/vim/swap//
set encoding=utf-8
set expandtab
set fileencodings=utf-8,iso-8859-15
set guifont=Monaco:h16
set hidden
set ignorecase
set laststatus=2
set modeline
set nobomb
set nocompatible
set shiftwidth=4
set showcmd
set smartcase
set smarttab
set softtabstop=4
set spellfile=~/.paths/sneak-sync/dotfiles/vim/spellfile.utf-8.add
set spelllang=en
set tabstop=4
set termencoding=utf-8
set ttyfast
set tw=76
set undodir=~/Library/vim/undo//
set undofile
set wildignore+=*.pyc
set writebackup
setglobal fileencoding=utf-8
autocmd FileType make setlocal noexpandtab
autocmd FileType markdown setlocal spell
au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
autocmd BufNewFile,BufRead *.json set ft=javascript
autocmd BufWritePre *.js Neoformat
autocmd BufWritePre *.jsx Neoformat
autocmd BufWritePre *.json Neoformat
autocmd BufWritePre *.css Neoformat
"inoremap jj <Esc>
"map N Nzz
"map n nzz
"map <s-tab> <c-w><c-w>
"colorscheme koehler
hi CursorLine term=none cterm=none ctermbg=none
set t_Co=256
set foldmethod=indent
set foldminlines=5
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i use
"nnoremap <silent> <Space> @=(foldlevel('.')?'za':'l')<CR>
"vnoremap <Space> zf
nnoremap <silent> <Tab> :bn<CR>
nnoremap <silent> <Backspace> :bp<CR>
nnoremap <silent> <Leader><Enter> :ls<CR>
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
let python_no_builtin_highlight = 1
let python_no_doctest_code_highlight = 1
let python_no_doctest_highlight = 1
let python_no_exception_highlight = 1
let python_no_number_highlight = 1
let python_space_error_highlight = 1
let g:flake8_show_in_gutter=1 " show

88
root/home/user/.zshrc Normal file
View File

@ -0,0 +1,88 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/user/.zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="yyyy-mm-dd"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# 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 git-prompt zsh-autosuggestions)
plugins=(git git-prompt)
source $ZSH/oh-my-zsh.sh
if [[ -e ~/.nix-profile/etc/profile.d/nix.sh ]]; then
source ~/.nix-profile/etc/profile.d/nix.sh
fi
for FN in ~/.local/profile.d/*.sh ; do
source "$FN"
done
if [[ -d ~/.paths/sneak-sync/bashrc.d ]]; then
for FN in ~/.paths/sneak-sync/bashrc.d/*.sh ; do
source "$FN"
done
fi

16
root/root/.toprc Normal file
View File

@ -0,0 +1,16 @@
top's Config File (Linux processes with windows)
Id:i, Mode_altscr=0, Mode_irixps=1, Delay_time=1.0, Curwin=0
Def fieldscur=¥¨³´»½ÀÄ·º¹Å&')*+,-./012568<>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=162740, sortindx=18, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=1, msgsclr=1, headclr=3, taskclr=1
Job fieldscur=¥¦¹·º(³´Ä»½@<§Å)*+,-./012568>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=195508, sortindx=0, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=6, msgsclr=6, headclr=7, taskclr=6
Mem fieldscur=¥º»<½¾¿ÀÁMBNÃD34·Å&'()*+,-./0125689FGHIJKLOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=195508, sortindx=21, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=5, msgsclr=5, headclr=4, taskclr=5
Usr fieldscur=¥¦§¨ª°¹·ºÄÅ)+,-./1234568;<=>?@ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
winflags=195380, sortindx=3, maxtasks=0, graph_cpus=2, graph_mems=0
summclr=3, msgsclr=3, headclr=2, taskclr=3
Fixed_widest=0, Summ_mscale=0, Task_mscale=0, Zero_suppress=0

View File

@ -1,110 +0,0 @@
apt-transport-https
apt-utils
aspell
aspell-en
automake
bash-completion
bc
bind9-host
bonnie++
build-essential
byobu
ca-certificates
cmake
command-not-found
curl
daemontools
debmirror
default-jre
diffstat
dnsutils
docker.io
dos2unix
editorconfig
ffmpeg
fonts-indic
fonts-ipafont-gothic
fonts-ipafont-mincho
fortune
git
gnupg2
gnupg-agent
golang-go
host
imagemagick
iputils-ping
irssi
jq
lcov
ldap-auth-client
ldap-utils
libasound2
libatk1.0-0
libboost-all-dev
libdb++-dev
libgconf-2-4
libgtk-3-0
libjpeg-dev
libnss3
libnss-mdns
libpng-dev
libssl-dev
libtool
libxcursor1
libxml2
libxml2-dev
libxslt1-dev
locales
lsof
mailutils
make
man
man-db
mercurial
mosh
mutt
netcat-openbsd
nmap
nscd
openssh-server
pandoc
pass
pbzip2
pinentry-curses
pkg-config
psmisc
pv
pwgen
python3
python3-dev
python3-pip
rbenv
rsync
rsyslog
rsyslog-gnutls
rsyslog-relp
runit
screen
snmp
snmpd
socat
software-properties-common
strace
sudo
tcpdump
telnet
texlive-latex-base
tmux
tree
ttf-wqy-microhei
ttf-wqy-zenhei
vagrant
vim
vim-gtk
wamerican-insane
wget
xterm
zfsutils-linux
zip
zsh

View File

@ -1,7 +0,0 @@
#!/bin/bash
TD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
cd "$TD"
apt install -y $(cat packages.txt)

78
user.sh Normal file
View File

@ -0,0 +1,78 @@
#!/bin/bash
set -x
TD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"
U="user"
export HOME=/home/user
export USER=user
export LC_ALL=en_US
export LANG=en_US.UTF-8
# original home
OH="/hosthome"
# link ~/.home to original home
ln -s "/hosthome" $HOME/.home
cd $HOME && ls -tla
# /nix is already created for us and chowned to us by now:
curl -L https://nixos.org/nix/install | sh
source /home/user/.nix-profile/etc/profile.d/nix.sh
# this should install all the packages from the config.nix:
nix-env -iA nixpkgs.work
nix-env --set-flag priority 7 workpackages
# FIXME have this pull from synced dir instead
# oh-my-zsh
curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh > /tmp/installomz.sh
export ZSH="$HOME/.zsh"
export KEEP_ZSHRC=yes
zsh /tmp/installomz.sh && rm /tmp/installomz.sh
###############################################################################
##### Personal Config
###############################################################################
# I had envisioned this image as adaptable to other users but I've decided
# to abandon that hope and hardcode my own values in here.
git config --global user.email sneak@sneak.berlin
git config --global user.name sneak
mkdir -p ~/.paths
# TODO FIXME change the syncthing paths on las1 when convenient sometime
ln -s ~/.home/Library/Syncthing/folders/sync ~/.paths/sneak-sync
ln -s ~/.home/Library/Syncthing/folders/scratch ~/.paths/sneak-scratch
ln -s ~/.home/Library/Syncthing/folders/sneak-docs ~/.paths/sneak-docs
ln -s ~/.paths/sneak-docs ~/Documents
ln -s ~/.paths/sneak-scratch/dev ~/dev
ln -s ~/.paths/sneak-sync/dotfiles/weechat ~/.weechat
ln -s ~/.paths/sneak-sync/ssh/config ~/.ssh/config
# link in ssh key from original home
mkdir -p ~/.ssh
ln -s ~/.paths/sneak-sync/secrets/ssh/pixel16/id_rsa ~/.ssh/id_rsa
ln -s ~/.paths/sneak-sync/secrets/ssh/pixel16/id_rsa.pub ~/.ssh/id_rsa.pub
# vim plug preinstallation
# newline is to fix "hit ENTER" issue when it can't find the colorscheme file
# which PlugInstall is about to install
# this needs to happen after the linking above
echo "" | vim +PlugInstall +qall
vim +GoInstallBinaries +qall
vim +PlugInstall +qall
rm ~/.vimrc
ln -s ~/.paths/sneak-sync/dotfiles/vim/vimrc ~/.vimrc
mkdir -p ~/.config/nvim
ln -s ~/.paths/sneak-sync/dotfiles/vim/vimrc ~/.config/nvim/init.vim
mkdir -p ~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.2/linux_amd64
cd ~/.local/share/terraform/plugins/registry.terraform.io/dmacvicar/libvirt/0.6.2/linux_amd64