Skip to content

Instantly share code, notes, and snippets.

@Zoidwaffle
Zoidwaffle / update-trinitycore.sh
Created February 25, 2012 22:37
Attempts to make it easy to maintain an updated TrinityCore server on a Linux system
#!/bin/bash
########################################################################################
# Purpose : Updates TrinityCore
#######################################################################################
# Home for the trinity/server user (suggested user "trinity")
HOME="/home/trinity"
# Location of the ACE library, "/usr/lib" is default for system wide installation
LIBACE="/usr/lib"
@burinov
burinov / gist:1760784
Created February 7, 2012 17:11
Network Tuning & Monitoring
# All these tools are good to see traffic in real time
$ sudo iftop
$ bmon
$ sudo iptraf
# Show number of established connections
$ netstat -n | awk '/^tcp/ {t[$NF]++}END{for(state in t){print state, t[state]} }'
$ netstat -n | grep 5222 | awk '/^tcp/ {t[$NF]++}END{for(state in t){print state, t[state]} }'
$ netstat -ant | grep 5222 | awk '{print $6}' | sort | uniq -c | sort -n
@yetanothernguyen
yetanothernguyen / gist:1196492
Created September 6, 2011 03:11
unicorn init script
#!/bin/bash
### BEGIN INIT INFO
# Provides: says-dot-com-production
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the says-dot-com-production unicorns at boot
# Description: Enable says-dot-com-staging at boot time.
### END INIT INFO
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@nragaz
nragaz / all.god
Created July 12, 2010 03:16
God configs for starting Resque and Unicorn
PID_DIR = '/srv/myapp/shared/pids'
RAILS_ENV = ENV['RAILS_ENV'] = 'production'
RAILS_ROOT = ENV['RAILS_ROOT'] = '/srv/myapp/current'
BIN_PATH = "/home/rails/.rvm/gems/ree-1.8.7-2010.02/bin"
God.log_file = "#{RAILS_ROOT}/log/god.log"
God.log_level = :info
%w(unicorn resque).each do |config|
God.load "#{RAILS_ROOT}/config/god/#{config}.god"
#!/usr/bin/env ruby
def find_deps(cookbook_dir)
nel = Hash.new { |h, k| h[k] = [] }
Dir.glob("#{cookbook_dir}/*/").each do |r|
deps_for(r, nel)
end
nel
end