2013-08-01から1ヶ月間の記事一覧

Wiresharkをソースから入れるとヘッダファイルをインストールしてくれなくて困る

Wiresharkのtarball落としてきてmake installしてもヘッダファイルがインストールされない. Makefile.amを読んだ感じ,ヘッダファイルはインストールしないようにしてるっぽく,手動でやるしかないのかーと思っていると,emergeしたほうのWiresharkについて…

Hook after emerge

emergeした後にhookの設定ができたら便利だなーと思っていたら実はできました. Ref: https://forums-lb.gentoo.org/viewtopic-t-772340-start-0.html /etc/portage/bashrcにpost_pkg_postinstというfunctionを定義することで,各パッケージのインストール後…

ZNCでよく使うコマンド

ZNC

ZNCのコマンド ZNCは,IRCクライアントからコマンドで操作できます. /msg *status <command> のように,*statusに対してprivmsgを送ることで,ZNCにコマンドとして解釈してもらえます.コマンドの実行結果やZNCからのメッセージは*statusというウィンドウに表示され</command>…

PerlでCamelize/DeCamelize

sub camelize { (my $s = shift) =~ s/(?:^|_)(.)/\U$1/g; $s; } sub decamelize { my $s = shift; $s =~ s/(_)?((?:[A-Z](?![^A-Z]))+|[A-Z])/(pos($s)==0&&!$1?'':'_').lc($2)/ge; $s; } 普通にString::CamelCaseとか使えばいい話なんですが,スクリプト中…

Shellにおける二重括弧

Arithmetic expansionというらしい.'$(())'で囲った中身を数式として評価してくれる. $ echo $(( 1 + 1 )) 2 べき乗やビット演算も可.今まで数式をshell script中に書きたいときはexpr(1)を使ってたんですが,こちらの方が見やすくて便利ですね. $ echo …

Build ebuild package manually

Which fails to emerge. Applying own patch. With reference: https://www.gentoo.org/doc/en/handbook/2004.2/handbook-x86.xml?part=3&chap=6 ebuild(1) always requires .ebuild file as first argument, and action as second argument. Here's an exam…

Emacs Lispで部分適用

apply-partiallyを使う. (apply-partially FUN &rest ARGS) Return a function that is a partial application of FUN to ARGS. ARGS is a list of the first N arguments to pass to FUN. The result is a new function which does the same as FUN, excep…

firefoxのAdobeReaderがC:\nppdf32Log\debuglog.txtというファイル名を作る問題

Portageから入れたfirefoxのAdobeReaderプラグインが,firefoxを起動した時のカレントディレクトリに"C:\\nppdf32Log\\debuglog.txt"というファイルを作る問題について. この現象だいぶ前からある気がするんですが,前に対処したのがFirefoxのアップデート…