Go through this amazon link http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html
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/env python | |
import sys, os, shutil | |
# Check to see what entities are in the file system and categorize them by | |
# type. | |
def analyze_path(path): | |
"""Get the file system entries in a path and categorize them.""" |
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
# -*- coding: utf-8 -*- | |
""" | |
sphinx.builders.mobi | |
~~~~~~~~~~~~~~~~~~~~ | |
Build mobi files. | |
Originally derived from epub.py. | |
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. | |
:license: BSD, see LICENSE for details. |
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/env python | |
import sys | |
import re | |
def camel2snake(text, sep=r'_'): | |
"""Convert *text* from CamelCase (or camelCase) into snake_case.""" | |
rebounds = [r'([a-z])([A-Z])', r'([A-Z])([A-Z])'] | |
underscored_text = str(text) | |
for b in rebounds: | |
underscored_text = re.sub(b, (r'\g<1>'+ sep + r'\g<2>'), underscored_text) |
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
require 'aws-sdk' | |
require 'yaml' | |
CONFIG_FILE_NAME = 'aws-config.txt' | |
def do_confirm(phrase) | |
print "#{phrase} (Y/N): " | |
# you *must* use $stdin with gets if you have command-line arguments. | |
# Otherwise, gets receives streaming input and doesn't wait for the terminal. | |
a = $stdin.gets.strip.downcase |
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
# List the S3 buckets that are available for the user identified by either | |
# `aws-config.txt` or in the environment. | |
require 'aws-sdk' | |
require 'yaml' | |
CONFIG_FILE_NAME = 'aws-config.txt' | |
# Load aws-config.txt to see if there are AWS credentials there. | |
# | |
# We're expecting a YAML-formatted file like this: |
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
require 'json' | |
require 'xmlsimple' | |
json_file, xml_file = ARGV | |
json_text = nil | |
unless json_file.nil? | |
if File.exist?(json_file) | |
json_text = File.new(json_file, 'r').read |
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
require 'json' | |
require 'yaml' | |
json_file, yaml_file = ARGV | |
json_text = nil | |
unless json_file.nil? | |
if File.exist?(json_file) | |
json_text = File.new(json_file, 'r').read |
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
# Clean JSON. Takes messy JSON and makes it much nicer looking. | |
# | |
# Usage: | |
# | |
# ruby cleanjson.rb <infile> <outfile> | |
# | |
# Reads the JSON-formatted text in <infile> and outputs the cleaned JSON to | |
# <outfile>. | |
# | |
# Both arguments are optional, but you cannot specify an <outfile> without |
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
# check for an update on a web-page, and email the user | |
import httplib | |
import sys | |
import pickle | |
from datetime import datetime | |
import smtplib | |
from email.mime.text import MIMEText | |
import yaml | |
def email_user(cur_data, email_from, email_to): |
NewerOlder