Skip to content

Instantly share code, notes, and snippets.

View stevencorona's full-sized avatar

Steve Corona stevencorona

View GitHub Profile
/dev/aacd0slf
512 # sectorsize
285184304640 # mediasize in bytes (266G)
557000595 # mediasize in sectors
34671 # Cylinders according to firmware
255 # Heads according to firmware
63 # Sectors according to firmware
Seek times:
Full stroke: 250 iter in 3.386884 sec = 13.548 msec
/dev/aacd0slf
512 # sectorsize
278891965440 # mediasize in bytes (260G)
544710870 # mediasize in sectors
33906 # Cylinders according to firmware
255 # Heads according to firmware
63 # Sectors according to firmware
Seek times:
Full stroke: 250 iter in 3.615817 sec = 14.463 msec
<?php
require_once 'HTTP/OAuth/Consumer.php';
$r = new Http_Request2('http://api.twitpic.com/1/uploadAndPost.xml', Http_Request2::METHOD_POST);
$r->addPostParameter( 'consumer_token', '' );
$r->addPostParameter( 'consumer_secret', '' );
$r->addPostParameter( 'oauth_token', '' );
$r->addPostParameter( 'oauth_secret', '' );
$r->addPostParameter( 'message', '@mhp this is a test from the oauth api' );
location /fs/media/ {
allow 10.0.0.5;
deny all;
root /path/to/data;
}
desc "collect balances from bank of america"
task :bank_of_america => :environment do
Mechanize.html_parser = Nokogiri::HTML
agent = Mechanize.new
agent.user_agent_alias = "Windows IE 7"
balances = nil
task :mint => :environment do
Mechanize.html_parser = Nokogiri::HTML
agent = Mechanize.new
agent.get('https://wwws.mint.com/login.event?task=L') do |page|
login_result = page.form_with(:action => "loginUserSubmit.xevent") do |login|
login.username = ""
login.password = "";
* no modifications yet
@stevencorona
stevencorona / gist:675695
Created November 13, 2010 22:10
Example of Redis List API
$redis = new Predis\Client('redis://10.0.0.1:6379/');
$redis->lpush("key", "value1");
$redis->lpush("key", "value2");
echo $redis->llen("key") . " items in the list";
$array = new Redis\List("key");
$array[] = "value1";
$array[] = "value2";
echo count($array) . " items in the list";
$counter = new RedisString("key");
$counter(-1); // decr 1
$counter(+1); // incr 1
$counter(+2); // incr 2
$counter = new RedisString("key");
$counter->decr();
$counter->incr();
$counter->incr(2);