Skip to content

Instantly share code, notes, and snippets.

@flores
flores / gist:1124077
Created August 3, 2011 23:00
make it work with flv or mp4
#!/usr/bin/perl
#unless ( $#ARGV == 4 ) {
# die "This shit takes a YouTube link and makes an mp3.
#usage: $0 http://youtubedownloadlink \"Name to save .mp3\"
##If you use spaces for the resulting mp3, you'll need to enclose that filename in quotes.\n";
# }
my ($link, $jam)=(@ARGV);
@flores
flores / zmq_mongrel2_install.sh
Created August 4, 2011 20:13
install 0MQ and mongrel2 on Debian (via apt pinning, gem)
# we're pulling zmq libs from sid via apt-pinning
echo "deb http://http.us.debian.org/debian sid main contrib non-free" > /etc/apt/sources.list.d/unstable.list
echo "Package: *
Pin: release a=stable
Pin-Priority: 700
Package: *
Pin: release a=sid
Pin-Priority: 600" > /etc/apt/preferences
0mq-test:~# dpkg -l |egrep -i 'zmq|java|jruby|node'
ii java-common 0.30 Base of all Java packages
ii jruby 1.5.1-1 100% pure-Java implementation of Ruby
ii libv8-3.1.8.22 3.1.8.22-1 V8 JavaScript Engine
ii libzmq-dev 2.1.7-1 ZeroMQ lightweight messaging kernel (development libraries and header files)
ii libzmq1 2.1.7-1 ZeroMQ lightweight messaging kernel (shared library)
ii nodejs 0.4.10-1 Node.js event-based server-side javascript engine
ii sun-java6-bin 6.26-0squeeze1 Sun Java(TM) Runtime Environment (JRE) 6 (architecture dependent files)
ii s
@flores
flores / 0mq_install.sh
Created August 8, 2011 21:10
centos | debian zeromq install (from source)
#!/bin/bash
# doesn't remove packages. just beginning/sharing script for the install.
if [ -e /etc/redhat-release ]; then
yum install -y gcc make autoconf automake e2fsprogs-devel glibc-devel
elif [ -e /etc/debian_version ]; then
apt-get install -y build-essential uuid-dev
else
echo "sorry, this script only installs on RedHat/CentOS or Debian/Ubuntu boxes"
exit 2
# dpkg -l |grep -i mongo
ii mongodb-clients 1:1.4.4-3 An object/document-oriented database (client apps)
ii mongodb-server 1:1.4.4-3 An object/document-oriented database (server package)
ii python-bson 1.11-1 Python implementation of BSON for MongoDB
0mq-test:~/shark/bin/install# npm list |grep -ie '(mongo|bson)'
[email protected] active installed
[email protected] active installed
[email protected] active installed
@flores
flores / gist:1147394
Created August 15, 2011 18:37
install funkload on debian stable
apt-get update
apt-get install -y python-dev python-setuptools python-webunit python-docutils \
python-paramiko python-virtualenv tcpwatch-httpproxy # for distributed mode
#gnuplot is in documentation but requires x11-common?!
easy_install -U setuptools # old version on our testers
easy_install -U funkload # stable
#easy_install -f http://funkload.nuxeo.org/snapshots/ -U funkload # snapshot
@flores
flores / gist:1166361
Created August 23, 2011 20:10
haproxy 64bit rates
# single 32-bit tester.
minimal:~# httperf --server=somesite --port=80 --uri=/check --num-conn 500000 --ra 2000 --hog
httperf --hog --client=0/1 --server=somesite --port=80 --uri=/check --rate=2000 --send-buffer=4096 --recv-buffer=16384 --num-conns=500000 --num-calls=1
Maximum connect burst length: 188
Total: connections 33485 requests 33362 replies 33362 test-duration 16.741 s
Connection rate: 2000.2 conn/s (0.5 ms/conn, <=215 concurrent connections)
Connection time [ms]: min 0.6 avg 6.7 max 117.9 median 6.5 stddev 8.8
@flores
flores / gist:1166566
Created August 23, 2011 21:14
mongrel2 64bit rates, 0MQ -> JVM backend
# to a process that returns 204 immediately after post. single 32-bit tester.
minimal:~# httperf --server=somesite --port=6767 --uri=/remora --num-conn 500000 --ra 2000 --hog --method=POST
httperf --hog --client=0/1 --server=somesite --port=6767 --uri=/remora --rate=2000 --send-buffer=4096 --recv-buffer=16384 --method=POST --num-conns=500000 --num-calls=1
Maximum connect burst length: 780
Total: connections 95165 requests 94831 replies 94144 test-duration 108.161 s
Connection rate: 879.8 conn/s (1.1 ms/conn, <=1022 concurrent connections)
Connection time [ms]: min 0.8 avg 1018.5 max 94842.4 median 194.5 stddev 2430.4
@flores
flores / gist:1166663
Created August 23, 2011 21:43
mongrel2 - sanity/jvm handler warmup
httperf --server=somesite --port=6767 --uri=/remora --num-conn 500000 --ra 20000 --hog --method=POST
httperf --hog --client=0/1 --server=somesite --port=6767 --uri=/remora --rate=20000 --send-buffer=4096 --recv-buffer=16384 --method=POST --num-conns=500000 --num-calls=1
Maximum connect burst length: 7851
Total: connections 40175 requests 40175 replies 40175 test-duration 43.971 s
Connection rate: 913.7 conn/s (1.1 ms/conn, <=1022 concurrent connections)
Connection time [ms]: min 1.7 avg 702.6 max 29000.0 median 100.5 stddev 1966.6
Connection time [ms]: connect 313.9