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 bash | |
# Drop this file somewhere in your path and give execute perms. Usage: | |
# | |
# $ tping <hostname> | |
ping $1 | while read pong; do echo "$(date): $pong"; done |
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 | |
RHOST='user@hostname' | |
LPATH='/var/www/app-directory/' | |
DBPATH='/home/user/appbackup/app-name/db/' | |
SHAREPATH='/home/user/appbackup/app-name/shared/' | |
DBNAME='database_name' | |
DBUSER='database_user' | |
DBPASS='database_password' |
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
desc "The default task; lists tasks" | |
task :default do | |
puts `rake --tasks` | |
end | |
desc "Go ahead, you deserve it" | |
task :endulge do | |
puts "You're great. You really are." | |
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
[mysqld] | |
# Slow query logging | |
log_slow_queries = /var/log/mysql/mysql-slow.log | |
long_query_time = 2 | |
log-queries-not-using-indexes | |
# Binary logging/replication; requires CUSTOMIZATION after auto-build! | |
#server-id = 1 # required for master/slave replication | |
log_bin = /var/log/mysql/mysql-bin.log |
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 -wKU | |
rvm_result = `source "$HOME/.rvm/scripts/rvm" && rvm use ruby-1.9.3-p0@log-examiner` | |
puts rvm_result | |
require 'date' | |
# Example: ./report_day.rb production.log 2012-02-18 | |
class App |
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 -wKU | |
require 'csv' | |
# Usage: This script accepts filenames as arguments. The script expects the files | |
# passed to be the output of the CDRTool CSV export feature. The script is written | |
# to be as "unixy" as possible. Output is written to the stdout (and can be | |
# redirected). Status and errors are written to stderr. Output contains four | |
# columns in tab-separated value format: | |
# |
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 | |
# Bash shell script for generating self-signed certs. Run this in a folder, as it | |
# generates a few files. Large portions of this script were taken from the | |
# following artcile: | |
# | |
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html | |
# | |
# Additional alterations by: Brad Landers | |
# Date: 2012-01-27 |
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 -wKU | |
class DataAnalyzer | |
def initialize | |
# Check for Ruby 1.9 | |
unless RUBY_VERSION.scan('1.9').length > 0 | |
puts "This script reqires Ruby 1.9 (specifically, ordered hashes). Sorry! Check out RVM or rbenv for easy management of Ruby versions." | |
exit 1 | |
end | |
# We must have at least one file to process |
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 -wKU | |
require 'csv' | |
$: << File.expand_path(__FILE__) | |
# Compares the output of `show variables;` run in the CLI mysql client. The | |
# script expects the output of this query executed with the `--tables` flag. | |
# Output is written to the STDOUT, so you'll need to use standard shell | |
# redirection. Output format is CSV. Example usage: |
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
def collect_mysql_variables | |
@data.values.collect { |value| value.key }.uniq! | |
end |