dotfiles

config files and scripts at HOME.
git clone git://git.ricketyspace.net/dotfiles.git
Log | Files | Refs

commit 5e5bee297ea9edd35920212b9386091a7d19d2c8
parent 03c61f75159e9581a1bbdaf3d320142676ac4160
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun, 30 Apr 2017 14:58:34 +0000

Move container scripts to .bin

Diffstat:
.bin/anki | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.bin/emacs-build | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.bin/mdl-style | 30++++++++++++++++++++++++++++++
.bin/php5 | 45+++++++++++++++++++++++++++++++++++++++++++++
.containers/anki | 73-------------------------------------------------------------------------
.containers/emacs-build | 60------------------------------------------------------------
.containers/mdl-style | 30------------------------------
.containers/php5 | 45---------------------------------------------
8 files changed, 208 insertions(+), 208 deletions(-)

diff --git a/.bin/anki b/.bin/anki @@ -0,0 +1,73 @@ +#!/bin/sh +# +# Copyright © 2017 rsiddharth <s@ricketyspace.net> +# License: GNU General Public License version 3 or higher. +# +# systemd-nspawn container for anki + +PWD=`pwd` +CONTAINER_DIR=$HOME'/.containers' +CONTAINER_NAME='anki' +CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME +SCRIPT=`basename "$0"` + +TERMINFO_SRC='/usr/share/terminfo/r/rxvt-256color:' +TERMINFO_BIND=$TERMINFO_SRC'/root/.terminfo/r/rxvt-256color' + +ANKI_DIR='/home/s/anki' + +if [ "$1" = "bootstrap" ]; then + echo 'debootstraping' + mkdir -p $CONTAINER_DIR + sudo debootstrap --arch=amd64 testing $CONTAINER + echo 'starting container' + sudo systemd-nspawn -D ./$CONTAINER \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + /root/$SCRIPT install +elif [ "$1" = "install" ]; then + echo 'installing paraphernalia in container' + apt-get update -y + apt-get install -y git python3-pip python3-pyqt5 \ + python3-pyqt5.qtwebengine pyqt5-dev-tools \ + portaudio19-dev mplayer lame sudo + id -u s &>/dev/null || adduser --disabled-login --gecos "" s + cd $ANKI_DIR || git clone git://github.com/dae/anki.git $ANKI_DIR \ + cd $ANKI_DIR + pip3 install -r requirements.txt + ./tools/build_ui.sh + chown -R s:s $ANKI_DIR +elif [ "$1" = "start-container" ]; then + echo 'starting container' + xhost +local: + sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ + -D ./$CONTAINER \ + --setenv=XAUTHORITY=~/.Xauthority \ + --bind=/tmp/ \ + --bind=/home/s/.Xauthority:/root/.Xauthority \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + --bind-ro=$TERMINFO_BIND +elif [ "$1" = "start-anki" ]; then + echo 'starting anki in container' + xhost +local: + sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ + -D ./$CONTAINER \ + --setenv=XAUTHORITY=~/.Xauthority \ + --bind=/tmp/ \ + --bind=/home/s/.Xauthority:/root/.Xauthority \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + /root/$SCRIPT run-anki + annex-anki +elif [ "$1" = "run-anki" ]; then + echo 'updating container' + apt-get update -y + apt-get upgrade -y + echo 'starting anki...' + cd $ANKI_DIR + git pull + ./tools/build_ui.sh + sudo -H -u s ./runanki + cp -f /home/s/collection.apkg /tmp/ +else + echo 'Dunno what to do' + exit 1 +fi diff --git a/.bin/emacs-build b/.bin/emacs-build @@ -0,0 +1,60 @@ +#!/bin/sh +# +# Copyright © 2017 rsiddharth <s@ricketyspace.net> +# License: GNU General Public License version 3 or higher. +# +# systemd-nspawn container for building/making emacs + +PWD=`pwd` +CONTAINER_DIR=$HOME'/.containers' +CONTAINER_NAME='emacs-build' +CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME +SCRIPT=`basename "$0"` + +EMACS_DIR=$HOME"/v/git/others/emacs" + +if [ "$1" = "bootstrap" ]; then + echo 'debootstraping' + mkdir -p $CONTAINER_DIR + sudo debootstrap --arch=amd64 testing $CONTAINER + echo 'starting container' + sudo systemd-nspawn -D ./$CONTAINER \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + /root/$SCRIPT install +elif [ "$1" = "install" ]; then + echo 'installing paraphernalia in container' + echo "deb-src http://deb.debian.org/debian testing main" >> \ + /etc/apt/sources.list + apt-get update -y + apt-get install -y build-essential libtiff5-dev libgtk-3-dev \ + libxpm-dev libgif-dev libgnutls28-dev \ + libncurses-dev git mailutils texinfo + apt-get build-dep -y emacs +elif [ "$1" = "start-container" ]; then + echo 'starting container' + sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ + -D ./$CONTAINER \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + --bind=$EMACS_DIR:/root/emacs +elif [ "$1" = "start-make" ]; then + echo 'starting container' + sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ + -D ./$CONTAINER \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + --bind=$EMACS_DIR:/root/emacs \ + /root/$SCRIPT make-emacs +elif [ "$1" = "make-emacs" ]; then + echo 'updating container' + apt-get update -y + apt-get upgrade -y + echo 'building emacs...' + cd /root/emacs + git pull + ./autogen.sh all + ./configure --with-mailutils + make bootstrap +else + echo 'Dunno what to do' + exit 1 +fi + diff --git a/.bin/mdl-style b/.bin/mdl-style @@ -0,0 +1,30 @@ +#!/bin/sh + +PWD=`pwd` +CONTAINER_DIR=$HOME'/.containers' +CONTAINER_NAME='mdl-style' +CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME +SCRIPT=`basename "$0"` + +TERMINFO_SRC='/usr/share/terminfo/r/rxvt-256color:' +TERMINFO_BIND=$TERMINFO_SRC'/root/.terminfo/r/rxvt-256color' + +if [ "$1" = "bootstrap" ]; then + echo 'debootstrap' + sudo debootstrap --arch=amd64 testing $CONTAINER + sudo systemd-nspawn -D ./$CONTAINER \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + /root/$SCRIPT install +elif [ "$1" = "install" ]; then + # this is run inside the container + apt-get update +elif [ "$1" = "start" ]; then + # start slack inside the container + sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ + -D ./$CONTAINER \ + --bind-ro=$TERMINFO_BIND +else + echo 'Dunno what to do' + exit 1 +fi + diff --git a/.bin/php5 b/.bin/php5 @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Copyright © 2017 rsiddharth <s@ricketyspace.net> +# License: GNU General Public License version 3 or higher. +# +# systemd-nspawn container for php5 + +PWD=`pwd` +CONTAINER_DIR=$HOME'/.containers' +CONTAINER_NAME='php5' +CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME +SCRIPT=`basename "$0"` + +TERMINFO_SRC='/usr/share/terminfo/r/rxvt-256color:' +TERMINFO_BIND=$TERMINFO_SRC'/root/.terminfo/r/rxvt-256color' + +if [ -n "$2" ]; then + BIND_DIR=$2 +else + BIND_DIR=$HOME +fi + +if [ "$1" = "bootstrap" ]; then + echo 'debootstrap' + sudo debootstrap --arch=amd64 jessie $CONTAINER + sudo systemd-nspawn -D ./$CONTAINER \ + --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ + /root/$SCRIPT install +elif [ "$1" = "install" ]; then + # this is run inside the container + apt-get update -y && \ + apt-get install -y php5 ca-certificates curl && + curl -sS https://getcomposer.org/installer | \ + php -- --install-dir=/usr/local/bin --filename=composer +elif [ "$1" = "start" ]; then + # start the container + sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ + --bind=$BIND_DIR:/root/bd \ + -D ./$CONTAINER \ + --bind-ro=$TERMINFO_BIND +else + echo 'Dunno what to do' + exit 1 +fi + diff --git a/.containers/anki b/.containers/anki @@ -1,73 +0,0 @@ -#!/bin/sh -# -# Copyright © 2017 rsiddharth <s@ricketyspace.net> -# License: GNU General Public License version 3 or higher. -# -# systemd-nspawn container for anki - -PWD=`pwd` -CONTAINER_DIR=$HOME'/.containers' -CONTAINER_NAME='anki' -CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME -SCRIPT=`basename "$0"` - -TERMINFO_SRC='/usr/share/terminfo/r/rxvt-256color:' -TERMINFO_BIND=$TERMINFO_SRC'/root/.terminfo/r/rxvt-256color' - -ANKI_DIR='/home/s/anki' - -if [ "$1" = "bootstrap" ]; then - echo 'debootstraping' - mkdir -p $CONTAINER_DIR - sudo debootstrap --arch=amd64 testing $CONTAINER - echo 'starting container' - sudo systemd-nspawn -D ./$CONTAINER \ - --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ - /root/$SCRIPT install -elif [ "$1" = "install" ]; then - echo 'installing paraphernalia in container' - apt-get update -y - apt-get install -y git python3-pip python3-pyqt5 \ - python3-pyqt5.qtwebengine pyqt5-dev-tools \ - portaudio19-dev mplayer lame sudo - id -u s &>/dev/null || adduser --disabled-login --gecos "" s - cd $ANKI_DIR || git clone git://github.com/dae/anki.git $ANKI_DIR \ - cd $ANKI_DIR - pip3 install -r requirements.txt - ./tools/build_ui.sh - chown -R s:s $ANKI_DIR -elif [ "$1" = "start-container" ]; then - echo 'starting container' - xhost +local: - sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ - -D ./$CONTAINER \ - --setenv=XAUTHORITY=~/.Xauthority \ - --bind=/tmp/ \ - --bind=/home/s/.Xauthority:/root/.Xauthority \ - --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ - --bind-ro=$TERMINFO_BIND -elif [ "$1" = "start-anki" ]; then - echo 'starting anki in container' - xhost +local: - sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ - -D ./$CONTAINER \ - --setenv=XAUTHORITY=~/.Xauthority \ - --bind=/tmp/ \ - --bind=/home/s/.Xauthority:/root/.Xauthority \ - --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ - /root/$SCRIPT run-anki - annex-anki -elif [ "$1" = "run-anki" ]; then - echo 'updating container' - apt-get update -y - apt-get upgrade -y - echo 'starting anki...' - cd $ANKI_DIR - git pull - ./tools/build_ui.sh - sudo -H -u s ./runanki - cp -f /home/s/collection.apkg /tmp/ -else - echo 'Dunno what to do' - exit 1 -fi diff --git a/.containers/emacs-build b/.containers/emacs-build @@ -1,60 +0,0 @@ -#!/bin/sh -# -# Copyright © 2017 rsiddharth <s@ricketyspace.net> -# License: GNU General Public License version 3 or higher. -# -# systemd-nspawn container for building/making emacs - -PWD=`pwd` -CONTAINER_DIR=$HOME'/.containers' -CONTAINER_NAME='emacs-build' -CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME -SCRIPT=`basename "$0"` - -EMACS_DIR=$HOME"/v/git/others/emacs" - -if [ "$1" = "bootstrap" ]; then - echo 'debootstraping' - mkdir -p $CONTAINER_DIR - sudo debootstrap --arch=amd64 testing $CONTAINER - echo 'starting container' - sudo systemd-nspawn -D ./$CONTAINER \ - --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ - /root/$SCRIPT install -elif [ "$1" = "install" ]; then - echo 'installing paraphernalia in container' - echo "deb-src http://deb.debian.org/debian testing main" >> \ - /etc/apt/sources.list - apt-get update -y - apt-get install -y build-essential libtiff5-dev libgtk-3-dev \ - libxpm-dev libgif-dev libgnutls28-dev \ - libncurses-dev git mailutils texinfo - apt-get build-dep -y emacs -elif [ "$1" = "start-container" ]; then - echo 'starting container' - sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ - -D ./$CONTAINER \ - --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ - --bind=$EMACS_DIR:/root/emacs -elif [ "$1" = "start-make" ]; then - echo 'starting container' - sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ - -D ./$CONTAINER \ - --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ - --bind=$EMACS_DIR:/root/emacs \ - /root/$SCRIPT make-emacs -elif [ "$1" = "make-emacs" ]; then - echo 'updating container' - apt-get update -y - apt-get upgrade -y - echo 'building emacs...' - cd /root/emacs - git pull - ./autogen.sh all - ./configure --with-mailutils - make bootstrap -else - echo 'Dunno what to do' - exit 1 -fi - diff --git a/.containers/mdl-style b/.containers/mdl-style @@ -1,30 +0,0 @@ -#!/bin/sh - -PWD=`pwd` -CONTAINER_DIR=$HOME'/.containers' -CONTAINER_NAME='mdl-style' -CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME -SCRIPT=`basename "$0"` - -TERMINFO_SRC='/usr/share/terminfo/r/rxvt-256color:' -TERMINFO_BIND=$TERMINFO_SRC'/root/.terminfo/r/rxvt-256color' - -if [ "$1" = "bootstrap" ]; then - echo 'debootstrap' - sudo debootstrap --arch=amd64 testing $CONTAINER - sudo systemd-nspawn -D ./$CONTAINER \ - --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ - /root/$SCRIPT install -elif [ "$1" = "install" ]; then - # this is run inside the container - apt-get update -elif [ "$1" = "start" ]; then - # start slack inside the container - sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ - -D ./$CONTAINER \ - --bind-ro=$TERMINFO_BIND -else - echo 'Dunno what to do' - exit 1 -fi - diff --git a/.containers/php5 b/.containers/php5 @@ -1,45 +0,0 @@ -#!/bin/sh -# -# Copyright © 2017 rsiddharth <s@ricketyspace.net> -# License: GNU General Public License version 3 or higher. -# -# systemd-nspawn container for php5 - -PWD=`pwd` -CONTAINER_DIR=$HOME'/.containers' -CONTAINER_NAME='php5' -CONTAINER=$CONTAINER_DIR'/'$CONTAINER_NAME -SCRIPT=`basename "$0"` - -TERMINFO_SRC='/usr/share/terminfo/r/rxvt-256color:' -TERMINFO_BIND=$TERMINFO_SRC'/root/.terminfo/r/rxvt-256color' - -if [ -n "$2" ]; then - BIND_DIR=$2 -else - BIND_DIR=$HOME -fi - -if [ "$1" = "bootstrap" ]; then - echo 'debootstrap' - sudo debootstrap --arch=amd64 jessie $CONTAINER - sudo systemd-nspawn -D ./$CONTAINER \ - --bind-ro=$PWD/$SCRIPT:/root/$SCRIPT \ - /root/$SCRIPT install -elif [ "$1" = "install" ]; then - # this is run inside the container - apt-get update -y && \ - apt-get install -y php5 ca-certificates curl && - curl -sS https://getcomposer.org/installer | \ - php -- --install-dir=/usr/local/bin --filename=composer -elif [ "$1" = "start" ]; then - # start the container - sudo systemd-nspawn --setenv=DISPLAY=:0.0 \ - --bind=$BIND_DIR:/root/bd \ - -D ./$CONTAINER \ - --bind-ro=$TERMINFO_BIND -else - echo 'Dunno what to do' - exit 1 -fi -