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 datetime | |
import os | |
from datadog import initialize, api | |
options = { | |
'api_key': os.getenv('DD_API_KEY'), |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Server layout: | |
~/www/ | |
This folder contains the code, python environment, and logs | |
for each environment (staging, production, etc) running on the server. | |
Each environment has its own subfolder named for its evironment | |
(i.e. ~/www/staging/log and ~/www/production/log). |
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/sh | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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/sh | |
# -- | |
# Checks supervisorctl for programs that are not in the state of RUNNING. | |
# That is to say STOPPED, STARTING, BACKOFF, STOPPING, EXITED, FATAL, UNKNOWN | |
# | |
# | |
# @author: Steve Lippert | [email protected] | Management Research Services, Inc. | |
# @version: 0.1 | |
# @date: 2011/03/03 (YMD) | |
# -- |
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
# | |
# /etc/snmp/snmpd.conf | |
# | |
# gives read-only access to nagios_server using secname, secgroup | |
# | |
# sec.name source community | |
com2sec localhost 127.0.0.1 public | |
com2sec nagios MONITOR public | |
# groupName securityModel securityName |
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
# | |
# /etc/nrpe.d/nrpe.local.cfg | |
# | |
# allows nagios_server to connect to NRPE and adds additional commands | |
# | |
# | |
allowed_hosts=MONITOR | |
command[check_yum]=/usr/lib64/nagios/plugins/check_yum | |
command[check_pgsql]=/usr/lib64/nagios/plugins/check_pgsql | |
command[check_mysql]=/usr/lib64/nagios/plugins/check_mysql -u nrpe |
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 | |
USER=matos | |
APP=$USER | |
DIR=/var/www/$APP | |
REPO=https://github.com/javierwilson/$APP | |
mkdir $DIR | |
find $DIR -name "*.pyc"|xargs rm | |
git clone $REPO $DIR |
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
from askbot.models import User | |
users = User.objects.filter(askbot_profile__reputation=1) | |
for u in users: | |
print u | |
profile = u.askbot_profile | |
profile.reputation = 100 | |
profile.save() |
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
import glob | |
from lxml.html import parse | |
poll_files = glob.glob("*.html") | |
for poll_file in poll_files: | |
poll = poll_file[0:poll_file.index('.')] | |
names = poll.split(',',2) | |
page = parse(poll_file) | |
trs = page.xpath("body/div/div//div/table")[0].findall("tr") |