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
class BasePresenter | |
def initialize(object, template) | |
@object = object | |
@template = template | |
end | |
private | |
def self.presents(name) | |
define_method(name) 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
#!/usr/bin/env ruby | |
# == Synopsis | |
# This is a sample description of the application. | |
# Blah blah blah. | |
# | |
# == Examples | |
# This command does blah blah blah. | |
# ruby_cl_skeleton foo.txt | |
# |
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 'date' | |
require 'redis' | |
require 'net/smtp' | |
require 'resque' | |
require 'resque/version' | |
class App | |
VERSION = '0.0.1' | |
def initialize |
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
$LocalHostName myhost | |
# load module to read from local files | |
$ModLoad imfile | |
# for each local log file path, duplicate the 6 lines below and edit lines 2-4 | |
$RuleSet sendtoci # use a non-default ruleset (keeps logs out of /var/log/) | |
$InputFileName /var/www/app/shared/log/production.log | |
$InputFileTag unicorn: | |
$InputFileStateFile sendtoci-unicorn |
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
function tab-red() { tab-color 203 111 111; } | |
function tab-green() { tab-color 6cc276; } | |
function tab-yellow() { tab-color "#e8e9ac"; } | |
function tab-blue() { tab-color 6f8ccc; } | |
function tab-purple() { tab-color a789d4; } | |
function tab-orange() { tab-color fbbc79; } | |
function tab-white() { tab-color fff; } | |
function tab-gray() { tab-color c3c3c3c; } | |
tg() {tab-blue; ssh $1.europe-west1-b.MYPROJECT -t sudo tmux attach -t main;} |
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 | |
# http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/ | |
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288 | |
mkswap /swapfile1 | |
chmod 0600 /swapfile1 | |
echo '/swapfile1 swap swap defaults 0 0' >> /etc/fstab | |
#swapon -a |
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
echo "Europe/Paris" > /etc/timezone | |
dpkg-reconfigure -f noninteractive tzdata |
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 | |
cp /etc/sysctl.conf /etc/sysctl.conf.20140808 | |
echo 'fs.file-max = 64000'>>/etc/sysctl.conf | |
echo 'root soft nofile 64000'>>/etc/security/limits.conf | |
echo 'root hard nofile 64000'>>/etc/security/limits.conf | |
# echo 'mongodb soft nofile 64000'>>/etc/security/limits.conf | |
# echo 'mongodb hard nofile 64000'>>/etc/security/limits.conf | |
sysctl -p |
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
redis = Redis.new(:host => 'xxxxx', :port => xxxxx, :password => 'xxxxxx', :thread_safe => true) | |
redis.llen("sidekiq:xxxxxxx:failed") | |
10.times {redis.lpop("sidekiq:xxxxxxx:failed")} |
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 process unicorn_production with pidfile /var/www/az_app_2_production/shared/pids/unicorn.pid | |
if totalmem > 2.6 GB for 5 cycles then restart | |
start = "/etc/az-scripts/unicorn_production.sh start" with timeout 90 seconds | |
stop = "/etc/az-scripts/unicorn_production.sh stop" |
OlderNewer