This file contains hidden or 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
class EventController | |
... | |
def index | |
@month = current_month | |
@year = current_year | |
if @month == 1 | |
@previous_month = 12 | |
@previous_year = @year - 1 | |
This file contains hidden or 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
module EventsHelper | |
def previous_month(month) | |
if month == 1 | |
12 | |
else | |
month - 1 | |
end | |
end | |
def previous_year(month, year) |
This file contains hidden or 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 2; # Usually number of processors | |
error_log logs/error.log; | |
events { | |
worker_connections 2024; | |
} | |
http { |
This file contains hidden or 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 | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
This file contains hidden or 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
# Redis configuration file example | |
# By default Redis does not run as a daemon. Use 'yes' if you need it. | |
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. | |
daemonize yes | |
# When run as a daemon, Redis write a pid file in /var/run/redis.pid by default. | |
# You can specify a custom pid file location here. | |
pidfile /var/run/redis.pid |
This file contains hidden or 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
# Put this content to ~/.irbrc file (no extension) | |
require "rubygems" | |
begin | |
require "ap" | |
rescue LoadError => err | |
puts "Cannot find awesome_print gem. Please run 'gem install awesome_print' to install it." | |
end |
This file contains hidden or 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 | |
######################################################################### | |
# # | |
# MySQL performance tuning primer script # | |
# Writen by: Matthew Montgomery <[email protected]> # | |
# Inspired by: MySQLARd (http://gert.sos.be/demo/mysqlar/) # | |
# Version: 1.5-r5 Released: 2009-11-22 # | |
# Licenced under GPLv2 # | |
# # |
This file contains hidden or 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
# Amazon Simple Email Service Quota monitor | |
# Monitors the maximum number of emails you can send in a 24 hour period and actual sent emails. | |
class SesQuotaPlugin < Scout::Plugin | |
needs 'aws/ses' | |
OPTIONS=<<-EOS | |
awskey: | |
name: AWS Access Key | |
notes: Your Amazon Web Services Access key. 20-char alphanumeric, looks like 022QF06E7MXBSH9DHM02 |
This file contains hidden or 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
# Amazon Simple Email Service Statistics (http://aws.amazon.com/ses/) | |
# Displays Amazon SES automatically collected statistics regarding your sending activity: | |
# * Successful delivery attempts | |
# * Rejected messages | |
# * Bounces | |
# * Complaints | |
class SesStatisticsPlugin < Scout::Plugin | |
needs 'aws/ses' |
This file contains hidden or 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
# EC2 Http servers health status | |
# * Number of running instances | |
# * Average response time | |
class Ec2HttpHealth < Scout::Plugin | |
needs 'right_aws' | |
needs 'timeout' | |
OPTIONS=<<-EOS | |
access_key_id: |
OlderNewer