Refe.vimの操作

~/.vim/ftplugin/ruby.vim に下記二行を追加した前提で、nnoremap K :Refe nnoremap :Refe on ruby source key behave K カーソル下の単語をRefeで引く :Refe Refeでwordを引く Refeを開く on Refe buffer key behave o カーソル下の単語のリファレンスを見…

オブジェクトの凍結(freeze)、clone、dup の複製の深さの違い、eql? と equal? の違い

fc9 [0] /root # irb irb(main):001:0> self.class => Object irb(main):002:0> "str".freeze => "str" irb(main):003:0> a = "str" => "str" irb(main):004:0> a << "b" => "strb" irb(main):005:0> a.freeze => "strb" irb(main):006:0> a << "c" TypeErro…

[Ruby]トップレベルで定義されたメソッドはObjectに属するのでどこからでも呼べる。

#!/usr/local/bin/ruby p self.class def hello(target) puts "hello #{target}" end class Person hello("ryouichi") def hello2 hello("yurichan") end end hello("t9md") Person.new.hello2 実行結果 Object hello ryouichi hello t9md hello yurichan

無名クラスを定数に入れると定数の名前がクラス名になる。

c9 [0] /root # irb irb(main):001:0> var = Class.new => #<Class:0xb8094e40> irb(main):002:0> var.name => "" irb(main):003:0> Wibble = var => Wibble irb(main):004:0> var.name => "Wibble" irb(main):005:0> class Hoge ; end => nil irb(main):006:0> hoge = Hoge.ne</class:0xb8094e40>…

QuickSilverAlternative

http://www.lifeclever.com/scott-hanselman-10-quicksilver-alternatives-for-windows/

lambdaで作成したProcに名前をつける。

昨日から、プログラミングGauche作者: Kahuaプロジェクト,川合史朗出版社/メーカー: オライリージャパン発売日: 2008/03/14メディア: 大型本購入: 22人 クリック: 713回この商品を含むブログ (244件) を見るをやり始めた。 「lispの概念をしっかり身に着ける…

Gauche on vim

Emacsは使えないので(覚えたいけど。) vim syntax http://e.tir.jp/wiliki?vim%3Ascheme.vim wget http://e.tir.jp/wiliki?vim%3Ascheme.vim mv scheme.vim ~/.vim/syntax/ vim ~/.vim/ftdetect/scheme.vim autocmd FileType scheme :let is_gauche=1 gosh w…

HTTP_GETのヘルスチェック

LVS

digestに設定するmd5値はgenhashを使う。 status_codeとの併用は不可。status_codeが設定されている場合はdigestが無視されるぽい。 [root@centos5-01 ~]# genhash -s 192.168.207.5 -p 80 -u /alive.html -h genhash v1.0.0 (18/11, 2002) Usage: genhash -…

irb = interactive Ruby

fc9 [1] /root # irb irb(main):002:0> def add(x,y) x+y end => nil irb(main):003:0> def mul(x,y) x*y end => nil irb(main):004:0> add(2,3) => 5 irb(main):005:0> mul(2,3) => 6 irb(main):006:0> irb(main):012:0> calc=lambda { |x| send(x,2,3) } #…

gosh = interactive Gauche

fc9 [0] /root # gosh gosh> (define (add x y)(+ x y)) add gosh> (define (mul x y)(* x y)) mul gosh> (add 2 3) 5 gosh> (mul 2 3) 6 gosh> (define (calc f)(f 2 3)) ;関数を引数にとるcalcを定義 calc gosh> (calc add) ; 関数addを渡す => (add 2 3) …

フォント重要

http://wiki.fdiary.net/font/?freefont http://ja.wikipedia.org/wiki/ClearType http://labs.unoh.net/2007/08/post_95.html http://blog.goo.ne.jp/tooki5/e/d53c896578d05f146899186ef4e55b47

携帯キャリアIP判別材料

http://search.cpan.org/dist/Net-CIDR-MobileJP/ http://d.hatena.ne.jp/spiritloose/20061010/1160471510 http://dsas.blog.klab.org/archives/51117561.html

Bash Lesson

class Bar include Foo end class Baz < Bar p ancestors p included_modules p superclass end [root@fc9 bash]# mkdir -p a/{lib,src,doc/{html,pdf,txt}}/{s_a,s_b} [root@fc9 bash]# ls a [root@fc9 bash]# find ./ ./ ./a ./a/doc ./a/doc/txt ./a/doc/…

shortcut to be experienced programmer in 2years

HTML help http://d.hatena.ne.jp/onishi/20060512#p1 http://code.google.com/p/htmlhelp/downloads/list?q=label:CHM IDE IDE比較@wikipedia http://en.wikipedia.org/wiki/List_of_integrated_development_environmentsIDEリスト@zdnet http://japan.zdne…

PCI video card

http://www.pasocomclub.co.jp/htmls/4988755114509.html

adding apache module after installation

fc9 [0] /usr/local/src/httpd-2.2.11/modules/generators # /usr/local/apache-2.2.11/bin/apxs -c mod_info.c fc9 [0] /usr/local/src/httpd-2.2.11/modules/generators # /usr/local/apache-2.2.11/bin/apxs -i -a -n info mod_info.la

アジャイル本

アジャイル本 ↓がよさそうだとおもってましたが、、、※ 第2版もでてますね。 http://www.amazon.co.jp/%E3%82%A2%E3%82%B8%E3%83%A3%E3%82%A4%E3%83%AB%E3%82%BD%E3%83%95%E3%83%88%E3%82%A6%E3%82%A7%E3%82%A2%E9%96%8B%E7%99%BA%E3%81%AE%E5%A5%A5%E7%BE%A…

LVS(ip_vs) Staitistics Grapher

LVS

Recently I created graphing tool for LVS(ipvs) kernel module statistics.

cacti DataSourceRRA

https://www.sabakan.info/techinfo/cacti-0.8.7-4.html

Bash array

[root@fc9 Util]# a[0]=one [root@fc9 Util]# a[0]=zero [root@fc9 Util]# a[1]=one [root@fc9 Util]# a[2]=two [root@fc9 Util]# a[3]=three [root@fc9 Util]# echo $a zero [root@fc9 Util]# echo $a[*] zero[*] [root@fc9 Util]# echo ${a[*]} zero one t…

R200でRAIDのStatusを確認するには

http://cherry.usacho.jp/20071013.htmlを参考にまず、OpenMnage Server Administrator をインストール omreport storage vdisk omreport storage pdisk controller=0

HALDAEMON and lshw

http://ezix.org/project/wiki/HardwareLiSter /sbin/service haldaemon start [root@lvs1 MASTER ~]# lshal -t computer acpi_PWRF acpi_CPU0 acpi_CPU1 platform_pcspkr platform_pcspkr_logicaldev_input platform_vesafb_0 platform_serial8250 platform…

Document should be read

cd /usr/share/doc/iproute-2.6.23 ps2pdf ip-cref.ps ls ip-cref.pdf ← コレ /usr/share/doc/sysstat-8.0.4/FAQ /usr/share/doc/initscripts-8.76/sysconfig.txt http://www.redhat.com/docs/manuals/enterprise/

負荷計測

swap [root@lvs1 ~]# sar -W 1 1000 Linux 2.6.18-92.1.6.el5 (lvs1) 08/19/08 00:21:03 pswpin/s pswpout/s 00:21:04 0.00 0.00 00:21:05 0.00 0.00 00:21:06 0.00 0.00 runqueue load avg [root@lvs1 ~]# sar -q 1 100 Linux 2.6.18-92.1.6.el5 (lvs1) 08/…

man misc

FC9 /root# man ld FC9 /root# man -k gcc gcc (rpm) - Various compilers (C, C++, Objective-C, Java, ...) gcc [] (1) - GNU project C and C++ compiler gcc-c++ (rpm) - C++ support for GCC gcc-gfortran (rpm) - Fortran 95 support gccmakedep [] (1…

ip route2 redundancy for multiple gateway

[root@c46-1 iproute2]# ip route add default nexthop via 192.168.207.239 nexthop via 192.168.207.22 [root@c46-1 iproute2]# [root@c46-1 iproute2]# ip route show 172.16.1.0/24 dev eth0 proto kernel scope link src 172.16.1.249 192.168.207.0/24…

メモいろいろ

■ 静的ライブラリに含まれるオブジェクトのリスト ar tv /usr/local/lib/libruby-static.a ■ ldconfigによるライブラリ検索パスのUpdate 動的リンカは/etc/ld.so.cacheから共有ライブラリを探索する。 /etc/ld.so.cacheはldconfigにより生成する。 ldconfig …

ddで追記

dd if=/dev/zero of=hogehoge oflag=append conv=notrunc bs=1M count=1

GNU screen でlessやvimの終了後に画面クリアをしない方法

FedoraCore9を使用していて、screen上でmanやlessやvimの終了後に、画面がクリアされてしまう。 この動作を変更するには screenを起動し, infocmpで現在のteminfoをファイルにdumpし、 dumpされたterminfoのrmcup、smcupを削除して ticでコンパイルして~/.te…

rpm備忘録

■ コレを読むベシ http://docs.fedoraproject.org/drafts/rpm-guide-en/ ■ /etc/yum.conf はどのrpmパッケージからインストールされたものか? rpm -qf /etc/yum.conf ■ インストールされた httpd パッケージに含まれるリスト * 全ファイル rpm -ql httpd *…