├── .github └── workflows │ └── update_submodules.yml ├── .gitmodules ├── acd_cli └── Dockerfile ├── base-dev └── Dockerfile ├── base-user └── Dockerfile ├── castnow └── Dockerfile ├── experiments └── wine-src-compile │ ├── Dockerfile │ ├── deps │ ├── pulse-client.conf │ └── runtime-deps ├── factorio └── Dockerfile ├── gcloud ├── Dockerfile └── gcloud ├── go └── Dockerfile ├── i3-gaps └── Dockerfile ├── intellij-go ├── .IdeaIC15 │ └── system │ │ ├── .home │ │ └── plugins │ │ ├── action.script │ │ ├── cucumber-java.zip │ │ └── cucumber.zip └── Dockerfile ├── keepers ├── kernel-builder ├── Dockerfile └── entrypoint.sh ├── neovim-go ├── .vim ├── .vimrc ├── Dockerfile ├── basic.vim ├── launch.sh ├── plugins.vim └── user.vim ├── netbrain ├── Dockerfile └── install-system ├── nvidia-wine ├── Dockerfile └── pulse-client.conf ├── nvidia-zwift ├── Dockerfile └── entrypoint.sh ├── openvpn-client └── Dockerfile ├── rclone ├── README.md ├── build.sh └── init │ ├── Dockerfile │ ├── builder │ └── Dockerfile │ └── entrypoint.sh ├── rtorrent ├── Dockerfile └── rtorrent.rc ├── scrcpy ├── Dockerfile ├── README.md └── scrcpy.sh ├── serve ├── Dockerfile ├── go.mod └── main.go ├── steam └── Dockerfile ├── wine ├── Dockerfile └── pulse-client.conf └── xorg ├── 10-input.conf └── Dockerfile /.github/workflows/update_submodules.yml: -------------------------------------------------------------------------------- 1 | name: Update submodules 2 | 3 | on: 4 | schedule: 5 | - cron: "0 4 * * *" 6 | jobs: 7 | update: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | - name: Pull & update submodules recursively 12 | run: | 13 | git submodule update --init --recursive 14 | git submodule update --recursive --remote 15 | - name: Commit & push changes 16 | run: | 17 | git config user.email "actions@github.com" 18 | git config user.name "Github Actions - update submodules" 19 | git commit -am "Update submodules" || echo "No changes to commit" 20 | git push 21 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "zwift"] 2 | path = zwift 3 | url = https://github.com/netbrain/zwift.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /acd_cli/Dockerfile: -------------------------------------------------------------------------------- 1 | #WIP 2 | #docker run --rm --name acd_cli -v $HOME/dev/.secret/.secrets.d/amazon-cloud-drive.json:/root/.cache/acd_cli/client_data -it netbrain/acd_cli 3 | FROM debian:jessie 4 | 5 | RUN apt-get update && apt-get -y install python3 python3-pip git 6 | RUN pip3 install --upgrade git+https://github.com/yadayada/acd_cli.git 7 | ENTRYPOINT acd_cli 8 | -------------------------------------------------------------------------------- /base-dev/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM netbrain/base-user 2 | 3 | #DEV ENV 4 | ENV TOOLS_PATH $HOME/tools 5 | ENV DEV_PATH $HOME/dev 6 | 7 | RUN mkdir -p $TOOLS_PATH $DEV_PATH $HOME/bin 8 | -------------------------------------------------------------------------------- /base-user/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | 3 | #DEPS 4 | RUN apt-get update && apt-get install -y sudo locales locales-all 5 | 6 | #LOCALE 7 | ENV LANG en_US.UTF-8 8 | ENV LC_ALL $LANG 9 | RUN sudo update-locale LC_ALL=$LANG LANG=$LANG 10 | 11 | #ADD NORMAL USER 12 | RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser docker sudo 13 | RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 14 | USER docker 15 | 16 | #USER ENV 17 | ENV HOME /home/docker 18 | WORKDIR $HOME 19 | -------------------------------------------------------------------------------- /castnow/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node 2 | 3 | RUN echo "deb http://www.deb-multimedia.org jessie main non-free" >> /etc/apt/sources.list 4 | RUN apt-get update 5 | RUN apt-get -y --force-yes install deb-multimedia-keyring ffmpeg 6 | RUN npm -g install castnow 7 | 8 | ENTRYPOINT ["castnow"] 9 | CMD ["--help"] 10 | -------------------------------------------------------------------------------- /experiments/wine-src-compile/Dockerfile: -------------------------------------------------------------------------------- 1 | # docker buildx build --output type=docker,name=test . 2 | 3 | FROM --platform=linux/amd64 debian:bullseye-slim as wine-src 4 | 5 | RUN \ 6 | apt-get update && \ 7 | apt-get -y install \ 8 | git && \ 9 | rm -rf /var/lib/apt/lists/* 10 | 11 | RUN \ 12 | git clone \ 13 | --depth 1 \ 14 | -b wine-7.0 \ 15 | https://github.com/wine-mirror/wine \ 16 | /usr/src/wine 17 | 18 | FROM --platform=linux/amd64 wine-src as wine64-builder 19 | ENV CFLAGS="-march=native -O3 -pipe -fstack-protector-strong" 20 | COPY deps /tmp/deps 21 | 22 | RUN \ 23 | apt-get update && \ 24 | cat /tmp/deps | xargs apt-get -y install && \ 25 | rm -rf /var/lib/apt/lists/* 26 | 27 | WORKDIR /usr/src/wine64 28 | 29 | RUN \ 30 | ../wine/configure \ 31 | --prefix=/usr/src/wine64-build \ 32 | --enable-win64 && \ 33 | make -j $(nproc) && \ 34 | make install 35 | 36 | FROM --platform=linux/i386 debian:bullseye-slim as wine32-tools-builder 37 | ENV CFLAGS="-march=native -O3 -pipe -fstack-protector-strong" 38 | COPY deps /tmp/deps 39 | 40 | RUN \ 41 | apt-get update && \ 42 | cat /tmp/deps | xargs apt-get -y install && \ 43 | rm -rf /var/lib/apt/lists/* 44 | 45 | COPY --from=wine-src /usr/src/wine /usr/src/wine 46 | 47 | WORKDIR /usr/src/wine32-tools 48 | 49 | RUN \ 50 | ../wine/configure && \ 51 | make -j $(nproc) 52 | 53 | FROM --platform=linux/i386 wine32-tools-builder as wine32-builder 54 | 55 | COPY --from=wine64-builder /usr/src/wine64 /usr/src/wine64 56 | 57 | WORKDIR /usr/src/wine32 58 | 59 | RUN \ 60 | ../wine/configure \ 61 | --prefix=/usr/src/wine32-build \ 62 | --with-wine-tools=../wine32-tools \ 63 | --with-wine64=../wine64 && \ 64 | make -j $(nproc) && \ 65 | make install 66 | 67 | FROM --platform=linux/amd64 debian:bullseye-slim as final 68 | 69 | ENV WINEDEBUG=fixme-all 70 | 71 | COPY runtime-deps /tmp/runtime-deps 72 | 73 | RUN \ 74 | dpkg --add-architecture i386 && \ 75 | apt-get update && \ 76 | cat /tmp/runtime-deps | xargs apt-get -y install && \ 77 | rm -rf /var/lib/apt/lists/* 78 | 79 | WORKDIR /usr/local/bin 80 | 81 | RUN \ 82 | wget \ 83 | https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks && \ 84 | chmod +x winetricks 85 | 86 | COPY --from=wine32-builder /usr/src/wine32-build /usr/local 87 | COPY --from=wine64-builder /usr/src/wine64-build /usr/local 88 | 89 | WORKDIR /tmp 90 | 91 | COPY pulse-client.conf /etc/pulse/client.conf 92 | -------------------------------------------------------------------------------- /experiments/wine-src-compile/deps: -------------------------------------------------------------------------------- 1 | build-essential 2 | flex 3 | bison 4 | libasound2-dev 5 | libpulse-dev 6 | libdbus-1-dev 7 | libfontconfig-dev 8 | libfreetype-dev 9 | libgnutls28-dev 10 | libjpeg62-turbo-dev 11 | libpng-dev 12 | libtiff-dev 13 | libgl-dev 14 | libunwind-dev 15 | libxml2-dev 16 | libxslt1-dev 17 | libfaudio-dev 18 | libgstreamer1.0-dev 19 | libgstreamer-plugins-base1.0-dev 20 | libmpg123-dev 21 | libosmesa6-dev 22 | libsdl2-dev 23 | libudev-dev 24 | libvkd3d-dev 25 | libvulkan-dev 26 | libcapi20-dev 27 | liblcms2-dev 28 | libcups2-dev 29 | libgphoto2-dev 30 | libsane-dev 31 | libgsm1-dev 32 | libkrb5-dev 33 | libldap2-dev 34 | samba-dev 35 | ocl-icd-opencl-dev 36 | libpcap-dev 37 | libusb-1.0-0-dev 38 | libv4l-dev 39 | libopenal-dev 40 | -------------------------------------------------------------------------------- /experiments/wine-src-compile/pulse-client.conf: -------------------------------------------------------------------------------- 1 | # Connect to the host's server using the mounted UNIX socket 2 | default-server = unix:/run/user/1000/pulse/native 3 | 4 | # Prevent a server running in the container 5 | autospawn = no 6 | daemon-binary = /bin/true 7 | 8 | # Prevent the use of shared memory 9 | enable-shm = false 10 | -------------------------------------------------------------------------------- /experiments/wine-src-compile/runtime-deps: -------------------------------------------------------------------------------- 1 | libgl1-mesa-glx 2 | libgl1-mesa-dri 3 | cabextract 4 | unzip 5 | pulseaudio 6 | wget 7 | libc6-i386 8 | libxext6 9 | libxext6:i386 10 | libx11-6 11 | libx11-6:i386 12 | libunwind8 13 | libfreetype6 14 | libfreetype6:i386 15 | libgnutlsxx28 16 | libgnutlsxx28:i386 17 | winbind 18 | ocl-icd-libopencl1 19 | ocl-icd-libopencl1:i386 20 | libasound2 21 | libasound2:i386 22 | libcapi20-3 23 | libcapi20-3:i386 24 | libglib2.0-0 25 | libglib2.0-0:i386 26 | libgphoto2-6 27 | libgphoto2-6:i386 28 | libgphoto2-port12 29 | libgphoto2-port12:i386 30 | libgstreamer1.0-0 31 | libgstreamer1.0-0:i386 32 | libgstreamer-plugins-base1.0-0 33 | libgstreamer-plugins-base1.0-0:i386 34 | libldap-2.4-2 35 | libldap-2.4-2:i386 36 | libopenal1 37 | libopenal1:i386 38 | libpcap0.8 39 | libpcap0.8:i386 40 | libpulse0 41 | libpulse0:i386 42 | libsane1 43 | libsane1:i386 44 | libudev1 45 | libudev1:i386 46 | libusb-1.0-0 47 | libusb-1.0-0:i386 48 | -------------------------------------------------------------------------------- /factorio/Dockerfile: -------------------------------------------------------------------------------- 1 | # docker run -it --restart=always 2 | # -v /factorio/saves:/factorio/saves 3 | # -v /factorio/mods:/factorio/mods 4 | # -p 34197:34197 5 | # netbrain/factorio 6 | 7 | FROM debian:jessie 8 | 9 | RUN apt-get update && apt-get install -y curl 10 | RUN curl -L http://www.factorio.com/get-download/0.12.29/headless/linux64 | tar xz 11 | WORKDIR /factorio/bin/x64 12 | CMD sh -c "./factorio --create default && ./factorio --start-server default" 13 | -------------------------------------------------------------------------------- /gcloud/Dockerfile: -------------------------------------------------------------------------------- 1 | # docker run --rm \ 2 | # -it \ 3 | # -v $HOME/.config/gcloud:/home/user/.config/gcloud \ 4 | # --user $(id -u):$(id -g) \ 5 | # netbrain/gcloud 6 | 7 | FROM debian:jessie 8 | ENV SHELL /bin/bash 9 | ENV HOME /home/user 10 | RUN mkdir -p /home/user 11 | RUN chmod 755 /home/user 12 | RUN apt-get update && apt-get -y install curl python openssh-client 13 | 14 | WORKDIR /home/user 15 | RUN curl https://sdk.cloud.google.com | bash 16 | 17 | ENTRYPOINT ["/home/user/google-cloud-sdk/bin/gcloud"] 18 | CMD ["init"] 19 | -------------------------------------------------------------------------------- /gcloud/gcloud: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir -p $HOME/.config/gcloud 3 | docker run --rm \ 4 | -it \ 5 | -v $HOME/.config/gcloud:/home/user/.config/gcloud \ 6 | --user $(id -u):$(id -g) \ 7 | netbrain/gcloud $@ 8 | -------------------------------------------------------------------------------- /go/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM netbrain/base-dev 2 | 3 | RUN sudo apt-get update 4 | RUN sudo apt-get -y install libncurses5-dev python-dev \ 5 | ruby-dev git python2.7 build-essential libncurses5-dev 6 | 7 | WORKDIR $TOOLS_PATH 8 | 9 | RUN git clone https://go.googlesource.com/go 10 | RUN cp -R go go1.4 11 | RUN (cd go1.4 && git checkout go1.4 && cd src && ./all.bash) 12 | 13 | ENV GOROOT_BOOTSTRAP=$TOOLS_PATH/go1.4 14 | 15 | RUN (cd go && git checkout go1.5.3 && cd src && ./all.bash ) 16 | 17 | ENV GOROOT=$TOOLS_PATH/go 18 | ENV GOPATH=$HOME/dev/go 19 | ENV PATH=$PATH:$GOROOT/bin 20 | ENV PATH=$PATH:$GOPATH/bin 21 | 22 | WORKDIR $HOME 23 | -------------------------------------------------------------------------------- /i3-gaps/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM netbrain/base-user 2 | 3 | RUN sudo apt-get update && sudo apt-get install -y git build-essential libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev 4 | 5 | RUN git clone https://www.github.com/Airblader/i3 i3-gaps 6 | WORKDIR i3-gaps 7 | 8 | RUN git checkout gaps && git pull 9 | RUN make && sudo make install 10 | 11 | RUN sudo apt-get install -y devscripts dpkg-dev reprepro ubuntu-dev-tools pbuilder 12 | RUN sudo ln -s pbuilder-dist /usr/bin/pbuilder-sid-amd64 13 | RUN sudo ln -s pbuilder-dist /usr/bin/pbuilder-sid-i386 14 | CMD pbuilder-sid-amd64 create 15 | -------------------------------------------------------------------------------- /intellij-go/.IdeaIC15/system/.home: -------------------------------------------------------------------------------- 1 | /idea-IC-143.1184.17 -------------------------------------------------------------------------------- /intellij-go/.IdeaIC15/system/plugins/action.script: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netbrain/dockerfiles/81be117f34a94aeca933cfce91d040f3247540b8/intellij-go/.IdeaIC15/system/plugins/action.script -------------------------------------------------------------------------------- /intellij-go/.IdeaIC15/system/plugins/cucumber-java.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netbrain/dockerfiles/81be117f34a94aeca933cfce91d040f3247540b8/intellij-go/.IdeaIC15/system/plugins/cucumber-java.zip -------------------------------------------------------------------------------- /intellij-go/.IdeaIC15/system/plugins/cucumber.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netbrain/dockerfiles/81be117f34a94aeca933cfce91d040f3247540b8/intellij-go/.IdeaIC15/system/plugins/cucumber.zip -------------------------------------------------------------------------------- /intellij-go/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM netbrain/go 2 | 3 | RUN sudo apt-get update 4 | RUN sudo apt-get install -y wget unzip libxext6 libxrender1 libxtst6 5 | 6 | WORKDIR $TOOLS_PATH 7 | 8 | #IDEA 9 | RUN wget --progress=bar:force --no-check-certificate --no-cookies https://download.jetbrains.com/idea/ideaIC-15.0.2.tar.gz 10 | RUN tar xzvf ideaIC-15.0.2.tar.gz 11 | ENV PATH $PATH:$TOOLS_PATH/idea-IC-143.1184.17/bin 12 | 13 | #JAVA 14 | RUN wget --progress=bar:force --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz 15 | RUN tar xzvf jdk-7u79-linux-x64.tar.gz 16 | RUN rm jdk-7u79-linux-x64.tar.gz 17 | ENV JAVA_HOME $TOOLS_PATH/jdk1.7.0_79 18 | ENV PATH $PATH:$JAVA_HOME/bin 19 | 20 | #Install GO plugin 21 | RUN mkdir -p $HOME/.IdeaIC15/config/plugins 22 | RUN wget \ 23 | --trust-server-names \ 24 | --progress=bar:force \ 25 | --no-check-certificate \ 26 | --no-cookies \ 27 | "https://plugins.jetbrains.com/plugin/download?pr=&updateId=22602" 28 | RUN ls -1 Go*.zip | head -n 1 | xargs unzip -d $HOME/.IdeaIC15/config/plugins 29 | 30 | WORKDIR $HOME 31 | 32 | CMD $TOOLS_PATH/idea-IC-143.1184.17/bin/idea.sh 33 | 34 | -------------------------------------------------------------------------------- /keepers: -------------------------------------------------------------------------------- 1 | xhost +local:`docker inspect --format='{{ .Config.Hostname }}' $containerId` 2 | 3 | 4 | docker run --privileged -v /dev/dri:/dev/dri -v /usr/share/fonts:/usr/share/fonts -v /dev:/dev --rm -it netbrain/xorg 5 | 6 | docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DPLAY=unix$DISPLAY --link friport_db_1:db -it tianon/robomongo 7 | -------------------------------------------------------------------------------- /kernel-builder/Dockerfile: -------------------------------------------------------------------------------- 1 | # docker run -it --rm -v /usr/src:/usr/src netbrain/kernel-builder 4.4 2 | FROM debian:jessie 3 | 4 | RUN apt-get update 5 | RUN apt-get install -y --no-install-recommends \ 6 | git build-essential ncurses-dev kernel-package curl xz-utils \ 7 | cpio 8 | 9 | WORKDIR /usr/src 10 | ADD ./entrypoint.sh /entrypoint.sh 11 | ENTRYPOINT ["/entrypoint.sh"] 12 | -------------------------------------------------------------------------------- /kernel-builder/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | : ${1?"Need to set kernel version with first argument"} 3 | 4 | set -e 5 | 6 | cd /usr/src 7 | curl -k -L https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-$1.tar.gz | tar xzv 8 | cp .config linux-$1/ 9 | cd linux-$1 10 | 11 | yes "" | make oldconfig 12 | cp .config ../.config-linux-$1-$(date +%s) 13 | make-kpkg clean 14 | make-kpkg -j 8 --initrd kernel-image kernel-headers 15 | -------------------------------------------------------------------------------- /neovim-go/.vim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/netbrain/dockerfiles/81be117f34a94aeca933cfce91d040f3247540b8/neovim-go/.vim -------------------------------------------------------------------------------- /neovim-go/.vimrc: -------------------------------------------------------------------------------- 1 | source $XDG_CONFIG_HOME/nvim/basic.vim 2 | source $XDG_CONFIG_HOME/nvim/plugins.vim 3 | source $XDG_CONFIG_HOME/nvim/user.vim 4 | -------------------------------------------------------------------------------- /neovim-go/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM netbrain/go 2 | 3 | #install dependencies 4 | RUN sudo apt-get update 5 | RUN sudo apt-get install -y git build-essential cmake pkg-config libtool-bin automake curl unzip xsel exuberant-ctags python-pip 6 | 7 | #clean cache 8 | RUN sudo apt-get clean 9 | RUN sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 10 | 11 | #download neovim 12 | WORKDIR $TOOLS_PATH 13 | RUN git clone https://github.com/neovim/neovim 14 | 15 | #compile neovim 16 | WORKDIR neovim 17 | RUN make -j 4 CMAKE_BUILD_TYPE=Release 18 | RUN sudo make install 19 | 20 | #install python modules 21 | RUN sudo pip install neovim 22 | 23 | #create base config 24 | ENV XDG_CONFIG_HOME $HOME/.config 25 | RUN mkdir -p $XDG_CONFIG_HOME/nvim 26 | ADD .vimrc $XDG_CONFIG_HOME/nvim/init.vim 27 | ADD basic.vim $XDG_CONFIG_HOME/nvim/basic.vim 28 | ADD plugins.vim $XDG_CONFIG_HOME/nvim/plugins.vim 29 | ADD user.vim $XDG_CONFIG_HOME/nvim/user.vim 30 | 31 | #create a nvim GOPATH for vim-go deps 32 | #ENV NVIM_GOPATH $HOME/.nvim-go-deps 33 | #RUN mkdir -p $NVIM_GOPATH 34 | 35 | #Install plugins and go binaries 36 | RUN curl -fLo $XDG_CONFIG_HOME/nvim/autoload/plug.vim --create-dirs \ 37 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 38 | RUN nvim --headless -c "PlugInstall | qa" 39 | RUN nvim --headless -c "GoInstallBinaries" -c "qa" 40 | 41 | #done 42 | WORKDIR $HOME 43 | CMD nvim 44 | -------------------------------------------------------------------------------- /neovim-go/basic.vim: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " Maintainer: 3 | " Amir Salihefendic 4 | " http://amix.dk - amix@amix.dk 5 | " 6 | " Version: 7 | " 5.0 - 29/05/12 15:43:36 8 | " 9 | " Blog_post: 10 | " http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github 11 | " 12 | " Awesome_version: 13 | " Get this config, nice color schemes and lots of plugins! 14 | " 15 | " Install the awesome version from: 16 | " 17 | " https://github.com/amix/vimrc 18 | " 19 | " Syntax_highlighted: 20 | " http://amix.dk/vim/vimrc.html 21 | " 22 | " Raw_version: 23 | " http://amix.dk/vim/vimrc.txt 24 | " 25 | " Sections: 26 | " -> General 27 | " -> VIM user interface 28 | " -> Colors and Fonts 29 | " -> Files and backups 30 | " -> Text, tab and indent related 31 | " -> Visual mode related 32 | " -> Moving around, tabs and buffers 33 | " -> Status line 34 | " -> Editing mappings 35 | " -> vimgrep searching and cope displaying 36 | " -> Spell checking 37 | " -> Misc 38 | " -> Helper functions 39 | " 40 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 41 | 42 | 43 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 44 | " => General 45 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 46 | " Sets how many lines of history VIM has to remember 47 | set history=500 48 | 49 | " Enable filetype plugins 50 | filetype plugin on 51 | filetype indent on 52 | 53 | " Set to auto read when a file is changed from the outside 54 | set autoread 55 | 56 | " With a map leader it's possible to do extra key combinations 57 | " like w saves the current file 58 | let mapleader = "," 59 | let g:mapleader = "," 60 | 61 | " Fast saving 62 | nmap w :w! 63 | 64 | " :W sudo saves the file 65 | " (useful for handling the permission-denied error) 66 | command W w !sudo tee % > /dev/null 67 | 68 | 69 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 70 | " => VIM user interface 71 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 72 | " Set 7 lines to the cursor - when moving vertically using j/k 73 | set so=7 74 | 75 | " Avoid garbled characters in Chinese language windows OS 76 | let $LANG='en' 77 | set langmenu=en 78 | source $VIMRUNTIME/delmenu.vim 79 | source $VIMRUNTIME/menu.vim 80 | 81 | " Turn on the WiLd menu 82 | set wildmenu 83 | 84 | " Ignore compiled files 85 | set wildignore=*.o,*~,*.pyc 86 | if has("win16") || has("win32") 87 | set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store 88 | else 89 | set wildignore+=.git\*,.hg\*,.svn\* 90 | endif 91 | 92 | "Always show current position 93 | set ruler 94 | 95 | " Height of the command bar 96 | set cmdheight=2 97 | 98 | " A buffer becomes hidden when it is abandoned 99 | set hid 100 | 101 | " Configure backspace so it acts as it should act 102 | set backspace=eol,start,indent 103 | set whichwrap+=<,>,h,l 104 | 105 | " In many terminal emulators the mouse works just fine, thus enable it. 106 | if has('mouse') 107 | set mouse=a 108 | endif 109 | 110 | " Ignore case when searching 111 | set ignorecase 112 | 113 | " When searching try to be smart about cases 114 | set smartcase 115 | 116 | " Highlight search results 117 | set hlsearch 118 | 119 | " Makes search act like search in modern browsers 120 | set incsearch 121 | 122 | " Don't redraw while executing macros (good performance config) 123 | set lazyredraw 124 | 125 | " For regular expressions turn magic on 126 | set magic 127 | 128 | " Show matching brackets when text indicator is over them 129 | set showmatch 130 | " How many tenths of a second to blink when matching brackets 131 | set mat=2 132 | 133 | " No annoying sound on errors 134 | set noerrorbells 135 | set novisualbell 136 | set t_vb= 137 | set tm=500 138 | 139 | " Add a bit extra margin to the left 140 | set foldcolumn=1 141 | 142 | 143 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 144 | " => Colors and Fonts 145 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 146 | " Enable syntax highlighting 147 | syntax enable 148 | 149 | try 150 | colorscheme desert 151 | catch 152 | endtry 153 | 154 | set background=dark 155 | 156 | " Set extra options when running in GUI mode 157 | if has("gui_running") 158 | set guioptions-=T 159 | set guioptions-=e 160 | set t_Co=256 161 | set guitablabel=%M\ %t 162 | endif 163 | 164 | " Set utf8 as standard encoding and en_US as the standard language 165 | set encoding=utf8 166 | 167 | " Use Unix as the standard file type 168 | set ffs=unix,dos,mac 169 | 170 | 171 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 172 | " => Files, backups and undo 173 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 174 | " Turn backup off, since most stuff is in SVN, git et.c anyway... 175 | set nobackup 176 | set nowb 177 | set noswapfile 178 | 179 | 180 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 181 | " => Text, tab and indent related 182 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 183 | " Use spaces instead of tabs 184 | set expandtab 185 | 186 | " Be smart when using tabs ;) 187 | set smarttab 188 | 189 | " 1 tab == 4 spaces 190 | set shiftwidth=4 191 | set tabstop=4 192 | 193 | " Linebreak on 500 characters 194 | set lbr 195 | set tw=500 196 | 197 | set ai "Auto indent 198 | set si "Smart indent 199 | set wrap "Wrap lines 200 | 201 | 202 | """""""""""""""""""""""""""""" 203 | " => Visual mode related 204 | """""""""""""""""""""""""""""" 205 | " Visual mode pressing * or # searches for the current selection 206 | " Super useful! From an idea by Michael Naumann 207 | vnoremap * :call VisualSelection('f', '') 208 | vnoremap # :call VisualSelection('b', '') 209 | 210 | 211 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 212 | " => Moving around, tabs, windows and buffers 213 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 214 | " Treat long lines as break lines (useful when moving around in them) 215 | map j gj 216 | map k gk 217 | 218 | " Map to / (search) and Ctrl- to ? (backwards search) 219 | map / 220 | map ? 221 | 222 | " Disable highlight when is pressed 223 | map :noh 224 | 225 | " Smart way to move between windows 226 | map j 227 | map k 228 | map h 229 | map l 230 | 231 | " Close the current buffer 232 | map bd :Bclose:tabclosegT 233 | 234 | " Close all the buffers 235 | map ba :bufdo bd 236 | 237 | " Useful mappings for managing tabs 238 | map tn :tabnew 239 | map to :tabonly 240 | map tc :tabclose 241 | map tm :tabmove 242 | map t :tabnext 243 | 244 | " Let 'tl' toggle between this and the last accessed tab 245 | let g:lasttab = 1 246 | nmap tl :exe "tabn ".g:lasttab 247 | au TabLeave * let g:lasttab = tabpagenr() 248 | 249 | 250 | " Opens a new tab with the current buffer's path 251 | " Super useful when editing files in the same directory 252 | map te :tabedit =expand("%:p:h")/ 253 | 254 | " Switch CWD to the directory of the open buffer 255 | map cd :cd %:p:h:pwd 256 | 257 | " Specify the behavior when switching between buffers 258 | try 259 | set switchbuf=useopen,usetab,newtab 260 | set stal=2 261 | catch 262 | endtry 263 | 264 | " Return to last edit position when opening files (You want this!) 265 | " autocmd BufReadPost * 266 | " \ if line("'\"") > 0 && line("'\"") <= line("$") | 267 | " \ exe "normal! g`\"" | 268 | " \ endif 269 | " Remember info about open buffers on close 270 | " set viminfo^=% 271 | 272 | 273 | """""""""""""""""""""""""""""" 274 | " => Status line 275 | """""""""""""""""""""""""""""" 276 | " Always show the status line 277 | set laststatus=2 278 | 279 | " Format the status line 280 | set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l 281 | 282 | 283 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 284 | " => Editing mappings 285 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 286 | " Remap VIM 0 to first non-blank character 287 | map 0 ^ 288 | 289 | " Move a line of text using ALT+[jk] or Comamnd+[jk] on mac 290 | nmap mz:m+`z 291 | nmap mz:m-2`z 292 | vmap :m'>+`mzgv`yo`z 293 | vmap :m'<-2`>my` 297 | nmap 298 | vmap 299 | vmap 300 | endif 301 | 302 | " Delete trailing white space on save, useful for Python and CoffeeScript ;) 303 | func! DeleteTrailingWS() 304 | exe "normal mz" 305 | %s/\s\+$//ge 306 | exe "normal `z" 307 | endfunc 308 | autocmd BufWrite *.py :call DeleteTrailingWS() 309 | autocmd BufWrite *.coffee :call DeleteTrailingWS() 310 | 311 | 312 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 313 | " => Ag searching and cope displaying 314 | " requires ag.vim - it's much better than vimgrep/grep 315 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 316 | " When you press gv you Ag after the selected text 317 | vnoremap gv :call VisualSelection('gv', '') 318 | 319 | " Open Ag and put the cursor in the right position 320 | map g :Ag 321 | 322 | " When you press r you can search and replace the selected text 323 | vnoremap r :call VisualSelection('replace', '') 324 | 325 | " Do :help cope if you are unsure what cope is. It's super useful! 326 | " 327 | " When you search with Ag, display your results in cope by doing: 328 | " cc 329 | " 330 | " To go to the next search result do: 331 | " n 332 | " 333 | " To go to the previous search results do: 334 | " p 335 | " 336 | map cc :botright cope 337 | map co ggVGy:tabnew:set syntax=qfpgg 338 | map n :cn 339 | map p :cp 340 | 341 | 342 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 343 | " => Spell checking 344 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 345 | " Pressing ,ss will toggle and untoggle spell checking 346 | map ss :setlocal spell! 347 | 348 | " Shortcuts using 349 | map sn ]s 350 | map sp [s 351 | map sa zg 352 | map s? z= 353 | 354 | 355 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 356 | " => Misc 357 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 358 | " Remove the Windows ^M - when the encodings gets messed up 359 | noremap m mmHmt:%s///ge'tzt'm 360 | 361 | " Quickly open a buffer for scribble 362 | map q :e ~/buffer 363 | 364 | " Quickly open a markdown buffer for scribble 365 | map x :e ~/buffer.md 366 | 367 | " Toggle paste mode on and off 368 | map pp :setlocal paste! 369 | 370 | 371 | 372 | 373 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 374 | " => Helper functions 375 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 376 | function! CmdLine(str) 377 | exe "menu Foo.Bar :" . a:str 378 | emenu Foo.Bar 379 | unmenu Foo 380 | endfunction 381 | 382 | function! VisualSelection(direction, extra_filter) range 383 | let l:saved_reg = @" 384 | execute "normal! vgvy" 385 | 386 | let l:pattern = escape(@", '\\/.*$^~[]') 387 | let l:pattern = substitute(l:pattern, "\n$", "", "") 388 | 389 | if a:direction == 'b' 390 | execute "normal ?" . l:pattern . "^M" 391 | elseif a:direction == 'gv' 392 | call CmdLine("Ag \"" . l:pattern . "\" " ) 393 | elseif a:direction == 'replace' 394 | call CmdLine("%s" . '/'. l:pattern . '/') 395 | elseif a:direction == 'f' 396 | execute "normal /" . l:pattern . "^M" 397 | endif 398 | 399 | let @/ = l:pattern 400 | let @" = l:saved_reg 401 | endfunction 402 | 403 | 404 | " Returns true if paste mode is enabled 405 | function! HasPaste() 406 | if &paste 407 | return 'PASTE MODE ' 408 | endif 409 | return '' 410 | endfunction 411 | 412 | " Don't close window, when deleting a buffer 413 | command! Bclose call BufcloseCloseIt() 414 | function! BufcloseCloseIt() 415 | let l:currentBufNum = bufnr("%") 416 | let l:alternateBufNum = bufnr("#") 417 | 418 | if buflisted(l:alternateBufNum) 419 | buffer # 420 | else 421 | bnext 422 | endif 423 | 424 | if bufnr("%") == l:currentBufNum 425 | new 426 | endif 427 | 428 | if buflisted(l:currentBufNum) 429 | execute("bdelete! ".l:currentBufNum) 430 | endif 431 | endfunction 432 | -------------------------------------------------------------------------------- /neovim-go/launch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | NVIMF=${1/$GOPATH/.} 3 | NVIMCD=$(dirname $NVIMF) 4 | 5 | docker run -it --rm \ 6 | -v $GOPATH:/home/docker/dev/go \ 7 | -v /tmp/.X11-unix:/tmp/.X11-unix \ 8 | -v $PWD/plugins.vim:/home/docker/.config/nvim/plugins.vim \ 9 | -v $PWD/user.vim:/home/docker/.config/nvim/user.vim \ 10 | -v $PWD/basic.vim:/home/docker/.config/nvim/basic.vim \ 11 | -e DISPLAY=unix$DISPLAY \ 12 | -e NVIMF=$NVIMF \ 13 | -e NVIMCD=$NVIMCD \ 14 | netbrain/neovim-go sh -c "nvim -c \":cd \$GOPATH/\$NVIMCD\" \$GOPATH/\$NVIMF" 15 | -------------------------------------------------------------------------------- /neovim-go/plugins.vim: -------------------------------------------------------------------------------- 1 | call plug#begin('~/.vim/plugged') 2 | 3 | " Make sure you use single quotes 4 | " Plug 'junegunn/seoul256.vim' 5 | " Plug 'junegunn/vim-easy-align' 6 | " 7 | " " Group dependencies, vim-snippets depends on ultisnips 8 | " Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' 9 | " 10 | " " On-demand loading 11 | " Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } 12 | " Plug 'tpope/vim-fireplace', { 'for': 'clojure' } 13 | " 14 | " " Using git URL 15 | " Plug 'https://github.com/junegunn/vim-github-dashboard.git' 16 | " 17 | " " Using a non-master branch 18 | " Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } 19 | " 20 | " " Plugin options 21 | " Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } 22 | " 23 | " " Plugin outside ~/.vim/plugged with post-update hook 24 | " Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } 25 | " 26 | " " Unmanaged plugin (manually installed and updated) 27 | " Plug '~/my-prototype-plugin' 28 | 29 | Plug 'altercation/vim-colors-solarized' 30 | 31 | Plug 'fatih/vim-go' 32 | 33 | Plug 'majutsushi/tagbar' 34 | 35 | Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' 36 | 37 | Plug 'garyburd/go-explorer' 38 | 39 | Plug 'Valloric/YouCompleteMe', { 'do': './install.py' } 40 | 41 | Plug 'Raimondi/delimitMate' 42 | 43 | Plug 'janko-m/vim-test' 44 | 45 | " Add plugins to &runtimepath 46 | call plug#end() 47 | -------------------------------------------------------------------------------- /neovim-go/user.vim: -------------------------------------------------------------------------------- 1 | "General 2 | " ------------------------------------------------------------------- 3 | try 4 | colorscheme solarized 5 | let g:solarized_termtrans = 1 6 | catch 7 | endtry 8 | 9 | "Tabs 10 | " ------------------------------------------------------------------- 11 | try 12 | unmap t 13 | catch 14 | endtry 15 | 16 | map :tabnew 17 | map :tabnext 18 | map :tabprevious 19 | 20 | "VIM-GO 21 | " ------------------------------------------------------------------- 22 | autocmd BufWritePost,FileWritePost *.go execute 'GoMetaLinter' 23 | 24 | "Run commands such as go run for the current file with r or go build 25 | "and go test for the current package with b and t 26 | "respectively. Display beautifully annotated source code to see which 27 | "functions are covered with c. 28 | au FileType go nmap r (go-run) 29 | au FileType go nmap b (go-build) 30 | au FileType go nmap t (go-test) 31 | au FileType go nmap c (go-coverage) 32 | 33 | "By default the mapping gd is enabled, which opens the target identifier in 34 | "current buffer. You can also open the definition/declaration, in a new 35 | "vertical, horizontal, or tab, for the word under your cursor: 36 | au FileType go nmap ds (go-def-split) 37 | au FileType go nmap dv (go-def-vertical) 38 | au FileType go nmap dt (go-def-tab) 39 | 40 | "Open the relevant Godoc for the word under the cursor with gd or open 41 | "it vertically with gv 42 | au FileType go nmap gd (go-doc) 43 | au FileType go nmap gv (go-doc-vertical) 44 | 45 | "au FileType go nmap gb (go-doc-browser) 46 | 47 | " Show a list of interfaces which is implemented by the type under your cursor 48 | " with s 49 | au FileType go nmap s (go-implements) 50 | 51 | "Show type info for the word under your cursor with i (useful if you have 52 | "disabled auto showing type info via g:go_auto_type_info) 53 | au FileType go nmap i (go-info) 54 | 55 | "Rename the identifier under the cursor to a new name 56 | au FileType go nmap e (go-rename) 57 | 58 | "Run :GoRun in a new tab, horizontal split or vertical split terminal 59 | au FileType go nmap rt (go-run-tab) 60 | au FileType go nmap rs (go-run-split) 61 | au FileType go nmap rv (go-run-vertical) 62 | 63 | "Quickly navigate through these location lists with :lne for 64 | "next error and :lp for previous. You can also bind these to keys, for example: 65 | map :lne 66 | map :lp 67 | 68 | " By default new terminals are opened in a vertical split. To change it 69 | let g:go_term_mode = "split" "or set to tab 70 | 71 | "By default when :GoInstallBinaries is called, the binaries are installed to 72 | "$GOBIN or $GOPATH/bin. To change it: 73 | let g:go_bin_path = "/home/docker/.neovim-go-deps" 74 | 75 | "Enable goimports to automatically insert import paths instead of gofmt: 76 | let g:go_fmt_command = "goimports" 77 | 78 | " TAGBAR 79 | " ------------------------------------------------------------------- 80 | nmap tb :TagbarToggle 81 | 82 | " UltiSnips 83 | " ------------------------------------------------------------------- 84 | 85 | let g:ycm_key_list_select_completion = [''] 86 | let g:ycm_key_list_previous_completion = [''] 87 | 88 | " Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe. 89 | let g:UltiSnipsExpandTrigger="" 90 | let g:UltiSnipsJumpForwardTrigger="" 91 | let g:UltiSnipsJumpBackwardTrigger="" 92 | 93 | " If you want :UltiSnipsEdit to split your window. 94 | let g:UltiSnipsEditSplit="vertical" 95 | -------------------------------------------------------------------------------- /netbrain/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM netbrain/base-user 2 | 3 | ADD . / 4 | 5 | RUN bash -c "DEBIAN_FRONTEND=noninteractive /install-system" 6 | -------------------------------------------------------------------------------- /netbrain/install-system: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | printenv 4 | 5 | read -r -d '' PACKAGES << EOM #Packages to install 6 | acpi 7 | acpid 8 | build-essential 9 | curl 10 | fonts-dejavu 11 | fonts-dejavu-core 12 | fonts-dejavu-extra 13 | fonts-inconsolata 14 | fonts-vlgothic 15 | git 16 | i3 17 | rxvt-unicode-256color 18 | strace 19 | sudo 20 | ttf-dejavu 21 | ttf-dejavu-core 22 | ttf-dejavu-extra 23 | vim-nox 24 | xorg 25 | xclip 26 | feh 27 | compton 28 | tmux 29 | xbindkeys 30 | EOM 31 | 32 | sudo apt-get update && echo $PACKAGES | xargs sudo -E apt-get install -y 33 | 34 | curl -sSL https://get.docker.com/ | sudo sh 35 | 36 | sudo adduser $USER docker 37 | 38 | DEVPATH=$HOME/dev 39 | BINPATH=$HOME/bin 40 | TOOLSPATH=$HOME/tools 41 | mkdir -p $DEVPATH $BINPATH $TOOLSPATH 42 | 43 | git clone https://github.com/netbrain/dotfiles $DEVPATH/dotfiles && cd $DEVPATH/dotfiles && make 44 | -------------------------------------------------------------------------------- /nvidia-wine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/opengl:1.2-glvnd-runtime-ubuntu20.04 2 | 3 | ENV WINEDEBUG=fixme-all 4 | 5 | RUN apt-get update \ 6 | && apt-get install -y sudo wget software-properties-common gnupg2 winbind xvfb pulseaudio \ 7 | && dpkg --add-architecture i386 \ 8 | && wget -nc https://dl.winehq.org/wine-builds/winehq.key \ 9 | && apt-key add winehq.key \ 10 | && add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' \ 11 | && apt-get update \ 12 | && apt-get install -y winehq-devel winetricks \ 13 | && apt-get clean -y \ 14 | && apt-get autoremove -y 15 | 16 | RUN adduser --disabled-password --gecos '' user \ 17 | && adduser user sudo \ 18 | && echo '%SUDO ALL=(ALL) NOPASSWD:ALL' >> \ 19 | /etc/sudoers 20 | 21 | USER user 22 | WORKDIR /home/user 23 | 24 | RUN winetricks --unattended msxml6 \ 25 | && winetricks --unattended corefonts \ 26 | && wget -P /tmp https://github.com/madewokherd/wine-mono/releases/download/wine-mono-6.1.2/wine-mono-6.1.2-x86.msi \ 27 | && wine msiexec /i /tmp/wine-mono-6.1.2-x86.msi \ 28 | && wget -P /tmp http://dl.winehq.org/wine/wine-gecko/2.47.2/wine-gecko-2.47.2-x86.msi \ 29 | && wget -P /tmp http://dl.winehq.org/wine/wine-gecko/2.47.2/wine-gecko-2.47.2-x86_64.msi \ 30 | && wine msiexec /i /tmp/wine-gecko-2.47.2-x86.msi \ 31 | && wine msiexec /i /tmp/wine-gecko-2.47.2-x86_64.msi \ 32 | && rm -rf /tmp/*.msi 33 | 34 | COPY pulse-client.conf /etc/pulse/client.conf 35 | -------------------------------------------------------------------------------- /nvidia-wine/pulse-client.conf: -------------------------------------------------------------------------------- 1 | # Connect to the host's server using the mounted UNIX socket 2 | default-server = unix:/run/user/1000/pulse/native 3 | 4 | # Prevent a server running in the container 5 | autospawn = no 6 | daemon-binary = /bin/true 7 | 8 | # Prevent the use of shared memory 9 | enable-shm = false 10 | -------------------------------------------------------------------------------- /nvidia-zwift/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM netbrain/nvidia-wine 2 | COPY entrypoint.sh . 3 | RUN sudo chmod +x entrypoint.sh 4 | ENTRYPOINT ["./entrypoint.sh"] 5 | -------------------------------------------------------------------------------- /nvidia-zwift/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -x 4 | 5 | ZWIFT_HOME="$HOME/.wine/drive_c/Program Files (x86)/Zwift" 6 | 7 | mkdir -p "$ZWIFT_HOME" 8 | cd "$ZWIFT_HOME" 9 | 10 | if [ "$1" = "update" ] 11 | then 12 | echo "updating zwift..." 13 | wine64 start ZwiftLauncher.exe 14 | wineserver -w 15 | exit 0 16 | fi 17 | 18 | if [ ! "$(ls -A .)" ] # is directory empty? 19 | then 20 | echo "installing dotnet" 21 | winetricks --unattended dotnet48 win10 22 | echo "workaround crash issue 1.21" # https://bugs.winehq.org/show_bug.cgi?id=45871 23 | winetricks --unattended d3dcompiler_47 24 | echo "installing webview2" 25 | #wget -O MicrosoftEdgeWebview2Setup.exe https://go.microsoft.com/fwlink/p/?LinkId=2124703 26 | wget -O MicrosoftEdgeWebview2Setup.exe https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/d1b0e946-e654-4d81-a42a-d581b8f3c40c/MicrosoftEdgeWebView2RuntimeInstallerX64.exe 27 | wine64 MicrosoftEdgeWebview2Setup.exe /silent /install 28 | 29 | echo "installing zwift..." 30 | wget https://www.nirsoft.net/utils/runfromprocess.zip 31 | unzip runfromprocess.zip 32 | wget https://cdn.zwift.com/app/ZwiftSetup.exe 33 | wine64 ZwiftSetup.exe /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /NOCANCEL 34 | # Wait for Zwift to fully install and then restart container 35 | wineserver -w 36 | exit 0 37 | fi 38 | echo "starting zwift..." 39 | wine64 start ZwiftLauncher.exe 40 | wine64 start RunFromProcess-x64.exe ZwiftLauncher.exe ZwiftApp.exe 41 | until pgrep ZwiftApp.exe &> /dev/null 42 | do 43 | echo "Waiting for zwift to start ..." 44 | sleep 1 45 | done 46 | 47 | echo "Killing uneccesary applications" 48 | pkill ZwiftLauncher 49 | pkill MicrosoftEdgeUp 50 | pkill ZwiftWindowsCra 51 | 52 | wineserver -w 53 | -------------------------------------------------------------------------------- /openvpn-client/Dockerfile: -------------------------------------------------------------------------------- 1 | #docker run -it --dns 8.8.8.8 -v /path/to/secret.vpn.config:/vpn.conf --cap-add=NET_ADMIN --device=/dev/net/tun --name vpn netbrain/openvpn-client 2 | FROM debian:jessie 3 | RUN apt-get update && apt-get -y install openvpn 4 | CMD ["openvpn","--config","/vpn.conf"] 5 | -------------------------------------------------------------------------------- /rclone/README.md: -------------------------------------------------------------------------------- 1 | The build.sh script creates a docker in docker environment which builds a scratch image of rclone using godockerize 2 | 3 | USAGE 4 | 5 | 1. Create config: 6 | 7 | docker run -it --rm --net=host -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt -v $HOME/.rclone.conf:/.rclone.conf netbrain/rclone config 8 | 9 | 2. Use rclone 10 | 11 | docker run -it -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt -v $HOME/.rclone.conf:/.rclone.conf netbrain/rclone 12 | 13 | 14 | -------------------------------------------------------------------------------- /rclone/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd init 3 | docker build -t rclone-init . 4 | docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock rclone-init 5 | docker rmi rclone-init 6 | 7 | echo "Completed building netbrain/rclone" 8 | -------------------------------------------------------------------------------- /rclone/init/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker 2 | 3 | RUN mkdir /rclone 4 | WORKDIR /rclone 5 | ADD . . 6 | 7 | WORKDIR builder 8 | CMD ["sh", "/rclone/entrypoint.sh"] 9 | -------------------------------------------------------------------------------- /rclone/init/builder/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang 2 | RUN go get github.com/dahernan/godockerize 3 | 4 | ENV APP github.com/ncw/rclone 5 | RUN go get $APP 6 | WORKDIR $GOPATH/src/$APP 7 | CMD godockerize -scratch 8 | -------------------------------------------------------------------------------- /rclone/init/entrypoint.sh: -------------------------------------------------------------------------------- 1 | docker build -t rclone-builder . 2 | docker run --name rclone-builder rclone-builder 3 | docker cp rclone-builder:/go/src/github.com/ncw/rclone /tmp 4 | docker rm rclone-builder 5 | docker rmi rclone-builder 6 | 7 | cd /tmp/rclone 8 | docker build -t netbrain/rclone . 9 | -------------------------------------------------------------------------------- /rtorrent/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | 3 | ENV PACKAGES "git build-essential libncurses5-dev libcurl4-openssl-dev automake libtool libcppunit-dev wget zlib1g-dev pkg-config libssl-dev" 4 | 5 | RUN apt-get update 6 | RUN apt-get -y install $PACKAGES 7 | 8 | WORKDIR /usr/src 9 | 10 | ENV LTV=0.13.6 11 | ENV RTV=0.9.6 12 | ENV LIBTORRENT=libtorrent-$LTV 13 | ENV RTORRENT=rtorrent-$RTV 14 | 15 | RUN wget http://rtorrent.net/downloads/$LIBTORRENT.tar.gz 16 | RUN tar xzvf $LIBTORRENT.tar.gz 17 | WORKDIR $LIBTORRENT 18 | RUN ./configure --with-posix-fallocate --disable-shared --enable-static 19 | RUN make 20 | RUN make install 21 | 22 | WORKDIR /usr/src 23 | RUN wget http://rtorrent.net/downloads/$RTORRENT.tar.gz 24 | RUN tar xzvf $RTORRENT.tar.gz 25 | WORKDIR $RTORRENT 26 | RUN ./configure --disable-shared --enable-static 27 | RUN make 28 | RUN make install 29 | 30 | RUN apt-get remove -y $PACKAGES 31 | RUN apt-get install -y libcurl3 32 | RUN apt-get autoremove -y 33 | 34 | WORKDIR /root 35 | ADD rtorrent.rc .rtorrent.rc 36 | RUN mkdir sessions torrents watch 37 | 38 | ENV TERM linux 39 | CMD rtorrent 40 | -------------------------------------------------------------------------------- /rtorrent/rtorrent.rc: -------------------------------------------------------------------------------- 1 | system.file_allocate.set = yes 2 | system.umask.set = 022 3 | directory = /root/downloads 4 | session = /root/sessions 5 | set_max_file_size = 536870912000 6 | schedule = watch_directory,0,10,"load_start=/root/watch/*.torrent" 7 | 8 | ## Network 9 | ip = 0.0.0.0 10 | port_range = 10000-19999 11 | port_random = yes 12 | 13 | ## BitTorrent 14 | min_peers = 20 15 | max_peers = 100 16 | min_peers_seed = 10 17 | max_peers_seed = 100 18 | max_uploads = 40 19 | encryption = require,require_RC4,allow_incoming,enable_retry 20 | 21 | ## Schedules 22 | schedule = low_diskspace,5,60,close_low_diskspace=500M 23 | 24 | ##Logging 25 | log.open_file = "rtorrent", /var/log/rtorrent.log 26 | log.add_output = "debug", "rtorrent" 27 | #log.add_output = "tracker_info", "rtorrent" 28 | #log.add_output = "dht_info", "rtorrent" 29 | #log.add_output = "thread_debug", "rtorrent" 30 | -------------------------------------------------------------------------------- /scrcpy/Dockerfile: -------------------------------------------------------------------------------- 1 | # docker run -it --rm \ 2 | # --privilged \ 3 | # -e DISPLAY=$DISPLAY \ 4 | # -v /tmp/.X11-unix:/tmp/.X11-unix \ 5 | # netbrain/scrcpy 6 | # adb pair ip:port key / scrcpy --tcpip=ip:port 7 | 8 | FROM alpine 9 | 10 | VOLUME /home/user 11 | 12 | RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ 13 | && apk update \ 14 | && apk add --no-cache android-tools scrcpy mesa-dri-gallium virtualgl \ 15 | && adduser --disabled-password user \ 16 | && chown user.user /home/user 17 | 18 | USER user 19 | -------------------------------------------------------------------------------- /scrcpy/README.md: -------------------------------------------------------------------------------- 1 | # scrcpy 2 | 3 | Containerized version of scrcpy and android-tools 4 | 5 | ## Prerequsites 6 | 7 | * [Enable developer options on your android device](https://developer.android.com/studio/debug/dev-options#enable) 8 | 9 | ## Usage 10 | USB 11 | 12 | `./scrcpy.sh` to connect and display screen over usb. (not tested, might need to mount the usb device into the container) 13 | 14 | WIFI 15 | 16 | `./scrcpy.sh adb pair : ` required once in order to pair to your device. 17 | 18 | `./scrcpy.sh scrcpy --tcpip=:` to connect and display screen over wifi. 19 | 20 | For other possibilities please read the documentation on scrcpy and android adb. 21 | 22 | * https://github.com/Genymobile/scrcpy 23 | * https://developer.android.com/studio/command-line/adb 24 | 25 | -------------------------------------------------------------------------------- /scrcpy/scrcpy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set the container image to use 4 | IMAGE=${IMAGE:-docker.io/netbrain/scrcpy} 5 | 6 | # The container version 7 | VERSION=${VERSION:-latest} 8 | 9 | # Check for updated container image 10 | docker pull $IMAGE:$VERSION 11 | 12 | docker volume create scrcpy 13 | 14 | ARGS="$@" 15 | if [[ -z "$ARGS" ]] 16 | then 17 | ARGS="scrcpy" 18 | fi 19 | 20 | # Create the container 21 | CONTAINER=$(docker create \ 22 | --rm \ 23 | --ipc=host \ 24 | -e DISPLAY=$DISPLAY \ 25 | -v scrcpy:/home/user \ 26 | -v /tmp/.X11-unix:/tmp/.X11-unix \ 27 | $IMAGE:$VERSION $ARGS) 28 | 29 | # Allow container to connect to X 30 | xhost +local:$(docker inspect --format='{{ .Config.Hostname }}' $CONTAINER) 31 | 32 | docker start -ia $CONTAINER 33 | -------------------------------------------------------------------------------- /serve/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.17 2 | WORKDIR /go/src/app 3 | COPY . . 4 | ENV CGO_ENABLED=0 5 | ENV GOOS=linux 6 | ENV GOARCH=amd64 7 | RUN go build -ldflags '-w -extldflags "-static"' -o serve -a main.go 8 | 9 | FROM scratch 10 | COPY --from=0 /go/src/app/serve /serve 11 | EXPOSE 8080/tcp 12 | ENTRYPOINT ["/serve"] 13 | -------------------------------------------------------------------------------- /serve/go.mod: -------------------------------------------------------------------------------- 1 | module serve 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /serve/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "log" 6 | "net/http" 7 | ) 8 | 9 | func main() { 10 | if len(os.Args) != 2 { 11 | log.Fatal("Supply a directory argument for which to serve") 12 | } 13 | fs := http.FileServer(http.Dir(os.Args[1])) 14 | http.Handle("/", fs) 15 | 16 | log.Println("Listening on :8080...") 17 | err := http.ListenAndServe(":8080", nil) 18 | if err != nil { 19 | log.Fatal(err) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /steam/Dockerfile: -------------------------------------------------------------------------------- 1 | ##!/bin/bash 2 | #set -e 3 | # 4 | #DATA_CONTAINER="data-steam" 5 | #DOCKER_IMAGE="netbrain/steam" 6 | # 7 | # 8 | #if ! docker inspect $DATA_CONTAINER >& /dev/null; then 9 | # docker create \ 10 | # -v /home/steam \ 11 | # --name $DATA_CONTAINER \ 12 | # busybox 13 | # docker run --volumes-from $DATA_CONTAINER busybox chown -R 1000:1000 /home/steam 14 | #fi 15 | # 16 | #docker run -it --rm \ 17 | # -e DISPLAY=unix$DISPLAY \ 18 | # --privileged \ 19 | # --net=host \ 20 | # -v /etc/localtime:/etc/localtime:ro \ 21 | # -v /tmp/.X11-unix:/tmp/.X11-unix \ 22 | # -v $HOME/.Xauthority:/home/steam/.Xauthority \ 23 | # -v /dev/shm:/dev/shm \ 24 | # -v /etc/machine-id:/etc/machine-id \ 25 | # -v /run/user/$UID/pulse/native:/tmp/pulse \ 26 | # -v /dev/dri:/dev/dri \ 27 | # --name steam \ 28 | # --volumes-from $DATA_CONTAINER \ 29 | # $DOCKER_IMAGE $@ 30 | # 31 | 32 | FROM ubuntu 33 | 34 | RUN echo 'deb [arch=amd64,i386] http://repo.steampowered.com/steam precise steam' > /etc/apt/sources.list.d/steam-inst.list && dpkg --add-architecture i386 35 | RUN apt-get update && apt-get install -yq --no-install-recommends --force-yes sudo libgl1-mesa-dri steam pulseaudio \ 36 | && rm -rf /etc/apt/sources.list.d/steam-inst.list \ 37 | && apt-get update \ 38 | && apt-get install -yq libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libc6:i386 libnss3:i386 dbus:i386 \ 39 | && apt-get clean 40 | 41 | RUN echo 'steam ALL = NOPASSWD: ALL' > /etc/sudoers.d/steam 42 | RUN chmod 0440 /etc/sudoers.d/steam 43 | RUN adduser --disabled-password steam --gecos "Steam" 44 | 45 | USER steam 46 | ENV HOME /home/steam 47 | VOLUME /home/steam 48 | ENV PULSE_SERVER unix:/tmp/pulse 49 | 50 | CMD sudo /etc/init.d/dbus start && steam 51 | -------------------------------------------------------------------------------- /wine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bookworm-slim 2 | ARG WINE_VERSION=7.0.0.0~bookworm-1 3 | ARG WINETRICKS_VERSION=20210206 4 | ENV NVIDIA_VISIBLE_DEVICES \ 5 | ${NVIDIA_VISIBLE_DEVICES:-all} 6 | ENV NVIDIA_DRIVER_CAPABILITIES \ 7 | ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics,compat32,utility 8 | ENV WINEDEBUG ${WINEDEBUG:-fixme-all} 9 | 10 | RUN dpkg --add-architecture i386 11 | 12 | RUN \ 13 | apt-get update && \ 14 | apt-get install -y --no-install-recommends \ 15 | sudo \ 16 | wget \ 17 | unzip \ 18 | gnupg2 \ 19 | procps \ 20 | winbind \ 21 | pulseaudio \ 22 | ca-certificates \ 23 | libxau6 libxau6:i386 \ 24 | libxdmcp6 libxdmcp6:i386 \ 25 | libxcb1 libxcb1:i386 \ 26 | libxext6 libxext6:i386 \ 27 | libx11-6 libx11-6:i386 \ 28 | libglvnd0 libglvnd0:i386 \ 29 | libgl1 libgl1:i386 \ 30 | libglx0 libglx0:i386 \ 31 | libegl1 libegl1:i386 \ 32 | libgles2 libgles2:i386 \ 33 | libgl1-mesa-glx libgl1-mesa-glx:i386 \ 34 | libgl1-mesa-dri libgl1-mesa-dri:i386 && \ 35 | wget -qO - http://dl.winehq.org/wine-builds/winehq.key | apt-key add - && \ 36 | echo "deb https://dl.winehq.org/wine-builds/debian/ bookworm main" > \ 37 | /etc/apt/sources.list.d/winehq.list && \ 38 | sed -i '/^Types: deb/{:a; N; /\n$/!ba; s/Suites: \(.*\)/Suites: bullseye \1/}' /etc/apt/sources.list.d/debian.sources && \ 39 | apt-get update && \ 40 | apt-get -y install --install-recommends \ 41 | winehq-stable=${WINE_VERSION} \ 42 | wine-stable=${WINE_VERSION} \ 43 | wine-stable-amd64=${WINE_VERSION} \ 44 | wine-stable-i386=${WINE_VERSION} && \ 45 | rm -rf /var/lib/apt/lists/* 46 | 47 | RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \ 48 | echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf 49 | 50 | # Required for non-glvnd setups. 51 | ENV LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 52 | 53 | COPY pulse-client.conf /etc/pulse/client.conf 54 | 55 | RUN \ 56 | wget \ 57 | https://raw.githubusercontent.com/Winetricks/winetricks/${WINETRICKS_VERSION}/src/winetricks \ 58 | -O /usr/local/bin/winetricks && \ 59 | chmod +x /usr/local/bin/winetricks 60 | 61 | RUN adduser --disabled-password --gecos '' user && \ 62 | adduser user sudo && \ 63 | echo '%SUDO ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 64 | 65 | USER user 66 | WORKDIR /home/user 67 | -------------------------------------------------------------------------------- /wine/pulse-client.conf: -------------------------------------------------------------------------------- 1 | # Connect to the host's server using the mounted UNIX socket 2 | default-server = unix:/run/user/1000/pulse/native 3 | 4 | # Prevent a server running in the container 5 | autospawn = no 6 | daemon-binary = /bin/true 7 | 8 | # Prevent the use of shared memory 9 | enable-shm = false 10 | -------------------------------------------------------------------------------- /xorg/10-input.conf: -------------------------------------------------------------------------------- 1 | Section "ServerFlags" 2 | Option "AutoAddDevices" "False" 3 | EndSection 4 | 5 | Section "ServerLayout" 6 | Identifier "Desktop" 7 | InputDevice "Mouse0" "CorePointer" 8 | InputDevice "Keyboard0" "CoreKeyboard" 9 | EndSection 10 | 11 | Section "InputDevice" 12 | Identifier "Keyboard0" 13 | Driver "kbd" 14 | Option "Device" "/dev/input/event0" 15 | EndSection 16 | 17 | Section "InputDevice" 18 | Identifier "Mouse0" 19 | Driver "mouse" 20 | Option "Protocol" "auto" 21 | Option "Device" "/dev/input/mice" 22 | Option "ZAxisMapping" "4 5 6 7" 23 | EndSection 24 | -------------------------------------------------------------------------------- /xorg/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:jessie 2 | 3 | ENV DEBIAN_FRONTEND noninteractive 4 | 5 | RUN apt-get update 6 | RUN apt-get -y install xorg i3 xserver-xorg-input-kbd 7 | #RUN apt-get -y install xserver-xorg-core 8 | #RUN bash -c "apt-get -y install xserver-xorg-video-{intel,modesetting,fbdev,vesa}" 9 | 10 | ADD 10-input.conf /etc/X11/xorg.conf.d/ 11 | 12 | ENTRYPOINT bash 13 | #docker run --rm --name xorg -it --group-add audio --group-add video --group-add plugdev --device /dev/tty10 --device /dev/input/mice --device /dev/input --device /dev/dri netbrain/xorg 14 | --------------------------------------------------------------------------------