This file contains hidden or 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
require 'tokyocabinet' | |
include TokyoCabinet | |
# create the object | |
hdb = HDB::new | |
# open the database | |
if(!hdb.open("casket.hdb", HDB::OWRITER | HDB::OCREAT)) | |
ecode = hdb.ecode | |
STDERR.printf("open error: %s\n", hdb.errmsg(ecode)) |
This file contains hidden or 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
require 'tokyotyrant' | |
include TokyoTyrant | |
# create the object | |
rdb = RDB::new | |
# connect to the server | |
if !rdb.open("localhost", 1978) | |
ecode = rdb.ecode | |
STDERR.printf("open error: %s\n", rdb.errmsg(ecode)) |
This file contains hidden or 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
require 'benchmark' | |
require 'tokyocabinet' | |
require 'digest/sha1' | |
require 'pp' | |
bdb = TokyoCabinet::BDB.new | |
unless bdb.open("dbd-benchmark.dbd", TokyoCabinet::BDB::OWRITER | TokyoCabinet::BDB::OCREAT) | |
exit | |
end |
This file contains hidden or 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
class User < ActiveRecord::Base | |
def access_time=(time = Time.now) | |
raise "#{self.class} isn't saved." unless id | |
access_log = UserAccessLog.find(id) | |
access_log.time = time | |
access_log.save | |
end | |
def access_time |
This file contains hidden or 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
require 'tokyotyrant' | |
class UserAccessLog | |
@@connection = {:master => nil, :slave => nil} | |
@@tt_server = { | |
:master => { | |
:host => "localhost", | |
:port => "1978", | |
}, | |
:slave => { |
This file contains hidden or 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
class Flare | |
# limit value size | |
MAX_VALUE_SIZE = 10_000_000 | |
# connections | |
@@connection = { | |
:writer => nil, | |
:reader => nil | |
} | |
@@flare_saver = nil |
This file contains hidden or 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
# | |
# drbd.conf example | |
# | |
# parameters you _need_ to change are the hostname, device, disk, | |
# meta-disk, address and port in the "on <hostname> {}" sections. | |
# | |
# you ought to know about the protocol, and the various timeouts. | |
# | |
# you probably want to set the rate in the syncer sections |
This file contains hidden or 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
# | |
# drbd.conf example | |
# | |
# parameters you _need_ to change are the hostname, device, disk, | |
# meta-disk, address and port in the "on <hostname> {}" sections. | |
# | |
# you ought to know about the protocol, and the various timeouts. | |
# | |
# you probably want to set the rate in the syncer sections | |
This file contains hidden or 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
<?xml version="1.0"?> | |
<cluster name="mycluster" config_version="1"> | |
<clusternodes> | |
<clusternode name="centos-primary" votes="1" nodeid="1"> | |
<fence> | |
<method name="single"> | |
<device name="manual" ipaddr="192.168.100.101"/> | |
</method> | |
</fence> | |
</clusternode> |
This file contains hidden or 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
# This is an example configuration file for the LVM2 system. | |
# It contains the default settings that would be used if there was no | |
# /etc/lvm/lvm.conf file. | |
# | |
# Refer to 'man lvm.conf' for further information including the file layout. | |
# | |
# To put this file in a different directory and override /etc/lvm set | |
# the environment variable LVM_SYSTEM_DIR before running the tools. | |
OlderNewer