All gists

waja
Last active 5 months ago
0 0 1
1 #!/bin/bash
2 # Creating some temp dir
3 TMPDIR=$(mktemp -d /tmp/d.XXXXXX) && \
4 trap 'rm -rf "${TMPDIR}"' EXIT && \
5 # Install lazydocker
6 LAZYDOCKER_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com/jesseduffield/lazydocker/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') && \
7 GITHUB_FILE="lazydocker_${LAZYDOCKER_VERSION//v/}_$(uname -s)_$(uname -m).tar.gz" && \
8 GITHUB_URL="https://github.com/jesseduffield/lazydocker/releases/download/${LAZYDOCKER_VERSION}/${GITHUB_FILE}" && \
9 curl -o ${TMPDIR}/lazydocker.tar.gz -L ${GITHUB_URL} && \
10 tar xzvf ${TMPDIR}/lazydocker.tar.gz -C ${TMPDIR} && \
waja
Last active 5 months ago
0 0 1
1 #!/bin/bash
2 # wget https://gist.githubusercontent.com/waja/77e3d2febb0745478466344f0ce5a50e/raw/deploy_phpmyadmin_buster.sh -O /tmp/a && sh /tmp/a
3 # taken from https://github.com/phpmyadmin/phpmyadmin/issues/15236#issuecomment-507871960
4 [ $(grep buster-backports /etc/apt/sources.list.d/* | wc -l) -le 0 ] && cat <<EOF >> /etc/apt/sources.list.d/buster-backports.list
5 #
6 # Debian backports
7 #
8
9 deb http://ftp.de.debian.org/debian/ buster-backports main non-free contrib
10 deb-src http://ftp.de.debian.org/debian/ buster-backports main non-free contrib
waja
Last active 5 months ago
0 0 1
1 # Install needed packages
2 apt install bridge-utils xen-system-amd64 grub-xen-host xen-tools lvm2
3 # Reduce dom0 memory
4 sed -i s/#GRUB_CMDLINE_XEN=\"\"/GRUB_CMDLINE_XEN=\"dom0_mem=1024M\"/ /etc/default/grub.d/xen.cfg && update-grub
5 # Don't touch iptables when creating te bridge interface
6 cp /etc/xen/scripts/vif-bridge /etc/xen/scripts/vif-bridge-local && \
7 sed -i s/^handle_iptable/#handle_iptable/g /etc/xen/scripts/vif-bridge-local && \
8 sed -i s/#vif.default.script=\"vif-bridge\"/vif.default.script=\"vif-bridge-local\"/g /etc/xen/xl.conf
9 # Disable saving and restoring domains
10 sed -i s/XENDOMAINS_RESTORE=true/XENDOMAINS_RESTORE=false/ /etc/default/xendomains
waja
Last active 5 months ago
0 0 1
1 #!/bin/bash
2 # wget https://gist.githubusercontent.com/waja/0deb4dd5cd759371270dc3e1f5dabcb5/raw/deploy_rootlessdocker.sh -O /tmp/a && sh /tmp/a
3
4 # Check if dockerd is installed
5 [ $(which dockerd) ] || wget https://gist.githubusercontent.com/waja/01ba2641f93f461044f9/raw/docker_deploy.sh \
6 -O /tmp/docker_deploy.sh && bash /tmp/docker_deploy.sh
7
8 # Stop and disable dockerd (runs as root)
9 systemctl stop docker && systemctl disable docker && systemctl disable docker.socket
waja
Last active 5 months ago
0 0 1
1 # Crossgrade jessie over to amd64 along https://stbuehler.de/blog/article/2017/06/28/debian_stretch__upgrade_32-bit_to_64-bit.html,
2 # but on jessie downloading the correct packages is a bit more complicated
3
4 aptitude search ~M | cut -c5- | cut -d' ' -f1 > aptitude.auto
5 dpkg -l | grep '^ii' | awk '{print $2}' > packages
6 dpkg --print-architecture
7 dpkg --print-foreign-architectures
8 dpkg --add-architecture amd64
9 apt-get update
waja
Last active 5 months ago
0 0 1
1 #!/bin/bash
2 # wget https://gist.githubusercontent.com/waja/cb6c427543b9dbea4c775ccfb1f308ab/raw/fix_cert_addtrust_external_expiration_apache.sh -O /tmp/a && bash /tmp/a && apache2ctl -t && service apache2 reload
3 TMPFILE=$(mktemp)
4 trap "{ rm -rf ${TMPFILE}; }" EXIT
5 for CERT in $(grep -P "^( |\t)*SSLCertificateFile" /etc/apache2/sites-enabled/* | awk '{print $3}'); do
6 if [ \( "$(openssl x509 -in ${CERT} -issuer | head -1 | cut -d"=" -f7 | sed 's/^ *//g')" == "Sectigo RSA Domain Validation Secure Server CA" -o "$(openssl x509 -in ${CERT} -issuer | head -1 | cut -d"=" -f7 | sed 's/^ *//g')" == "COMODO RSA Domain Validation Secure Server CA" \) -a ! -L ${CERT} ]; then
7 echo "${CERT}:"
8 openssl crl2pkcs7 -nocrl -certfile ${CERT} | openssl pkcs7 -print_certs > ${TMPFILE}
9 for CA in 'COMODO RSA Certification Authority' 'USERTrust RSA Certification Authority' 'AddTrust External CA Root'; do
10 sed -i "/^subject.*${CA}/q" ${TMPFILE}
waja
Last active 5 months ago
0 0 1
1 if [ -f /etc/apt/apt.conf.d/00InstallRecommends ]; then
2 # remove any existing value from file
3 sed -i '/^APT::Install-Recommends/d' /etc/apt/apt.conf.d/00InstallRecommends;
4 sed -i '/^Aptitude::Recommends-Important/d' /etc/apt/apt.conf.d/00InstallRecommends;
5 # set the value
6 echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/00InstallRecommends && \
7 echo 'Aptitude::Recommends-Important "False";' >> /etc/apt/apt.conf.d/00InstallRecommends && \
8 echo "* Disabled automatical installation of recommended packages"
9 else
10 # set the value (and create a new file)