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 | |
export NODE_ENV=production | |
NAME="ghost-$NODE_ENV" | |
USER="node" | |
APP_ROOT="/var/www/ghost" | |
PID_FILE="/var/www/ghost/$NAME.pid " | |
export PATH=$PATH: |
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 SleepWorker | |
@queue = :low | |
def self.perform(args) | |
sleep 300 | |
end | |
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
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
find . -type f -name "FILE-TO-FIND" -exec rm |
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" |
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
#!/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
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 | |
# 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
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;} |