This file contains 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 | |
# Nagios plugin to check if a machine has packages that apt can autoremove | |
# Author: John Slade (http://jtes.net) | |
AUTOREM_OUTPUT=$(apt-get --dry-run autoremove) | |
TO_REMOVE=$(echo $AUTOREM_OUTPUT | perl -pe 's/^.*?, (\d*) to remove.*$/$1 to remove/g') | |
if echo $AUTOREM_OUTPUT | grep -q "0 to remove"; then | |
# no pacakges to remove (0=OK) |
This file contains 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 | |
# Nagios plugin to check if a machine needs to be rebooted after run apt | |
# Original source http://serverfault.com/a/268528/41649 | |
if [ ! -f /var/run/reboot-required ]; then | |
# no reboot required (0=OK) | |
echo "OK: no reboot required" | |
exit 0 | |
else |
This file contains 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/sh | |
curl https://raw.githubusercontent.com/dconnolly/chromecast-backgrounds/master/README.md | sed -e "s/^\!\[\](//g" | sed -e "s/)$//g" > urls.txt | |
cat urls.txt | parallel --gnu -n 1 wget -nc -P out |
This file contains 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
import os, sys, time | |
import apsw | |
import psutil | |
class PortsSource(object): | |
""" List of ports """ | |
def Create(self, db, modulename, dbname, tablename, *args): | |
columns = ['pid', 'name', 'username'] | |
data = [] |
This file contains 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
alert('yay'); |