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 json | |
import logging | |
import requests | |
try: | |
from boto.ec2 import connect_to_region as _connect_to_region | |
has_boto = True | |
except ImportError: | |
has_boto = False |
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
<?php | |
$domain = $_GET['domain']; | |
echo "<pre>"; | |
echo `nslookup $domain`; | |
echo "</pre>"; | |
?> |
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
# For http://rosalind.info/problems/subs/ | |
import re | |
import sys | |
string = None | |
substring = None | |
for line in open('rosalind_subs.txt', 'r'): | |
if string is None: |
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 boto.ec2.cloudwatch import CloudWatchConnection | |
from boto.sqs.connection import SQSConnection | |
import boto | |
import sys | |
from datetime import datetime, timedelta | |
import locale | |
from time import sleep | |
if(len(sys.argv) > 1): | |
queue_name = sys.argv[1] |
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
<?php | |
// Clear django_sessions table | |
date_default_timezone_set("UTC"); | |
$link = mysql_connect("localhost", "username", "password") | |
or die("Couldn't connect to MySQL server.\n"); | |
mysql_select_db("database") |
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
1. Paste into /etc/yum.repos.d/puppetlabs.repo | |
[puppetlabs] | |
name=Puppet Labs - $basearch | |
baseurl=http://yum.puppetlabs.com/el/6Server/products/$basearch | |
failovermethod=priority | |
priority=0 | |
enabled=0 | |
2. rpm --import http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs |
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
# Assuming you're in the 'debian' directory and the directories (var, usr, etc.) are contained within | |
find -type f | egrep -v '^\./DEBIAN' | xargs --replace=hh -n1 md5sum "hh" | sed 's/\ \.\///' > DEBIAN/md5sums |
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
if [ `sudo cat /proc/meminfo | grep MemFree | awk '{print $2;}'` -lt "200000" ]; then sudo /etc/init.d/apache2 restart ; fi | |
-- | |
sudo monit summary | grep -i rabbit | grep running ; if [ "$?" -ne "0" ]; then sudo /etc/init.d/rabbitmq-server stop; sudo /etc/init.d/rabbitmq-server start; sudo monit monitor rabbitmq-server; 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
#!/bin/bash | |
# Tested on Ubuntu 8.04 32 bit | |
# When the memory limit drops below $memory_limit megabytes, bash will ring a bell | |
# and echo the current memory usage. | |
# Set the free memory limit (in megabytes) | |
memory_limit=150 | |
# Check interval (in seconds) |
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 | |
# | |
# Logstash Start/Stop logstash | |
# | |
# chkconfig: 345 99 99 | |
# description: Logstash | |
# processname: logstash | |
logstash_bin="java -Djava.net.preferIPv4Stack=true -jar /opt/logstash/logstash-1.0.11pre-monolithic.jar" | |
logstash_log="/opt/logstash/logstash-web.log" |