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 | |
user='root' | |
password='' | |
function usage() { | |
echo "usage: $0 <query-file> <default-database>" | |
exit 1 | |
} |
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 | |
subject='/C=US/ST=California/L=San Francisco/O=Organization/OU=Operations/CN=*.orgdev.net/emailAddress=operations@org.co' | |
subject="${subject}/subjectAltName=DNS.1=orgdev.net,DNS.2=*.orgdev.net,DNS.3=dev.orgdev.net,DNS.4=*.dev.orgdev.net" | |
openssl genrsa -out server.key 2048 | |
openssl req -new -key server.key -sha256 -nodes -subj "$subject" > server.csr | |
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt |
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
# Ideally, run this from a EC2 instance within the same | |
# region as your source and destination buckets | |
apt-get update -y | |
apt-get install -y git openjdk-7-jdk | |
git clone https://github.com/cobbzilla/s3s3mirror.git | |
cd s3s3mirror | |
export AWS_ACCESS_KEY_ID= |
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
## All IPs | |
egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | |
## Find a distinct list of file exts within a specified directory | |
find ./ -type f -name "*.*" -exec basename {} \; | rev | cut -d. -f 1 | sort | uniq | rev | |
## Find files with the supplied exts (linux) | |
find ./ -regextype posix-extended -regex ".*(mp3|mp4|pdf|PDF|doc|zip|ZIP|wav|gz)$" | |
## Find files with supplied exts (mac) |
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 | |
cd /etc/postfix | |
sed -i 's/#relayhost = \[an.ip.add.ress\]/relayhost = [smtp.mailgun.org]:587/g' main.cf | |
echo >> main.cf | |
echo "smtp_sasl_auth_enable = yes" >> main.cf | |
echo "smtp_sasl_password_maps = static:USERNAME:PASSWORD" >> main.cf | |
echo "smtp_sasl_security_options = noanonymous" >> main.cf | |
echo >> main.cf | |
/etc/init.d/postfix restart |
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/php | |
<?php | |
$directory = $argv[1]; | |
$output_column_headings = array( | |
"Config File", | |
"Virtual Host", | |
"ServerName", | |
"DocumentRoot", |
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/local/bin/bash | |
numberOfRequestsValues="10 20 40" | |
concurrencyValues="1 2 4" | |
abCmd="/usr/local/sbin/ab" | |
for url in $(cat $1); do | |
echo "# $url" | |
echo |
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 | |
# This is the snippet that will be added to each file | |
includeGAString="<!--#include virtual=\"/includes/ga.inc\" -->" | |
#includeGAString="<script> | |
# (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
# (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
# m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
# })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
# |
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/php | |
<?php | |
## Constants | |
define('MAILGUN_API_ENDPOINT','https://api.mailgun.net/v3'); | |
define('API_CREDENTIALS_STRING','api:key-'); | |
define('DEFAULT_DOMAIN',''); | |
## Main | |
if($argc != 2){ |
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
for cookbook in $(ls); do | |
knife cookbook metadata from file $cookbook/metadata.rb | |
done | |
for cookbook in $(ls); do | |
echo "Processing cookbook $cookbook" | |
if [ ! -d $cookbook ]; then | |
continue | |
fi | |
deps=$(cat $cookbook/metadata.json | python -c 'import sys, json; print "\n".join(json.load(sys.stdin)["dependencies"].keys())') |