2012年6月15日金曜日

init.elを書く

(line-number-mode t)
(column-number-mode t)
(add-hock 'c-mode-common-hook
    '(lambda c)
    (c-set-style "k&r")
    (setq indent-tabs-mode nil)
    (setq c-basic-offset 4)
    )

(global-set-key "\C-h" 'delete-backword-char)
(keyboard-translate ?^C-h ?\C-?)
(global-set-key "\C-h" nil)

2011年11月22日火曜日

メモリ状況確認データベース on django

メモリ状況の確認用にデータベースを作成してみた。

とりあえず置く場所がないので、ここにおいて置く。

https://docs.google.com/leaf?id=0B1MgkgXdknGtOGI4OTQzNDItMjU1Ny00ZTY3LWIzNDEtMjMzY2YxNzRiMDc0&hl=en_US

そのうちちゃんとした場所に移動したい。

2011年11月10日木曜日

emacsでhelloworld(oneliner)

emacsでonelinerって書けるんだ。
知らなかった。。。

[aadimstx@localhost local]$ emacs --batch  --eval '(progn (princ "Hello, World!")(terpri))' 2> /dev/null
Hello, World!

rubyでhelloworld

rubyでhelloworld(oneliner)
[aadimstx@localhost local]$ ruby -e 'print "hello world!\n"'
hello world!

perlでhelloworld

perlでhelloworld(oneliner)
[aadimstx@localhost local]$ perl -e 'print("hello world!\n");'
hello world!

pythonでhelloworld

pythonでhelloworld(oneliner)
[aadimstx@localhost local]$ python -c "print 'hello world'"
hello world

telnetでircに接続して"hello world!"って言ってみる

接続して"hello world!"って言ってみた。
言った側
[aadimstx@localhost local]$ telnet 127.0.0.1 6667
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
NICK aadimstx
USER aadimstx 8 * : sorted
:irc.example.net 001 aadimstx :Welcome to the Internet Relay Network aadimstx!~aadimstx@localhost.localdomain
:irc.example.net 002 aadimstx :Your host is irc.example.net, running version ngircd-18 (i686/pc/linux-gnu)
:irc.example.net 003 aadimstx :This server has been started Thu Nov 10 2011 at 04:26:12 (JST)
:irc.example.net 004 aadimstx irc.example.net ngircd-18 aciorswx biIklmnoOPstvz
:irc.example.net 005 aadimstx RFC2812 IRCD=ngIRCd CASEMAPPING=ascii PREFIX=(ov)@+ CHANTYPES=#&+ CHANMODES=bI,k,l,imnPst CHANLIMIT=#&+:10 :are supported on this server
:irc.example.net 005 aadimstx CHANNELLEN=50 NICKLEN=9 TOPICLEN=490 AWAYLEN=127 KICKLEN=400 PENALTY :are supported on this server
:irc.example.net 251 aadimstx :There are 1 users and 0 services on 1 servers
:irc.example.net 254 aadimstx 1 :channels formed
:irc.example.net 255 aadimstx :I have 1 users, 0 services and 0 servers
:irc.example.net 265 aadimstx 1 1 :Current local users: 1, Max: 1
:irc.example.net 266 aadimstx 1 1 :Current global users: 1, Max: 1
:irc.example.net 250 aadimstx :Highest connection count: 1 (5 connections received)
:irc.example.net 422 aadimstx :MOTD file is missing
JOIN #TheName
:aadimstx!~aadimstx@localhost.localdomain JOIN :#TheName
:irc.example.net 353 aadimstx = #TheName :@aadimstx
:irc.example.net 366 aadimstx #TheName :End of NAMES list
PRIVMSG #TheName : hello world!
JOIN #TheName
QUIT
:irc.example.net NOTICE aadimstx :Connection statistics: client 0.1 kb, server 1.3 kb.
ERROR :Closing connection
Connection closed by foreign host.
[aadimstx@localhost local]$ telnet 127.0.0.1 6667
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
NICK aadimstx
USER aadimstx 8 * : sorted
:irc.example.net 001 aadimstx :Welcome to the Internet Relay Network aadimstx!~aadimstx@localhost.localdomain
:irc.example.net 002 aadimstx :Your host is irc.example.net, running version ngircd-18 (i686/pc/linux-gnu)
:irc.example.net 003 aadimstx :This server has been started Thu Nov 10 2011 at 04:26:12 (JST)
:irc.example.net 004 aadimstx irc.example.net ngircd-18 aciorswx biIklmnoOPstvz
:irc.example.net 005 aadimstx RFC2812 IRCD=ngIRCd CASEMAPPING=ascii PREFIX=(ov)@+ CHANTYPES=#&+ CHANMODES=bI,k,l,imnPst CHANLIMIT=#&+:10 :are supported on this server
:irc.example.net 005 aadimstx CHANNELLEN=50 NICKLEN=9 TOPICLEN=490 AWAYLEN=127 KICKLEN=400 PENALTY :are supported on this server
:irc.example.net 251 aadimstx :There are 1 users and 0 services on 1 servers
:irc.example.net 254 aadimstx 1 :channels formed
:irc.example.net 255 aadimstx :I have 1 users, 0 services and 0 servers
:irc.example.net 265 aadimstx 1 1 :Current local users: 1, Max: 1
:irc.example.net 266 aadimstx 1 1 :Current global users: 1, Max: 1
:irc.example.net 250 aadimstx :Highest connection count: 1 (6 connections received)
:irc.example.net 422 aadimstx :MOTD file is missing
JOIN #TheName
:aadimstx!~aadimstx@localhost.localdomain JOIN :#TheName
:irc.example.net 353 aadimstx = #TheName :@aadimstx
:irc.example.net 366 aadimstx #TheName :End of NAMES list
PRIVMSG #TheName :hello world!
:TEST!~TEST@localhost.localdomain JOIN :#TheName
PRIVMSG #TheName :hello world!
QUIT
:irc.example.net NOTICE aadimstx :Connection statistics: client 0.1 kb, server 1.4 kb.
ERROR :Closing connection
Connection closed by foreign host.
[aadimstx@localhost local]$ 



言われた側
[aadimstx@localhost local]$ telnet 127.0.0.1 6667
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
NICK aadimstx
USER aadimstx 8 * : sorted
:irc.example.net 001 aadimstx :Welcome to the Internet Relay Network aadimstx!~aadimstx@localhost.localdomain
:irc.example.net 002 aadimstx :Your host is irc.example.net, running version ngircd-18 (i686/pc/linux-gnu)
:irc.example.net 003 aadimstx :This server has been started Thu Nov 10 2011 at 04:26:12 (JST)
:irc.example.net 004 aadimstx irc.example.net ngircd-18 aciorswx biIklmnoOPstvz
:irc.example.net 005 aadimstx RFC2812 IRCD=ngIRCd CASEMAPPING=ascii PREFIX=(ov)@+ CHANTYPES=#&+ CHANMODES=bI,k,l,imnPst CHANLIMIT=#&+:10 :are supported on this server
:irc.example.net 005 aadimstx CHANNELLEN=50 NICKLEN=9 TOPICLEN=490 AWAYLEN=127 KICKLEN=400 PENALTY :are supported on this server
:irc.example.net 251 aadimstx :There are 1 users and 0 services on 1 servers
:irc.example.net 254 aadimstx 1 :channels formed
:irc.example.net 255 aadimstx :I have 1 users, 0 services and 0 servers
:irc.example.net 265 aadimstx 1 1 :Current local users: 1, Max: 1
:irc.example.net 266 aadimstx 1 1 :Current global users: 1, Max: 1
:irc.example.net 250 aadimstx :Highest connection count: 1 (5 connections received)
:irc.example.net 422 aadimstx :MOTD file is missing
JOIN #TheName
:aadimstx!~aadimstx@localhost.localdomain JOIN :#TheName
:irc.example.net 353 aadimstx = #TheName :@aadimstx
:irc.example.net 366 aadimstx #TheName :End of NAMES list
PRIVMSG #TheName : hello world!
JOIN #TheName
QUIT
:irc.example.net NOTICE aadimstx :Connection statistics: client 0.1 kb, server 1.3 kb.
ERROR :Closing connection
Connection closed by foreign host.
[aadimstx@localhost local]$ telnet 127.0.0.1 6667
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
NICK aadimstx
USER aadimstx 8 * : sorted
:irc.example.net 001 aadimstx :Welcome to the Internet Relay Network aadimstx!~aadimstx@localhost.localdomain
:irc.example.net 002 aadimstx :Your host is irc.example.net, running version ngircd-18 (i686/pc/linux-gnu)
:irc.example.net 003 aadimstx :This server has been started Thu Nov 10 2011 at 04:26:12 (JST)
:irc.example.net 004 aadimstx irc.example.net ngircd-18 aciorswx biIklmnoOPstvz
:irc.example.net 005 aadimstx RFC2812 IRCD=ngIRCd CASEMAPPING=ascii PREFIX=(ov)@+ CHANTYPES=#&+ CHANMODES=bI,k,l,imnPst CHANLIMIT=#&+:10 :are supported on this server
:irc.example.net 005 aadimstx CHANNELLEN=50 NICKLEN=9 TOPICLEN=490 AWAYLEN=127 KICKLEN=400 PENALTY :are supported on this server
:irc.example.net 251 aadimstx :There are 1 users and 0 services on 1 servers
:irc.example.net 254 aadimstx 1 :channels formed
:irc.example.net 255 aadimstx :I have 1 users, 0 services and 0 servers
:irc.example.net 265 aadimstx 1 1 :Current local users: 1, Max: 1
:irc.example.net 266 aadimstx 1 1 :Current global users: 1, Max: 1
:irc.example.net 250 aadimstx :Highest connection count: 1 (6 connections received)
:irc.example.net 422 aadimstx :MOTD file is missing
JOIN #TheName
:aadimstx!~aadimstx@localhost.localdomain JOIN :#TheName
:irc.example.net 353 aadimstx = #TheName :@aadimstx
:irc.example.net 366 aadimstx #TheName :End of NAMES list
PRIVMSG #TheName :hello world!
:TEST!~TEST@localhost.localdomain JOIN :#TheName
PRIVMSG #TheName :hello world!
QUIT
:irc.example.net NOTICE aadimstx :Connection statistics: client 0.1 kb, server 1.4 kb.
ERROR :Closing connection
Connection closed by foreign host.
[aadimstx@localhost local]$ 



とりあえずrecvできているのでOK。
ただ言われた側は最後PINGと言われたのにPONGと言わなかったので切られてしまいました。

ご参考:
http://oreilly.com/pub/h/1963
http://hiki.koubou.com/IRC/?IRCOverTelnet
http://tomocha.net/diary/?20030118#200301182
http://d.hatena.ne.jp/hirose31/20070417/1176796484