Head over to https://github.com/waja/debian-update-cheatsheets/blob/stretch2buster/stretch2buster.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# wget https://gist.githubusercontent.com/waja/0deb4dd5cd759371270dc3e1f5dabcb5/raw/deploy_rootlessdocker.sh -O /tmp/a && sh /tmp/a | |
# Check if dockerd is installed | |
[ $(which dockerd) ] || wget https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/docker_deploy.sh \ | |
-O /tmp/docker_deploy.sh && bash /tmp/docker_deploy.sh | |
# Stop and disable dockerd (runs as root) | |
systemctl stop docker && systemctl disable docker && systemctl disable docker.socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Crossgrade jessie over to amd64 along https://stbuehler.de/blog/article/2017/06/28/debian_stretch__upgrade_32-bit_to_64-bit.html, | |
# but on jessie downloading the correct packages is a bit more complicated | |
aptitude search ~M | cut -c5- | cut -d' ' -f1 > aptitude.auto | |
dpkg -l | grep '^ii' | awk '{print $2}' > packages | |
dpkg --print-architecture | |
dpkg --print-foreign-architectures | |
dpkg --add-architecture amd64 | |
apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install needed packages | |
apt install bridge-utils xen-system-amd64 grub-xen-host xen-tools lvm2 | |
# Reduce dom0 memory | |
sed -i s/#GRUB_CMDLINE_XEN=\"\"/GRUB_CMDLINE_XEN=\"dom0_mem=1024M\"/ /etc/default/grub.d/xen.cfg && update-grub | |
# Don't touch iptables when creating te bridge interface | |
cp /etc/xen/scripts/vif-bridge /etc/xen/scripts/vif-bridge-local && \ | |
sed -i s/^handle_iptable/#handle_iptable/g /etc/xen/scripts/vif-bridge-local && \ | |
sed -i s/#vif.default.script=\"vif-bridge\"/vif.default.script=\"vif-bridge-local\"/g /etc/xen/xl.conf | |
# Disable saving and restoring domains | |
sed -i s/XENDOMAINS_RESTORE=true/XENDOMAINS_RESTORE=false/ /etc/default/xendomains |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# wget https://gist.githubusercontent.com/waja/77e3d2febb0745478466344f0ce5a50e/raw/deploy_phpmyadmin_buster.sh -O /tmp/a && sh /tmp/a | |
# taken from https://github.com/phpmyadmin/phpmyadmin/issues/15236#issuecomment-507871960 | |
[ $(grep buster-backports /etc/apt/sources.list.d/* | wc -l) -le 0 ] && cat <<EOF >> /etc/apt/sources.list.d/buster-backports.list | |
# | |
# Debian backports | |
# | |
deb http://ftp.de.debian.org/debian/ buster-backports main non-free contrib | |
deb-src http://ftp.de.debian.org/debian/ buster-backports main non-free contrib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Creating some temp dir | |
TMPDIR=$(mktemp -d /tmp/d.XXXXXX) && \ | |
trap 'rm -rf "${TMPDIR}"' EXIT && \ | |
# Install lazydocker | |
LAZYDOCKER_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com/jesseduffield/lazydocker/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') && \ | |
GITHUB_FILE="lazydocker_${LAZYDOCKER_VERSION//v/}_$(uname -s)_$(uname -m).tar.gz" && \ | |
GITHUB_URL="https://github.com/jesseduffield/lazydocker/releases/download/${LAZYDOCKER_VERSION}/${GITHUB_FILE}" && \ | |
curl -o ${TMPDIR}/lazydocker.tar.gz -L ${GITHUB_URL} && \ | |
tar xzvf ${TMPDIR}/lazydocker.tar.gz -C ${TMPDIR} && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -r /opt/etc/default/backuppc-achive-rclone ]; then | |
source /opt/etc/default/backuppc-achive-rclone | |
else | |
source /etc/default/backuppc-achive-rclone | |
fi | |
if [ -r /opt/etc/backuppc-achive-rclone.conf ]; then | |
source /opt/etc/backuppc-achive-rclone.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATE="$(date +%d)" | |
psql_user="postgres" | |
psql_host="/var/run/postgresql/" | |
psql_port="5432" | |
[ -f /opt/gitlab/etc/gitlab-psql-rc ] && . /opt/gitlab/etc/gitlab-psql-rc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# disable jessie-updates in /etc/apt/sources.list | |
sed -i 's/\(.*jessie\-updates\)/#\1/' /etc/apt/sources.list | |
# disable jessie-backports, it's deprecated | |
sed -i 's/\(.*jessie\-backports\)/#\1/' /etc/apt/sources.list.d/jessie-backports.list | |
apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DOCKER_BASE=/srv/docker | |
mkdir -p ${DOCKER_BASE}/portainer/container.conf | |
cat > ${DOCKER_BASE}/portainer/container.conf/docker-compose.yml <<EOF | |
version: '3.7' | |
services: | |
portainer: | |
image: portainer/portainer |