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/sh | |
case "$1" in | |
start) | |
tc qdisc add dev lo root handle 1: htb default 1 | |
tc class add dev lo parent 1: classid 1:1 htb rate 80kbps #ceil 80kbps | |
tc filter add dev lo protocol ip parent 1: prio 1 u32 match ip dport 80 0xffff flowid 1:1 | |
;; | |
status) |
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
response = begin | |
uri = URI.parse(uri) | |
Timeout::timeout(@timeout) { | |
http = Net::HTTP.new(uri.host, uri.port) | |
if uri.scheme == 'https' | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
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
--- | |
:verbose: true | |
:bulk_threshold: 1000 | |
gem: --no-ri --no-rdoc | |
gemcutter_key: xxxx | |
:sources: | |
- http://gemcutter.org | |
- http://gems.rubyforge.org/ | |
- http://gems.github.com | |
:benchmark: false |
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 | |
command = '/opt/ruby-enterprise-1.8.6-20080810/bin/passenger-memory-stats' | |
memory_limit = 200 # megabytes | |
def running?(pid) | |
begin | |
return Process.getpgid(pid) != -1 | |
rescue Errno::ESRCH | |
return false |
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
// Contador de caracteres genérico para un textarea | |
// | |
// $('textarea').keycounter(); | |
// usas los valores por defecto.. el nombre del contador es 'counter' y 140 caracteres máximos | |
// | |
// $('textarea').keycounter({'counter': '#area_counter', 'max': 300}); | |
// el contador va a ser el elemento area_counter y tendrá un máximo de 300 caracteres | |
// | |
// Nelson Fernandez - 23.5.2011 - v.0.1 | |
// |
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
» cat .inputrc | |
set -o vi | |
set editing-mode vi | |
set keymap vi |
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
brew install readline openssl | |
export CFLAGS=-Wno-error=shorten-64-to-32 | |
env RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` CONFIGURE_OPTS=--with-readline-dir=`brew --prefix readline` rbenv install 2.0.0-p195 |
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
/* | |
* 2011 Clearfix | |
*/ | |
.clearfix:before, .container:after { content: ""; display: table; } | |
.clearfix:after { clear: both; } | |
/* IE 6/7 */ | |
.clearfix { zoom: 1; } |
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 -ex | |
### configuration | |
PKGS_TO_ADD="$PKGS_TO_ADD curl git etckeeper python-software-properties" | |
PKGS_TO_REMOVE="$PKGS_TO_REMOVE geoip-database popularity-contest" | |
PKGS_TO_REMOVE="$PKGS_TO_REMOVE pppoeconf pppconfig ppp" | |
PKGS_TO_REMOVE="$PKGS_TO_REMOVE ubuntu-standard memtest86+" # warning: be careful about what you remove after this | |
KERNEL_MODULES_TO_BLACKLIST="$KERNEL_MODULES_TO_BLACKLIST joydev gameport" | |
KERNEL_MODULES_TO_BLACKLIST="$KERNEL_MODULES_TO_BLACKLIST btusb bluetooth" |
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
# | |
# Utility function to reindex an Ohm model or populate a new added index | |
# The functions is idempotent | |
# only use over 'index', not 'reference' indexes | |
# | |
# use: | |
# class Table < Ohm::Model | |
# include OhmUtils | |
# | |
# ... |
OlderNewer