even more updates

This commit is contained in:
Frieder Schlesier 2019-10-15 22:02:16 +02:00
parent d62ce0a041
commit d01bb81ea1
4 changed files with 99 additions and 23 deletions

View File

@ -2,7 +2,7 @@ alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias rs='rsync --progress -v'
alias rs='rsync --progress -vur '
alias up='sudo apt update && sudo apt upgrade'
alias upnodock='sudo apt-mark hold docker-ce docker-ce-cli && sudo apt update && sudo apt upgrade && sudo apt-mark unhold docker-ce docker-ce-cli'
@ -37,8 +37,12 @@ alias dvl='docker volume ls'
alias dip="docker container inspect -f '{{ .NetworkSettings.IPAddress }}'" # call with <container name> or ID
alias dih="docker container inspect -f '{{ .Config.Hostname }}'" # call with <container name> or ID
alias dstats="docker stats "'$(sudo docker ps -aq)' # shows stats thingy for all containers
alias drmsc="docker container ls -a | grep Exited | awk '{print $1}' | xargs docker container rm" # removes stopped containers
alias drmdi="docker image remove "'$(docker image ls -q -f dangling=true)' # removes non-tagged images
alias drmsc="docker container prune"
#alias drmsc="docker container ls -a | grep Exited | awk '{print $1}' | xargs docker container rm" # removes stopped containers
alias drmdi="docker image prune"
#alias drmdi="docker image remove "'$(docker image ls -q -f dangling=true)' # removes non-tagged images
# docker swarm
alias dss='docker stack services '

View File

@ -544,3 +544,19 @@ wireshark() {
jess/wireshark
}
woeusb() {
del_stopped woeusb
docker run -it \
-v /etc/localtime:/etc/localtime:ro \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd):/home/woe \
-v /dev/:/shared_devs \
-v /mnt/:/mnted_devs \
-e DISPLAY=unix$DISPLAY \
--privileged \
--name woeusb \
${DOCKER_REPO_PREFIX}/woeusb
}

View File

@ -5,7 +5,7 @@ set -x
# backup.sh
pre="/home/fschl"
target="/media/black_Backups/2018-12"
target="/media/store/"
# target="/media/driveBay/Backups"
folders=( "Documents" #contains Org files

View File

@ -2,7 +2,7 @@
set -e
# install.sh
# This script installs my basic setup for a debian machine
# This script installs a basic setup for a debian machine
USERNAME=fschl
SUDO="sudo"
@ -20,7 +20,7 @@ check_root() {
}
apt_sources() {
# http://deb.debian.org/
# https://www.debian.org/releases/
ddist=$1
DIST="${ddist:-stable}"
@ -172,7 +172,6 @@ install_nvidia_docker() {
}
install_latex() {
apt update
apt install -y \
evince \
@ -290,6 +289,29 @@ EOF
echo "... setting capslock to control"
sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard
TARGET="/home/$USERNAME/.emacs.d"
git clone https://github.com/syl20bnr/spacemacs "${TARGET}"
#rm -rf "${TARGET}"/private/snippets
#git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snips
#ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/
}
link_userdirs() {
mount_dir=$1
target_mount="${mount_dir:-/mnt/docs/}"
user_dirs=("Documents Downloads Music Pictures Videos")
for DIR in $user_dirs
do
echo "removing and linking ${DIR}..."
rm -rfv /home/$USERNAME/$DIR
echo "link target: ${target_mount}/${DIR}"
ln -vs ${target_mount}/${DIR} /home/${USERNAME}/${DIR}
done
projects_mount=$docs_mount
}
install_vscodium() {
@ -373,6 +395,49 @@ install_compose() {
/usr/bin/docker-compose version
}
install_nvidia() {
echo "Prepare install for NVIDIA proprietary display driver"
apt update
apt install -y \
gcc \
linux-source \
linux-headers-`uname -r` \
--no-install-recommends
echo ""
echo "Please find a link to the current Package"
echo " https://devtalk.nvidia.com/default/topic/533434/linux/current-graphics-driver-releases/"
echo ""
echo "1. Download the self extracting archive. (*.run)"
echo "2. reboot into recovery mode and login as root"
echo "3. sh DRIVER_ARCHIVE.run"
echo ""
echo "... check if driver was installed correctly: $ nvidia-smi"
echo "more information can be found in README at link above"
echo ""
echo "Install NVIDIA-docker"
echo ""
echo "since Docker 19.03 no additional runtime required."
echo " https://github.com/NVIDIA/nvidia-docker"
# https://nvidia.github.io/nvidia-docker/
distribution="debian10"
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
apt update
apt install -y nvidia-container-toolkit
systemctl restart docker
docker pull nvidia/cuda:9.0-base
echo ""
echo "... check if driver was installed correctly: "
echo "$ docker run --gpus all nvidia/cuda:9.0-base nvidia-smi"
echo " should give same output as above"
}
install_virtualbox() {
# https://wiki.debian.org/VirtualBox#Installation_of_non-free_edition
apt install -y \
@ -385,17 +450,6 @@ install_virtualbox() {
}
get_dotfiles() {
(
# git clone https://gitlab.com/fschl/dotfiles.git "/home/$USERNAME/dotfiles"
# cd "/home/$USERNAME/dotfiles" && make
# TODO: propbably dont really need the whole repo
git clone https://gitlab.com/fschl/dockerfiles.git "/home/$USERNAME/dockerfiles"
)
}
# install/update golang from source
install_golang() {
export GO_VERSION=1.16.0
@ -423,14 +477,13 @@ main() {
base)
# apt_sources buster
base_applications
install_docker
install_compose
;;
dotfiles)
get_dotfiles
;;
server)
apt_sources buster
base_applications
install_server_base
install_docker
install_compose
;;
desktop)
# apt_sources buster
@ -442,6 +495,9 @@ main() {
source get_private_stuff.sh
fi
;;
links)
link_userdirs /mnt/docs/
;;
latex)
install_latex
;;