Skip to content

Instantly share code, notes, and snippets.

View rust's full-sized avatar
🏠
Working from home

Shinichiro OGAWA rust

🏠
Working from home
View GitHub Profile
#!/bin/bash
function print_usage {
echo
echo "move-installer-udebs source-directory destination-directory"
echo
echo "paths must be absolute"
echo "source-directory is the directory containing the udebs"
echo "destination-directory is the directory containing the pool directory"
}
### Priority
debconf debconf/priority select critical
#### Contents of the preconfiguration file (for lenny)
### Localization
# Locale sets language and country.
d-i debian-installer/locale string ja_JP
# Keyboard selection.
#d-i console-tools/archs select at
@rust
rust / cluster
Created February 27, 2009 06:40
#!/bin/bash
#
# chkconfig: 345 70 8
# description: start up and shutdown drbd cluster.
#
# Copright 2009
# Shin-ichiro OGAWA, eole(c)
#
### BEGIN INIT INFO
# Required-Start: $network $syslog sshd
# 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.
<?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>
#
# 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
#
# 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
class Flare
# limit value size
MAX_VALUE_SIZE = 10_000_000
# connections
@@connection = {
:writer => nil,
:reader => nil
}
@@flare_saver = nil
require 'tokyotyrant'
class UserAccessLog
@@connection = {:master => nil, :slave => nil}
@@tt_server = {
:master => {
:host => "localhost",
:port => "1978",
},
:slave => {
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