Skip to content

Instantly share code, notes, and snippets.

# Brands
Icon
http://www.rideicon.com/
Scorpion
http://www.scorpionusa.com/
http://www.scorpionsports.eu/ (helmets only)
Shift
http://shiftracing.com
Alpine Stars
#!/bin/bash
# Config
DATABASES="database1 database2 database3" # names of DBs to back up
PWD="password" # mysql root's password
BACKUPS_DIR="~/backups/daily" # where to
# current date
CURDATE="$(date +'%Y%m%d')"
ssh username@server"mkdir -p $BACKUPS_DIR/$CURDATE/"
Factory.sequence :login do |n|
"user#{n}"
end
Factory.define :user do |user|
user.login { Factory.next(:login) }
user.email { |u| "#{u.login}@nowhere.com" }
user.created_at Time.now
user.password 'foobar'
user.password_confirmation 'foobar'
require 'aasm'
class User < ActiveRecord::Base
acts_as_authentic
acts_as_authorization_subject
include AASM
has_and_belongs_to_many :roles
has_and_belongs_to_many :trackers
check process pokerru-aff-21000 with pidfile /var/www/poker.ru/affiliates/shared/pids/thin.21000.pid
start program = "/usr/bin/env RAILS_ENV=production thin -d -s3 -o21000 -C /var/www/poker.ru/affiliates/current/config/thin/production.yml -R /var/www/poker.ru/affiliates/current/config.ru start" as uid kurumo and gid users with timeout 60 seconds
stop program = "/usr/bin/env RAILS_ENV=production thin -d -s3 -o21000 -C /var/www/poker.ru/affiliates/current/config/thin/production.yml -R /var/www/poker.ru/affiliates/current/config.ru stop" as uid kurumo and gid users
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 200.0 MB for 5 cycles then restart
if loadavg(5min) greater than 10 for 8 cycles then restart
if failed port 21000 then restart
if 3 restarts within 5 cycles then timeout
group pokerru-aff
#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../../config/environment"
$running = true
$working = false
Signal.trap("TERM") do
$stderr.puts "#{Time.now.to_s(:db)}\tGot TERM, exiting..."
$running = false
Processing ClientsController#show (for 93.186.60.190 at 2009-09-01 08:31:13) [GET]
Parameters: {"action"=>"show", "id"=>"183", "controller"=>"clients"}
Rendering template within layouts/application
Rendering clients/show
ActionView::TemplateError (undefined method `edit_array_path' for #<ActionView::Base:0x7f2e030213d0>) on line #9 of app/views/projects/_project.html.haml:
6: .header
7: = progress_bar project.completeness
8:
9: .date= "#{d project.starts_at} - #{d project.ends_at}"
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. static.88-198-60-129.clients.your-server.de 0.0% 494 0.4 0.3 0.3 9.5 0.4
2. hos-tr4.juniper2.rz6.hetzner.de 0.0% 494 0.2 1.3 0.2 50.8 5.6
3. hos-bb2.juniper3.ffm.hetzner.de 0.0% 493 24.1 23.6 22.8 74.4 5.0
4. decix2-hetzner.aixit.net 0.0% 493 13.2 50.3 13.2 485.3 78.9
5. ge-0.de-cix.frnkge03.de.bb.gin.ntt.net 0.0% 493 14.8 14.7 14.0 36.4 1.8
6. p64-2-2-0.r23.amstnl02.nl.bb.gin.ntt.net 0.0% 493 30.2 31.7 30.0 69.4 4.8
7. ae-1.r22.amstnl02.nl.bb.gin.ntt.net 0.0% 493 30.8 32.0 30.0 81.6 5.0
8. xe-3-1.r00.amstnl02.nl.bb.gin.ntt.net 0.2% 493 52.9 47.2 30.0 245.1 43.5
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. 92-48-122-129.static.as29550.net 0.0% 474 0.4 1.4 0.3 38.2 2.7
2. pri.the-bsq3.as29550.net 1.3% 474 1.1 15.3 1.0 398.1 47.4
3. port-channel1.telehouse-east.core.enta.net 0.0% 474 1.1 3.0 1.1 125.2 11.7
4. te5-1.telehouse-east2.core.enta.net 0.0% 473 1.2 4.0 1.1 200.0 14.9
5. te4-1.telehouse-north.core.enta.net 0.0% 473 191.6 8.7 1.1 200.3 31.3
6. te5-3.amsterdam.core.enta.net 0.0% 473 9.4 10.6 9.4 150.4 10.7
7. 10ge-3-3-0.br1.ams.we-dare.net 0.0% 473 9.4 10.6 9.4 91.0 4.5
8. ge-1-1-0.cr1.rtd.we-dare.net 0.2% 473 11.0 12.6 10.8 305.9 19.2
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. static.88-198-60-129.clients.your-server.de 0.0% 418 0.3 0.3 0.3 6.1 0.3
2. hos-tr4.juniper2.rz6.hetzner.de 0.0% 418 0.4 1.1 0.2 37.8 4.9
3. hos-bb2.juniper3.ffm.hetzner.de 0.0% 418 22.9 24.1 22.8 77.1 6.6
4. decix2-hetzner.aixit.net 0.0% 417 90.5 39.1 13.2 524.3 65.5
5. ge-0.de-cix.frnkge03.de.bb.gin.ntt.net 0.0% 417 14.5 14.6 13.9 23.6 0.8
6. xe-1-0-0.r20.frnkge03.de.bb.gin.ntt.net 0.0% 417 14.7 23.5 14.3 74.0 9.0
p64-2-2-0.r23.amstnl02.nl.bb.gin.ntt.net
7. p16-0-0-0.r00.frnkge02.de.bb.gin.ntt.net 0.0% 417 30.7 24.7 14.7 84.5 10.7