-
master.cf
smtp の行をコピーして smtp2 という名前の行を作る
smtp2 unix - - - - - smtp
-
main.cf
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
require 'cgi' | |
require 'json' | |
require 'socket' | |
class GroongaHttpClient | |
Error = Class.new StandardError | |
def initialize(host, port) | |
@host, @port = host, port |
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/ruby | |
# -*- coding: utf-8 -*- | |
require 'cgi' | |
filename, = ARGV # path of file `ctype-uca.c' | |
ctype_uca = File.read(filename) | |
ctype_uca =~ /^uchar uca_length\[256\]={\n(.*?)};$/m or raise 'uca_length not found' | |
uca_length = $1.gsub(/\s/,'').split(/,/).map(&:to_i) |
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
# -*- coding: utf-8 -*- | |
class VendingMachine | |
attr_reader :total_money | |
class Drink | |
@hash = {} | |
attr_reader :id, :price | |
def initialize(id, price) | |
@id, @price = id, price |
% ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
次のスクリプトを実行すると
# coding: utf-8
Encoding.default_external = 'cp932'
Encoding.default_internal = 'utf-8'
File.open('cp932.txt', 'r').read
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
$><<('%04d'%$*).chars.zip(%w{千 百 十}).join.gsub(/1(.)|0.?|(\d)/){$2?'0一二三四五六七八九'[$2.to_i]:$1} |
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/ruby | |
require 'fileutils' | |
system 'adb pull /system/framework/telephony-common.jar' or raise 'adb pull' | |
FileUtils.cp 'telephony-common.jar', 'telephony-common.jar.orig', :preserve=>true | |
system 'unzip telephony-common.jar classes.dex' or raise 'unzip' | |
system 'java -jar baksmali-1.4.2.jar classes.dex' or raise 'java baksmali' | |
file = 'out/com/android/internal/telephony/gsm/GsmServiceStateTracker.smali' | |
src = <<EOS | |
:pswitch_data_20 |
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
require 'rack/utils' | |
require 'rack/protection/path_traversal' | |
module Rack | |
module Utils | |
orig_normalize_params_singleton = method(:normalize_params) | |
define_singleton_method(:normalize_params) do |params, name, *args| | |
return unless name && name.valid_encoding? | |
orig_normalize_params_singleton.call(params, name, *args) | |
end |
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
default partial alphanumeric_keys modifier_keys | |
xkb_symbols "tmtms" { | |
key <AE00> { [ Escape ] }; | |
key <TLDE> { [ Escape ] }; | |
key <HKTG> { [ Escape ] }; | |
key <AE01> { [ 1, exclam ] }; | |
key <AE02> { [ 2, at ] }; | |
key <AE03> { [ 3, numbersign ] }; | |
key <AE04> { [ 4, dollar ] }; |
OlderNewer