Get me outta here!

blog.delphinus.dev

vim とか Perl な話題とか……

Menu

Skip to content
  • プライバシーポリシー
  • perl
  • Vim
  • 映画
  • 投稿一覧
  • はじめに

Author Archives

delphinus

最新版GNU Screenで縦分割(その2〜設定ファイルについて〜)

2010年2月2日 by delphinus

Mac OS Xでやってみる

100202-0002.png

前回と同じことをSnow Leopardでやってみる。今度も最新ソースではやっぱりダメで、一つ前のものを持ってきた。

screen.git –
http://git.savannah.gnu.org/cgit/screen.git/commit/?id=a6eea7b4d6dd3e4385919b4a50a58688f9a6b52b

$ tar zxvf screen-a6eea7b4d6dd3e4385919b4a50a58688f9a6b52b.tar.gz
$ cd screen-a6eea7b4d6dd3e4385919b4a50a58688f9a6b52b/src
$ autoconf
$ autoheader
$ ./configure --prefix=/usr/local --enable-colors256
$ make && sudo make install

注意点は5行目のconfigure。CentOSの時は必要なかったのだが、今回は明示的に”--enable-colors256“を指定しないと、256色表示が有効にならなかった。

次は前回スルーした設定ファイルについて。

Continue reading →

screen Unix系OS 1 Comment

最新版GNU Screenで縦分割(その1〜導入編〜)

2010年2月1日 by delphinus

gitで最新ソースを手に入れる→失敗

表題のことをしようと思って最新ソースを手に入れることにした。まずはVMware上で使ってるCentOSでやってみる。

$ sudo yum install git
$ git clone git://git.savannah.gnu.org/screen.git
$ cd screen/src
$ autoconf
$ autoheader
$ ./configure --prefix=/usr/local
$ make && sudo make install

“autoconf”と”autoheader”でいろいろ警告が出たが無視して続行。無事インストールも出来たので早速起動すると……

$ /usr/local/bin/screen
[screen caught signal 11.]
$

……えっ!? なんか知らんが起動しない。でも.screenrcを削除してみると起動する。いろいろ試した結果、次の一文で落ちてることがわかった。

Continue reading →

screen Unix系OS Leave a comment

WindowsXP + 光回線だとWindows Updateできない?

2010年1月31日 by delphinus

上司からものすごく古いノートPCを渡されて、「遅くて使いもんにならんので何とかしろ」と言われた。何ともしようがないけど、とりあえずリカバリから始めてみたら驚いた。なんと無印XPのノートPCだったのだ。メモリも128MBしかないし、いったい何年前のものなんだか。

で、さすがに無印はまずいのでSPを当てようと思ったら、Windows Updateにつながらない。エラー番号で検索してみてまた驚いた。

特定のサイトに繋がらない – 教えて!goo
http://oshiete1.goo.ne.jp/qa3082381.html

少なくとも無印のXPでは光回線が使えなかったらしい。そうだったっけ? SP2の時代が長かったので、昔のことは忘れてしまった。書いてある通り、フリーウェアを使ってMTUを1500に書き換えて再起動。それでうまくいった。

窓の杜 – NetTune
http://www.forest.impress.co.jp/lib/inet/websupt/speedanlz/nettune.html

Windows Leave a comment

SyntaxHighlighterでYAMLをハイライトする

2010年1月31日 by delphinus

当然と言えば当然だが、TT2 のとき(その1、その2)よりは遙かに楽だった。

# サンプル
arg1: value1
arg2:
    -   [ value2, value3 ]
    -   arg3:
            - value4

修正・作成するファイルは2つ。

ファイル名
/mt/plugins/SyntaxHighlighter/lib/SyntaxHighlighter/Plugin.pm

        'html'=>'shBrushXml',
        'xhtml'=>'shBrushXml',
        'tt' => 'shBrushTT2',
        'tt2' => 'shBrushTT2',
# 前回の修正の直後に書き加える
        'yml' => 'shBrushYAML',
        'yaml' => 'shBrushYAML',
    );

ファイル名
/mt-static/plugins/SyntaxHighlighter/2.0/scripts/shBrushYAML.js

/* こっちは新たに作成する
   かなり大雑把だけど、一応の役には立つよね */
SyntaxHighlighter.brushes.YAML = function() {
    this.regexList = [
        { regex: /#.*$/gm,     css: 'comments' }
        ,{ regex: /\w+:/g,     css: 'keyword' }
        ,{ regex: /[^#:]+$/gm,    css: 'string' }
        ,{ regex: SyntaxHighlighter.regexLib.doubleQuotedString
            ,css: 'string' }
        ,{ regex: SyntaxHighlighter.regexLib.singleQuotedString
            ,css: 'string' }
    ];
};
SyntaxHighlighter.brushes.YAML.prototype
    = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.YAML.aliases
    = ['yml', 'yaml'];

最後にMTのHTMLヘッダーテンプレートを書き換えて完了だ。

<$mt:SyntaxHighlighterInclude brush="html,perl,jscript,bash,tt2,plain,sql,yaml" theme="default"$>
Movable Type SyntaxHighlighter Leave a comment

Catalyst + Lighttpd + FastCGI なテスト

2010年1月30日 by delphinus

CatalystのテストサーバをLighttpdで立ててくれるヘルパースクリプト。

Catalyst::Helper::Lighty にリスタート機能つけた – masaki@catalyst – Catalystグループ
http://catalyst.g.hatena.ne.jp/ikasam_a/20080318/1205778147

ヘルパーがあるおかげで操作は簡単。

// 事前にLighttpdとFastCGIをインストールしておく必要がある
// アプリを作成
$ catalyst.pl MyApp

// ヘルパーを実行
$ cd MyApp/script
$ ./myapp_create.pl Lighty

// テストサーバを起動......アレ?
$ ./myapp_lighty.pl
Type of arg 1 to Parallel::SubFork::sub_fork must be block or sub {} (not null operation) at ./myapp_lighty.pl line 75, near "&spawn_fastcgi )"
Execution of ./myapp_lighty.pl aborted due to compilation errors.

と言うわけでちょっとバグがある。ヘルパーモジュールLighty.pmを次のように編集する。

Continue reading →

catalyst perl Leave a comment

Static::SimpleとFormValidator::Simple::Auto

2010年1月29日 by delphinus

Catalyst::Plugin::Static::Simple
と、
Catalyst::Plugin::FormValidator::Simple::Auto
は同時に使えない……?(つーかモジュール名長すぎ)
エラーの意味が全然わかりませぬ(‘A`)

$ ./myapp_server.pl 
[debug] Debug messages enabled
[debug] Statistics enabled
[debug] Loaded plugins:
.----------------------------------------------------------------------------.
| Catalyst::Plugin::ConfigLoader  0.27                                       |
| Catalyst::Plugin::FormValidator::Simple  0.13                              |
| Catalyst::Plugin::FormValidator::Simple::Auto  0.18                        |
'----------------------------------------------------------------------------'

  〜中略〜

[info] MyApp powered by Catalyst 5.80007
Couldn't load class (MyApp) because: Inconsistent hierarchy during C3 merge of class 'MyApp': merging failed on parent 'Catalyst::Plugin::FormValidator::Simple::Auto' at /opt/local/lib/perl5/5.10.1/darwin-2level/mro.pm line 27.
Compilation failed in require at /opt/local/lib/perl5/site_perl/5.10.1/darwin-2level/Class/MOP.pm line 98.
 at /opt/local/lib/perl5/site_perl/5.10.1/darwin-2level/Class/MOP.pm line 102

  〜以下略〜

Continue reading →

catalyst perl Leave a comment

特定のメール(Outlook)を自動的に削除するスクリプト

2010年1月28日 by delphinus

社内で「特定人物向けのメールを全員に送信しちゃった! 何とかして!」と言われたときに作ったスクリプト。グループポリシーを使ってPCにログオンしたときに起動するように設定することを想定している。Outlookを自動的に起動して受信メールをチェックし、条件に合うもの(今回は特定の語句を題名に含むもの)を削除する。

Continue reading →

javascript WMI メール Leave a comment

Post navigation

← Older posts
Newer posts →

アカウントでログイン

最近の投稿

  • Moves API のための Perl モジュールを作りました 2013年9月11日
  • ロボットは僕に言った「君は人間じゃない」 2013年7月30日
  • 人は一生に何回キーを叩くんだろう? 2013年7月29日
  • 【Vim】カラースキームを切り替えるたった一つのさえたやりかた 2013年7月23日
  • 【WordPress】「前の記事」「次の記事」のリンクにサムネイルを付ける 2013年7月17日
  • 【Powerline】Git branch セグメントが Mac OS X で動かない? 2013年7月16日
  • 【Vim】80桁教信者の憂鬱 その2(ホットキーでトグル、他) 2013年6月24日
  • 【vim】80桁教信者の憂鬱 2013年6月20日
  • 【MacVim】メニューバーでアイコンが見えない! 2013年6月19日
  • 【unite.vim】set_substitute_pattern は衰退しました(その2) 2013年6月18日
Proudly powered by WordPress | Theme: Something Fishy by Caroline Moore.
blog.delphinus.dev
Proudly powered by WordPress | Theme: Something Fishy by Caroline Moore.