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/local/bin/perl | |
# original: http://blog.livedoor.jp/dankogai/archives/50924886.html | |
use strict; | |
use warnings; | |
use Benchmark qw/timethese cmpthese/; | |
my $logline = | |
q{localhost.local - - [04/Oct/2007:12:34:56 +0900] "GET /apache_pb.gif HTTP/1.1" 200 2326 "http://www.dan.co.jp/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"}; |
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 perl | |
use local::lib "./extlib/"; | |
use Thrift; | |
use Thrift::Socket; | |
use Thrift::BufferedTransport; | |
use Thrift::BinaryProtocol; | |
use ThriftHive; | |
my $socket = Thrift::Socket->new("localhost", 10000); |
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 | |
require 'ldap' | |
SERVER_NAME = '192.168.0.128' | |
SERVER_PORT = 389 | |
AUTH_DN = 'cn=binduser,cn=Users,dc=ad,dc=livedoor,dc=intranet' | |
AUTH_PASS = 'yourpassword' | |
def connection |
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
// test for kyoto-client.js | |
var crypto = require('crypto'); | |
var randomSelect = function(array){ | |
return Math.floor(Math.random() * array.length); | |
}; | |
var makedata = function(times){ | |
var seed = 'abcdefghijklmnopqrstuvwxyz012345'; //32bytes |
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
var thrift = require('thrift'), | |
ttransport = require('thrift/transport'), | |
ThriftHive = require('gen-nodejs/ThriftHive'); | |
var connection1 = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}), | |
client1 = thrift.createClient(ThriftHive, connection1); | |
var connection2 = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}), | |
client2 = thrift.createClient(ThriftHive, connection2); | |
connection1.on('error', function(err){ console.error(err); }); |
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
var thrift = require('thrift'), | |
ttransport = require('thrift/transport'), | |
ThriftHive = require('gen-nodejs/ThriftHive'); | |
var connection1 = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}), | |
client1 = thrift.createClient(ThriftHive, connection1); | |
var connection2 = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}), | |
client2 = thrift.createClient(ThriftHive, connection2); | |
connection1.on('error', function(err){ console.error(err); }); |
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
var thrift = require('thrift'), | |
ttransport = require('thrift/transport'), | |
ThriftHive = require('gen-nodejs/ThriftHive'); | |
var connection1 = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}), | |
client1 = thrift.createClient(ThriftHive, connection1); | |
var connection2 = thrift.createConnection("localhost", 10000, {transport: ttransport.TBufferedTransport, timeout: 1*1000}), | |
client2 = thrift.createClient(ThriftHive, connection2); | |
connection1.on('error', function(err){ console.error(err); }); |
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 | |
TARGET_MD=$1 | |
### call md verifying when idle. | |
###### | |
# HOW TO USE | |
### md_sync_call.sh md0 | |
error_exit() { |
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
epoll_wait(57, {}, 64, 0) = 0 | |
clock_gettime(CLOCK_MONOTONIC, {8098696, 447030916}) = 0 | |
futex(0x1178c68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0 | |
futex(0x1178c68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0 | |
futex(0x1178c68, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable) | |
futex(0x1178c68, FUTEX_WAKE_PRIVATE, 1) = 1 | |
clock_gettime(CLOCK_MONOTONIC, {8098696, 448022916}) = 0 | |
epoll_wait(57, {}, 64, 0) = 0 | |
clock_gettime(CLOCK_MONOTONIC, {8098696, 448186916}) = 0 | |
futex(0x1178c68, FUTEX_WAIT_PRIVATE, 2, NULL) = 0 |
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
use Data::Dumper; | |
my $x = {1 => "ichi", 2 => "ni"}; | |
warn Dumper $x; | |
{ | |
use Encode; | |
my $decoded = Encode::decode_utf8($x->{1}, 1); | |
local $x->{1} = $decoded; | |
warn Dumper $x; | |
} | |
warn Dumper $x; |
OlderNewer