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
# Setting up a local solr instance on a mac | |
# install solr with homebrew | |
brew install solr | |
# create the base solr index directory | |
mkdir -p /data/solr | |
# make sure you can write to the solr logs | |
sudo chown -R `whoami` /usr/local/Cellar/solr/ |
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
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
# Make sure you have IMAP enabled in your gmail settings. | |
# Right now it won't download same file name twice even if their contents are different. | |
import email | |
import getpass, imaplib | |
import os | |
import sys | |
detach_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
''' quick example showing how to attach a pdf to multipart messages | |
and then send them from SES via boto | |
''' | |
from email.mime.text import MIMEText | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
import boto |
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
__author__ = 'Amal G Jose' | |
import time | |
import logging | |
from boto.emr.connection import EmrConnection | |
from boto.emr.bootstrap_action import BootstrapAction | |
from boto.emr.step import InstallHiveStep | |
from boto.emr.step import InstallPigStep | |
from boto.regioninfo import RegionInfo |
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 | |
# setup ~/.pgpass to allow passwordless connection to postgres | |
# keep last 30 executions for each job | |
KEEP=30 | |
cd /var/lib/rundeck/logs/rundeck | |
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d` |
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 json | |
import boto3 | |
settings = { | |
"aws.cloudsearch.doc": | |
"<doc-ep>", | |
"aws.cloudsearch.search": | |
"<search-ep>" | |
} | |
from avail.aws.cloudsearch import get_cloudsearch_endpoint_from_settings | |
doc = get_cloudsearch_endpoint_from_settings("doc", settings) |
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
sudo amazon-linux-extras install epel -y | |
sudo yum install stress -y |