Hay un montón de cambios para hacer, cosas por mejorar, etc, pero básicamente anda :)
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
# OpenVZ lower memory utilization, according to | |
# http://wiki.openvz.org/UBC_systemwide_configuration#.E2.80.9CLow_memory.E2.80.9D_.28x86_32_specific.29 | |
# | |
# AWK script to calculate lower memory utilization | |
lowmem() { | |
awk '$1 ~ /kmemsize|tcprcvbuf|tcpsndbuf|dgramrcvbuf|othersockbuf/ { M+=$2 } END { print M / (0.4 * 832 * 1024 * 1024 ) }' $* | |
} | |
# Reading user bean counters, low mem usage is: 0.137789 |
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
<?php | |
function fib($n) { | |
return ($n > 1) ? fib($n - 2) + fib($n - 1) : $n; | |
} | |
echo fib(30); |
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
# coding: utf-8 | |
require 'sinatra' | |
set server: 'thin', connections: [] | |
get '/' do | |
halt erb(:login) unless params[:user] | |
erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
end | |
get '/stream', provides: 'text/event-stream' 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
_gs_ps1() { | |
[[ -z $GS_NAME ]] || echo "[$GS_NAME] " | |
} | |
export PS1="\n\[\033[01;32m\]\w \[\033[1;33m\]\$(_gs_ps1)\[\033[01;31m\]\$(__git_ps1 \"(%s) \")\[\033[01;36m\]>>\[\033[00m\] " | |
export PS1="\[\033[G\]$PS1" |
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
module Protest | |
class Reports::TimedTest < Report | |
include Utils::Summaries | |
include Utils::ColorfulOutput | |
attr_reader :stream | |
attr_reader :slowest | |
attr_reader :max_time | |
def initialize(stream=STDOUT) |
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
.arrow | |
background: asset_path('/images/arrow_small_white.png') no-repeat 14px center |
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 | |
param = ARGV.first | |
class Fixnum | |
def is_cachipulis? | |
length = self.to_s.length | |
digits = self.to_s.split('').map(&:to_i) | |
return false if digits.inject(&:+) != length |
- http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/
- https://github.com/eric/metriks
- http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
- http://unwiredcouch.com/2012/09/15/getting-started-with-monitoring.html
- https://github.com/ripienaar/gdash
- https://github.com/paulasmuth/fnordmetric
- http://railscasts.com/episodes/378-fnordmetric
- http://bost.ocks.org/mike/
- https://github.com/mbostock/d3
- http://www.confreaks.com/videos/655-rubyconf2011-big-data-enterprisy-analytics-app-and-ruby
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 redis-server | |
with pidfile "/var/run/redis.pid" | |
start program = "/etc/init.d/redis-server start" | |
stop program = "/etc/init.d/redis-server stop" | |
if 2 restarts within 3 cycles then timeout | |
if totalmem > 100 Mb then alert | |
if children > 255 for 5 cycles then stop | |
if cpu usage > 95% for 3 cycles then restart | |
if failed host 127.0.0.1 port 6379 then restart | |
if 5 restarts within 5 cycles then timeout |
OlderNewer