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
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist | |
mkdir -p /usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/data/ | |
/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/bin/mysqld --basedir=/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'` --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/lib/plugin --log-error=/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/data/errors.err --pid-file=/usr/local/Cellar/mysql/`brew info mysql | head -n 1 | awk '{print $3}'`/data/pidfile.pid --skip-grant-tables 2>&1 & | |
echo "UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root'; FLUSH PRIVILEGES;" > /tmp/resetroot.sql | |
mysql < /tmp/resetroot.sql |
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 ruby | |
file_names = `git diff-index --cached -Sdebugger --name-only HEAD` | |
file_names += `git diff-index --cached -Ssave_and_open_page --name-only HEAD` | |
file_names = file_names.strip | |
if file_names != "" | |
puts "The following files have 'debugger' or 'save_and_open_page' statements in them: " | |
puts file_names | |
raise "Please remove this stuff prior to committing" | |
end |
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
# shove this in ~/.chef/bootstrap/joyent-smartos.erb | |
# run knife bootstrap <hostname> -d joyent-smartos | |
bash -c ' | |
if [ ! -f /opt/local/bin/chef-client ]; then | |
cd /tmp | |
pkgin install gcc-compiler gcc-runtime gcc-tools-0 ruby19 scmgit-base scmgit-docs gmake sun-jdk6 | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz | |
tar -xzf rubygems-1.8.10.tgz | |
cd rubygems-1.8.10 |
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 | |
# Get all your data bags, save them to disk | |
set -e | |
KNIFE=/usr/bin/knife | |
SAVE_DIR=~/chef-repo/data_bags | |
for bag in `$KNIFE data bag list`; do | |
for item in `$KNIFE data bag show $bag`; do |
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 | |
# Get all your roles, save them to disk. | |
set -e | |
KNIFE=/usr/bin/knife | |
SAVE_DIR=~/chef-repo/roles | |
for role in `$KNIFE role list`; do | |
$KNIFE role show -F json $role > $SAVE_DIR/$role.json; |
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 'chef/knife' | |
class Chef | |
class Knife | |
class RoleCopy < Knife | |
deps do | |
require 'chef/role' | |
require 'chef/json_compat' | |
end |
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
# shove this in ~/.chef/bootstrap/joyent-smartos.erb | |
# run knife bootstrap <hostname> -d joyent-smartos | |
bash -c ' | |
if [ ! -f /opt/local/bin/chef-client ]; then | |
cd /tmp | |
pkgin -y install gcc-compiler gcc-runtime gcc-tools-0 ruby19 scmgit-base scmgit-docs gmake | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz | |
tar -xzf rubygems-1.8.10.tgz | |
cd rubygems-1.8.10 |
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
# -- assuming homebrew is up and running already | |
$ brew install ec2-api-tools | |
# -- get root X509 credentials from the AWS Security Credentials page | |
# -- place pk and cert pem files in $HOME/.ec2 | |
# -- add the following into $HOME/.bash_profile: | |
# export REGION='us-west-1' | |
# export EC2_KEYPAIR="$HOME/.ssh/ec2-$REGION.pem" |
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
URL = "http://www.lumosity.com" | |
MATCH_STRING = "Start Training" | |
INTERVAL = 30 | |
DEBUG = false | |
def log(msg) | |
puts "[#{Time.now}] #{msg}" | |
end | |
def log_response(response) |
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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |
OlderNewer