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 | |
IP=$(curl -s ifconfig.me) | |
LAST_IP=$(cat /tmp/myip ) | |
if [ "$IP" = "$LAST_IP" ] | |
then exit 0 | |
else echo $IP > /tmp/myip ; echo $IP | mail -s "Valid IP for host XPTO" [email protected] | |
fi |
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
#!/usr/bin/env python | |
import urllib2 | |
import subprocess | |
import commands | |
debug = 1 | |
def open_url(url): | |
try: |
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
#Setting atual date | |
echo $(date +%d/%m/%Y-%H:%M) | |
#One year and month ago in Unix Timestamp | |
ONE_YEAR_AGO=$(expr `date +%s` - 31536000) | |
ONE_MONTH_AGO=$(expr `date +%s` - 2678400) | |
#Queries for one month ago | |
MONTH_TABLES="history history_uint history_str history_text history_log" | |
for table in $MONTH_TABLES |
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
#!/usr/bin/perl | |
$first = 1; | |
print "{\n"; | |
print "\t\"data\":[\n\n"; | |
#Need fix here. Proc Partitions to rescue | |
for (`/usr/bin/iostat -d 1 1 | grep -v Device | grep -v Linux| awk '{print \$1}' | sed '/^\$/d' `) | |
{ | |
chomp $_ ; | |
print "\t,\n" if not $first; | |
$first = 0; |
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
#!/usr/bin/env python | |
import os | |
import sys | |
root_dir = str(sys.argv[1]) | |
total = 0 | |
def look_dirs(root_dir): | |
dir_list = [] |
NewerOlder