DTIのVPSに申し込んでみた

3月末あたりからDTIが何を血迷ったかそれとも何かに目覚めたのか、なにやらとにかく大人の事情を感じさせる突然のVPSサービス提供開始。
最小サービスは¥490/m RAM256M/10GB/apache CentOS [title:http://dream.jp/vps/]
DTI会員向けに、契約期間に応じた恒久的な割引があるようで、

・1995年10月26日〜2000年12月31日にDTIへご入会のお客様
Entryプラン 定価 490円 → 105円にてご提供!

だそうな。

nntpの、特にalt.binaries.*系列云々でbekkoameDTIか、それが問題云々
・・・という時代からDTIのお世話になっているのでまあ、¥105でVPSって新しいよねってことで登録。

申し込みが集中しているらしく先着順での処理だそうな。
うちの場合は4日程度で申し込んでくれていいんだぜ的なメールが来て、祝御契約。

レスポンスはさすがの国内サーバー。
colinuxにつないでるのか否か、判断しかねる程度にはサクサク

[root@dti-vps-srv02 ~]# uname -a
Linux dti-vps-srv02 2.6.18-164.10.1.el5.028stab067.4 #1 SMP Thu Jan 14 21:23:12 MSK 2010 i686 i686 i386 GNU/Linux
[root@dti-vps-srv02 ~]# ps -alx
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
4     0     1     0  15   0   2068   648 -      Ss   ?          0:00 init [3]
5     2  7534 27904  15   0  10668  2784 -      S    ?          0:00 /usr/sbin/httpd
5     2  7930 27904  15   0  10668  2780 -      S    ?          0:00 /usr/sbin/httpd
5     2  9468 27904  15   0  10668  2792 -      S    ?          0:00 /usr/sbin/httpd
5     2  9487 27904  18   0  10668  2724 -      S    ?          0:00 /usr/sbin/httpd
5     0 24189     1  21  -4   2152   552 -      S<s  ?          0:00 /sbin/udevd -d
4     0 25975 27725  15   0   9904  2844 -      Ss   ?          0:00 sshd: root@pts/0
4     0 26253 25975  18   0   3620  1468 wait   Ss   pts/0      0:00 -bash
4     0 26357 26253  19   0   2396   812 -      R+   pts/0      0:00 ps -alx
1     0 26378     1  15   0   1824   696 -      Ss   ?          0:01 syslogd -m 0
5     0 27725     1  15   0   7068  1060 -      Ss   ?          0:00 /usr/sbin/sshd
1     0 27749     1  18   0   2724   864 -      Ss   ?          0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
5     0 27821     1  15   0   9212  1684 -      Ss   ?          0:03 sendmail: accepting connections
1    51 27860     1  18   0   8160  1496 pause  Ss   ?          0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
5     0 27904     1  18   0  10536  3476 -      Ss   ?          0:01 /usr/sbin/httpd
1     0 27925     1  15   0   4408  1116 -      Ss   ?          0:00 crond
1     0 27951     1  18   0   5584   704 fcntl_ Ss   ?          0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
1     0 27956 27951  18   0   5584   440 -      S    ?          0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
5     2 53147 27904  15   0  10668  2708 -      S    ?          0:00 /usr/sbin/httpd
[root@dti-vps-srv02 ~]# yum install zsh
...
[root@dti-vps-srv02 ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 238316      0      0    0    0     0     0    0    7  0  0 100  0  0
[root@dti-vps-srv02 ~]# zsh
[root@dti-vps-srv02]~# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 237204      0      0    0    0     0     0    0    7  0  0 100  0  0
[root@dti-vps-srv02]~# exit
[root@dti-vps-srv02 ~]# iostat
-bash: iostat: command not found
?_? .o0(google!help!
[root@dti-vps-srv02 ~]# yum install syssta
...
[root@dti-vps-srv02 ~]# iostat
Linux 2.6.18-164.10.1.el5.028stab067.4 (dti-vps-srv02)  04/12/2010

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00    0.00    0.00  100.00

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn

[root@dti-vps-srv02 ~]#

・・・すげぇまともです。

FreeBSD SCIM Anthy Shift+Space 全角?スペースが挿入される件

半角スペースを挿入したつもりが、推定全角スペースが不意に挿入されていることがしばしば。
非常にうざったく云々

Anthyの設定で、Shift+Spaceに別幅のスペースがどうとかいうショートカットがデフォルトで割り振られていた。
けしからん思いでいっぱいになりながら、ショートカット削除

C 64bitでのシフトが怖い

amd64環境下ではまったのでメモ

#include "stdlib.h"

void printx(unsigned long x) {
    printf("0x");
    for(int i = sizeof(x) * 8 - 1; i >= 0; --i) {
        printf("%d%s", (x >> i) & 0x1 ? 1 : 0, i % 8 == 0 ? " " : "");
    }
    printf("\n");
}

int main {
    //printx(0x1<<32); // warning: shift count >= width of type

    for(int i = 30; i <= 34; ++i) {
        printf("0x1 << %d : ", i);
        printx(0x1 << i); // i>=32, but no warning!
    }
    //0x1 << 30 : 0x00000000 00000000 00000000 00000000 01000000 00000000 00000000 00000000
    //0x1 << 31 : 0x11111111 11111111 11111111 11111111 10000000 00000000 00000000 00000000
    //0x1 << 32 : 0x00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
    //0x1 << 33 : 0x00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000010
    //0x1 << 34 : 0x00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000100

    for(int i = 30; i <= 34; ++i) {
        printf("0x1 << %d : ", i);
        printx((i % 2 ? (unsigned long)0x1 : 0x1UL) << i);
    }
    //0x1 << 30 : 0x00000000 00000000 00000000 00000000 01000000 00000000 00000000 00000000
    //0x1 << 31 : 0x00000000 00000000 00000000 00000000 10000000 00000000 00000000 00000000
    //0x1 << 32 : 0x00000000 00000000 00000000 00000001 00000000 00000000 00000000 00000000
    //0x1 << 33 : 0x00000000 00000000 00000000 00000010 00000000 00000000 00000000 00000000
    //0x1 << 34 : 0x00000000 00000000 00000000 00000100 00000000 00000000 00000000 00000000

    return 0;
}

FreeBSD + omake 後日談

FreeBSD / omake -P raises Fatal error: exception Invalid_argument("FAM not enabled") - flothの日記
lnやら力技で対処したバイナリを使ってたけど、気になったから後追い。

$ cd /usr/ports/devel/omake
$ cd ./work/omake-0.9.8.5/
$ vim ./lib/configure/fam.om
  6 .STATIC:
...
 10     if $(equal $(OSTYPE), Win32)
 11         FAM_AVAILABLE = true
 12         FAM_CFLAGS = /DFAM_ENABLED /DFAM_PSEUDO
 13         export
 14     else
 15         # Unix
 16         ConfMsgChecking(for FAM)
 17
 18         # See if the FamOpen function exists
 19         FAM_AVAILABLE = $(and $(CheckHeader fam.h), $(CheckLib fam, FAMOpen))
 20
...

どうやら、CheckHeader/CheckLibが判定している模様。

$ grep -r CheckLib .
...
./lib/configure/Configure.om:public.CheckLib = $(CheckCLib)
...

$ grep -r CheckCLib .
...
./lib/configure/Configure.om:public.CheckCLib(libs, funs) =
...

$ vim ./lib/configure/Configure.om
270 public.CheckCLib(libs, funs) =
271     CFLAGS += $(addprefix -l, $(libs))
272
273     return $(TryLinkC $"""
274 #ifdef __cplusplus
275 extern "C"
276 #endif
277 #pragma warning( disable : 4100 )
278 /* Override any gcc2 internal prototype to avoid an error.  */
279 $(add-wrapper $(nl)extern char , $'();', $(funs))
280 int main(int argc, char **argv) {
281     /* Usage */
282 $(add-wrapper $(nl)    , $'();', $(funs))
283     return 0;
284 }
285 """)

182 TryLinkC(prog) =
183     return $(TryCompilingC $(CC) $(ConfCleanCFLAGS $(CFLAGS)) $(PREFIXED_INCLUDES), $(LDFLAGS), $(EXE), $(prog), None)

136 TryCompilingC(command, command_suffix, ext, prog, extra) =
137     # The command line
138     tmp_c = $(file $(tmpfile omake, .c))
139     tmp = $(file $(replacesuffixes .c, $"$(EMPTY)", $(tmp_c)))
140
141     if $(and $(not $(equal $(CCOUT), $(LDOUT))), $(equal $(ext), $(EXE)))
142         command[] += $(CCOUT)$(file $(tmp)$(EXT_OBJ)) $(LDOUT)$(file $(tmp)$(ext))
143         export
144     else
145         command[] += $(CCOUT)$(file $(tmp)$(ext))
146         export
147
148     command[] += $(file $(tmp_c)) $(command_suffix)
149
150     # The program
151     program = $"""/* Configuration file; you can remove this. */
152 /* Command line: $(command) */
153 $(prog)
154 """
155
156     # Compile it
157     fprint($(tmp_c), $(program))
158     protected.result = $(shell-success-null $(command))
159
160     if $(result)
161         switch $(extra)
162         case Runs
163             result = $(shell-success-null $(file $(tmp)$(EXE)))
164             export
165         case Output
166             result =
167                 try
168                     value $(shell $(file $(tmp)$(EXE)))
169                 default
170                     value $(not true)
171             export
172         export
173
174     # Remove temporaries
175     rm -f $(tmp_c) $(tmp)$(EXT_OBJ) $(tmp)$(EXE)
176
177     return $(result)

実際にコンパイルして、ライブラリが使えるか確かめているようだ。
果たしてそれがスマートなのか否かは分からない。
見た限りではLDFLAGS/CFLAGS共に、適切に扱われている。
これなら何のことは無い、LDFLAGS/CFLAGSに-L/usr/local/lib|-I/usr/local/includeを指定してやればいいだけじゃないか。
と言うわけで、/etc/make.confにはあまりいろいろ詰めたくないから、cd /usr/ports/devel/omake && sudo LDFLAGS=-L/usr/local/lib CFLAGS=-I/usr/local/include make install clean らへんで作り直し。

FreeBSD8 wine(32bit) + winetricks

http://wiki.freebsd.org/Wineチュートリアルに従ってWineをインストールしたamd64環境で、winetrick云々のメモ

[***]$ winetricks 
wine: not found    
Cannot find wine (wine)
[***]$ WINE=wine32 winetricks 
wine32: not found              
Cannot find wine (wine32)

・・・。

[****]$ which wine32
wine32: aliased to LD_32_LIBRARY_PATH=/compat/i386/usr/local/lib PATH=/compat/i386/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/****/bin:/usr/local/kde4/bin:/usr/local/kde4/bin /compat/i386/usr/local/bin/wine

aliasだったことを思い出す。

[****]$ WINE=/compat/i386/usr/local/bin/wine winetricks
/libexec/ld-elf.so.1: Shared object "libwine.so.1" not found, required by "wine"
/libexec/ld-elf.so.1: Shared object "libwine.so.1" not found, required by "wine"
/compat/i386/usr/local/bin/wine cmd.exe /c echo '%ProgramFiles%' returned empty string
[****]$ LD_32_LIBRARY_PATH=/compat/i386/usr/local/lib PATH=/compat/i386/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/****/bin:/usr/local/kde4/bin:/usr/local/kde4/bin WINE=/compat/i386/usr/local/bin/wine winetricks                  
Cannot find cabextract.  Please install it (e.g. 'sudo apt-get install cabextract' or 'sudo yum install cabextract'). 

archivers/cabextractをmake install clean

[****]$ LD_32_LIBRARY_PATH=/compat/i386/usr/local/lib PATH=/compat/i386/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/****/bin:/usr/local/kde4/bin:/usr/local/kde4/bin WINE=/compat/i386/usr/local/bin/wine winetricks

ダイアログからcorefonts/d3dx9やらを選択

Executing wget -O arial32.exe -nd -c --read-timeout=300 --retry-connrefused --header Accept-Encoding: gzip,deflate http://internap.dl.sourceforge.net/sourceforge/corefonts/arial32.exe
....

FreeBSD8RC2 - weechat - /plugin load charset NOT FOUND :p

/usr/ports/irc/weechat # make configでCHARSETを有効にしても、出来上がったweechatから/plugin load charsetできない件
つまりiso-2022-jpが文字化けする。

そもそも、/usr/local/lib/weechat/plugins/にcharset.soが無い。
irc/weechat/Makefileを見ると、--disable-charsetとか香ばしそうなargが。
workaround的には全削除。

-.if !defined(WITHOUT_CHARSET)
-CONFIGURE_ARGS+=       --disable-charset
-PLIST_SUB+=    CHARSET="@comment "
-.else
-PLIST_SUB+=    CHARSET=""
-.endif
$ weechat-curses
...
11:58:51 weechat     |   ___       __         ______________        _____
11:58:51 weechat     |   __ |     / /___________  ____/__  /_______ __  /_
11:58:51 weechat     |   __ | /| / /_  _ \  _ \  /    __  __ \  __ `/  __/
11:58:51 weechat     |   __ |/ |/ / /  __/  __/ /___  _  / / / /_/ // /_
11:58:51 weechat     |   ____/|__/  \___/\___/\____/  /_/ /_/\__,_/ \__/
11:58:51 weechat     | Welcome to WeeChat, the geekiest chat client!
11:58:51 weechat     | WeeChat 0.3.0 [compiled on Nov  8 2009 11:40:31]
11:58:51 weechat     | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
11:58:51 weechat     | Plugins loaded: alias, charset, fifo, irc, logger, python, xfer
...
11:58:55      test  -- | - 6月11日のirc.mediaのハード障害を受けて、irc-new.mediaと

LANG=ja_JP.UTF-8の設定を忘れずに。