diff --git a/setup_apps.sh b/setup_apps.sh index 7a2bbf0..ae8e8d6 100644 --- a/setup_apps.sh +++ b/setup_apps.sh @@ -18,12 +18,13 @@ echo "" echo "Install and config python & jupyter..." apt-get update && \ apt-get install -y ipmitool && modprobe ipmi_devintf && \ +curl -fsSL https://deb.nodesource.com/setup_current.x | bash - \ apt-get install -y python3-pip nodejs npm git && \ apt-add-repository -y ppa:cantera-team/cantera && \ apt-get install -y cantera-python3 && \ python3 -m pip install jupyterhub && \ npm install -g configurable-http-proxy && \ -python3 -m pip install jupyterlab notebook jupyterlab-git tensorflow && \ +python3 -m pip install jupyterlab notebook jupyterlab-git tensorflow-gpu && \ python3 -m pip install h5py tqdm pandas ipywidgets pillow matplotlib && \ python3 -m pip install scipy scikit-learn && \ mkdir /etc/jupyterhub/ && \ @@ -32,6 +33,8 @@ cp jupyterhub.service /etc/systemd/system/jupyterhub.service && \ systemctl enable jupyterhub && \ systemctl start jupyterhub + + if [ $? -eq 0 ]; then echo "check nvidia drivers..." nvidia-smi diff --git a/setup_bcache.sh b/setup_bcache.sh index 019e60a..74de33e 100644 --- a/setup_bcache.sh +++ b/setup_bcache.sh @@ -3,18 +3,32 @@ #sources: #https://wiki.archlinux.org/title/bcache #https://stackoverflow.com/questions/20797819/command-to-change-the-default-home-directory-of-a-user +#https://unix.stackexchange.com/questions/156102/optimizing-bcache +#https://evilpiepirate.org/git/linux-bcache.git/tree/Documentation/bcache.txt +#Block device for caching (e.g. disk or partition): ssddev=/dev/sdb -hdddev=/dev/sdc -sequential_cutoff=24000M -if [ "$EUID" -ne 0 ] - then echo "Please run as root" +#Block device to use with cache: +hdddev=/dev/sdc + +#Cache sequential writes files, no cutoff +#There is an issue with parsing of prefixes, max 4 GB +sequential_cutoff=0 + +if [ "$EUID" -ne 0 ]; then + echo "Please run as root" exit fi -while [ -b /dev/bcache0 ] - then echo "Canceld, device /dev/bcache0 is allready present" +read -p "Block devices $ssddev and $hdddev will be wiped, are you sure proceed?" -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + exit +fi + +while [ -b /dev/bcache0 ]; then + echo "Canceld, device /dev/bcache0 is allready present" exit fi diff --git a/setup_suspend.sh b/setup_suspend.sh new file mode 100644 index 0000000..ab9f309 --- /dev/null +++ b/setup_suspend.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +echo "Not working yet" +exit + +if [ "$EUID" -ne 0 ] + then echo "Please run as root" + exit +fi + +apt-get update && \ +apt-get install -y hibernate uswsusp + +SWAPFILE="/swap.img" +#UUID=$(findmnt -no UUID -T $SWAPFILE) <-- wrong? +swaplabel $SWAPFILE + +OFFSET=$(swap-offset $SWAPFILE) #<---------- remove "resume offset =" + + +if [ $? -eq 0 ]; then + #change swapfile size + swapoff -a && \ + dd if=/dev/zero of=$SWAPFILE bs=1G count=32 && \ + mkswap $SWAPFILE && \ + swapon $SWAPFILE + + #show info + grep SwapTotal /proc/meminfo +fi + + + +#modify /etc/default/grub: +#GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=c081f414-93bf-4f07-8b28-97f8acd3b052 resume_offset=10555392" + +echo "RESUME=UUID=$UUID resume_offset=$OFFSET" > /etc/initramfs-tools/conf.d/resume + +#Apply settings: +update-grub +update-initramfs -u -k all + +#test with: sudo hibernate \ No newline at end of file