This script is used to remove old kernels cluttering /boot on Ubuntu systems. The following kernels are preserved:
- The running kernel
- The latest kernel from each major version
| print('\n'.join([('Fizz' if i % 3 == 0 else '') + ('Buzz' if i % 5 == 0 else '') or str(i) for i in range(1,101)])) | 
| #!/usr/bin/python3 | |
| import ipaddr | |
| import os | |
| import socket | |
| import sys | |
| if len(sys.argv) == 1: | |
| print("""Usage: %s <hostname|ip>""" % sys.argv[0]) | |
| sys.exit(1) | 
| #!/bin/bash | |
| max_apache_semaphores=20 | |
| cur_apache_semaphores=$(ipcs -s | grep -c apache) | |
| apachectl=$(which apache2ctl apachectl 2>/dev/null) | |
| [[ ${cur_apache_semaphores} -ge ${max_apache_semaphores} ]] && { | |
| logger -t $(basename $0) "Cleaning up semaphores for apache" | |
| ipcs -s | awk '/apache/ {print $2}' | xargs -n1 ipcrm -s | |
| ${apachectl} restart | 
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| ETH=$(ip -6 r | awk '/^default/ {print $5}') | |
| for IP in $(awk -F '=' '/IPV6ADDR_SECONDARIES/ {gsub("\"",""); gsub("/[0-9]*","/128"); print $2}' /etc/sysconfig/network-scripts/ifcfg-${ETH}) | |
| do | |
| ip addrlabel add prefix ${IP} label 1001 | |
| done | 
| #!/usr/bin/python | |
| import socket | |
| import subprocess | |
| import sys | |
| import tempfile | |
| import urllib2 | |
| url='http://127.0.0.1/server-status?auto' | |
| zabbixhost='zabbix' | 
| #!/usr/bin/python | |
| # | |
| # Author: Rene Diepstraten <[email protected]> | |
| # | |
| send_items=[ | |
| 'wsrep_apply_oooe', | |
| 'wsrep_apply_oool', | |
| 'wsrep_apply_window', | |
| 'wsrep_causal_reads', | 
| [web01] | |
| port=5141 | |
| logfile=/var/log/web01.log | 
| #!/usr/bin/python | |
| # | |
| # Author: Rene Diepstraten <[email protected]> | |
| # | |
| outputfile = "/var/dbcheck/dbcheck.txt" | |
| import MySQLdb, signal, sys | |
| def sigint_handler(signum, frame): |