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
#!/usr/bin/python | |
# Created by Alan M. Orther - alan.orther@gmail.com | |
# This script is used to monitor a server's load and email an alert if the | |
# threshold is met or exceeded over a 3 minute average. | |
import os | |
import sys | |
import getopt | |
import multiprocessing | |
from time import sleep |
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 | |
DATE=$(date) | |
MYSQL_QUERY1="SELECT COUNT(DISTINCT(nodeId)) AS 'Unreachable Nodes' FROM Alarm WHERE firstOccurrence BETWEEN NOW() - INTERVAL 14 DAY AND NOW() AND additionalInfo LIKE '%Timeout%' AND clearedDate IS NULL;" | |
MYSQL_QUERY2="SELECT COUNT(DISTINCT(nodeId)) AS 'Unreachable AMI 1.0 Nodes' FROM Alarm WHERE additionalInfo LIKE '%Smart Meter 1.0%' AND id IN (SELECT id AS 'Unreachable Nodes' FROM Alarm WHERE firstOccurrence BETWEEN NOW() - INTERVAL 14 DAY AND NOW() AND additionalInfo LIKE '%Timeout%' AND clearedDate IS NULL);" | |
MYSQL_QUERY3="SELECT COUNT(DISTINCT(nodeId)) AS 'Unreachable AMI 1.1 Nodes' FROM Alarm WHERE additionalInfo LIKE '%Smart Meter 1.1%' AND id IN (SELECT id AS 'Unreachable Nodes' FROM Alarm WHERE firstOccurrence BETWEEN NOW() - INTERVAL 14 DAY AND NOW() AND additionalInfo LIKE '%Timeout%' AND clearedDate IS NULL);" |
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
#!/usr/bin/python | |
# Created by Alan M. Orther - alan.orther@gmail.com | |
# This script is used to loops through nodes and send an over-the-air command. | |
import os | |
import time | |
# Create /tmp/ota_tools_logs/ directory if it does not already exist. | |
otatools_dir = "/tmp/ota_tools_logs/" | |
otatools_dir = os.path.expanduser(otatools_dir) |
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
#!/usr/bin/python | |
# Created by Alan M. Orther - alan.orther@ingenu.com | |
# This script is used to find the AMI 1.0 devices that are not switching from | |
# App Type 10 to App Type 30 when upgrading from AMI 1.0 to AMI 1.2. | |
# The script will create a directory called /aotools in the user's home | |
# directory and read the current bus log for specific errors. The script will | |
# then copy the grepped log to the /aotools directory and show a list of the | |
# nodes that have the error in decimal and hex form. It will also provide a | |
# count of nodes and duplicates. I will generally use this script around 45 | |
# minutes into the hour to provide time to make the DB changes before the |
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
#!/usr/bin/python | |
# Created by Alan M. Orther - alan.orther@gmail.com | |
# This script is used to duplicate a Wordpress website and DB. | |
import os | |
import random | |
# Variables | |
website_url = "" | |
website_url_dir = "" |
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
#!/usr/bin/python | |
# Created by Alan M. Orther - alan.orther@gmail.com | |
# Used to convert decimal into hexadecimal and vice versa from a file. Can also | |
# be used to create a comma separated list from a file with line separated | |
# values. | |
from sys import argv | |
from collections import Counter | |
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 | |
sleep 1 | |
sed -i'' "$FIRST_LINE,$LAST_LINE s/^/#/" /root/Dropbox/PSA_All_Check |
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 | |
export FIRST_LINE=0 | |
export LAST_LINE=0 | |
if curl http://palmettostatearmory.com/index.php/ar-10/ar-10-lower-parts/psa-pa10-act-lower-parts-kit.html | grep "TEMPORARILY OUT OF STOCK" > /dev/null | |
then echo "$(date) - Palmetto ACT Lower Parts Kits - IT IS IN STOCK!!!!" | tee --append /var/log/PSA_log.txt | |
/usr/bin/mail -s "$(date) - ACT Lower Parts Kits!!" 7603905242@txt.att.net <<< "Palmetto ACT Lower Parts Kits are OUT OF STOCK!" | |
export FIRST_LINE=12 |
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 | |
sleep 1 | |
sed -i'' "$FIRST_LINE,$LAST_LINE s/^/#/" /root/Dropbox/PSA_All_Check | |
sleep 2 | |
export FIRST_LINE=0 | |
export LAST_LINE=0 |
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
def b_test_q(): | |
global input_1, input_2, input_3 | |
print "Input 1: " | |
input_1 = raw_input("=> ").capitalize() | |
print "'==' or '!='." | |
input_2 = raw_input("=> ").capitalize() | |
print "Input 2: " | |
input_3 = raw_input("=> ").capitalize() | |
if input_1 or input_2 or input_3 == "Q": | |
print input_1 + " " + input_2 + " " + input_3 |
NewerOlder