Skip to content

Instantly share code, notes, and snippets.

View waja's full-sized avatar
🐢
#yoloOps #itscomplicated

waja

🐢
#yoloOps #itscomplicated
View GitHub Profile
@waja
waja / detect_kernel.sh
Last active August 29, 2015 14:08
Deploy kernel check triggered via snmp
#!/bin/sh
KERNEL="$(dpkg -l | grep linux-image | grep ^ii | awk '{print $2}')"
if [ "$(echo ${KERNEL} | wc -l)" -gt "0" ]; then
echo "${KERNEL}" | mail -E -s "Kernel installed on $(hostname -f)" ${1}
fi
@waja
waja / check_running_kernel_mixed_arch
Created October 24, 2014 07:39
Script checking if the running kernel has the same version string as the on-disk kernel image, even for mixed architectures (mixed dom0/domU)
#!/bin/bash
# Check if the running kernel has the same version string as the on-disk
# kernel image.
# Copyright 2008,2009,2011,2012,2013,2014 Peter Palfrader
# Copyright 2009 Stephen Gran
# Copyright 2010,2012,2013 Uli Martens
# Copyright 2011 Alexander Reichle-Schmehl
#
@waja
waja / create_video.sh
Last active August 29, 2015 14:08 — forked from nv1t/create_video.sh
#!/bin/bash
# This is a script to create a video from series of JPEG images
# Call it in a folder full of JPEGs that you want to turn into a video.
# Written on 2013-01-08 by Philipp Klaus <philipp.l.klaus →AT→ web.de>.
# Check <https://gist.github.com/4572552> for newer versions.
# Modified Version from: nv1t (coz of many image files)
# Resources
# * http://www.itforeveryone.co.uk/image-to-video.html

Thanks for visiting this page. I hope that you enjoyed the presentation, and found value in this. Below are a set of resources that will help in learning more about some of the topics I shared, specifically around people and process management.

All links below are sanitized, and have no referral links in which I profit from.

Resources

@waja
waja / free_unused_loop_dev.sh
Last active December 22, 2025 08:09
Remove unused loop devices
#!/bin/sh
for LOOPS in $(losetup -a | awk -F':' {'print $1'} | awk -F'/' {'print $3'}); do
for LOOPPART in $(ls /dev/mapper/${LOOPS}*| awk -F'/' {'print $4'}); do
dmsetup remove ${LOOPPART};
done;
losetup -d /dev/${LOOPS};
done
@waja
waja / migrate_apache22to24.sh
Last active August 29, 2015 14:11
Migrate config from apache2 2.2 to 2.4
#!/bin/sh
# as long as /var/lib/dpkg/info/apache2.postinst has no migration code, we need this script
# for details see http://anonscm.debian.org/cgit/pkg-apache/apache2.git/plain/debian/apache2.NEWS
APACHE2BASEDIR="/tmp/apache2"
# migrate vHost config
for SITECONF in $(ls -l ${APACHE2BASEDIR}/sites-enabled/ | awk {'print $9'} | grep -v ^$ | grep -v ".conf$"); do
echo "Migrating ${SITECONF}"
mv ${APACHE2BASEDIR}/sites-available/${SITECONF} ${APACHE2BASEDIR}/sites-available/${SITECONF}.conf
rm ${APACHE2BASEDIR}/sites-enabled/${SITECONF}
@waja
waja / README.md
Last active December 15, 2021 10:50
Migration from Debian Wheezy to Jessie
@waja
waja / mysqld_multi.patch
Last active August 29, 2015 14:15
Adding mysqld_multi into Debians mysql/mariadb-server
--- /usr/bin/mysqld_multi.orig 2014-10-27 14:10:23.179114498 +0100
+++ /usr/bin/mysqld_multi 2014-10-27 14:11:08.767409171 +0100
@@ -487,6 +487,7 @@
'/usr/my.cnf',
($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef),
$opt{'extra-file'},
+ </etc/mysql/conf.d/*.cnf>,
($ENV{HOME} ? "$ENV{HOME}/.my.cnf" : undef));
}
@waja
waja / node_debian_init.sh
Last active November 11, 2015 12:20 — forked from sgreiner/node_debian_init.sh
Changes in Output and Bugfixes for Debian 7 Wheezy
#!/bin/bash
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@waja
waja / autoupgrade_docker-ce_container.io.sh
Last active September 9, 2026 12:12
Deploy docker on Debian
#!/bin/bash
cat <<EOF > /etc/apt/preferences.d/docker_pinning
Package: docker-ce*
Pin: version 5:29.7.*
Pin-Priority: 1000
Package: containerd.io
Pin: version 2.1*
Pin-Priority: 1000