Debian Linux に Skype をインストールする備忘録

http://www.skype.com/intl/ja/download/skype/linux/choose/
このページの Debian Etch クリックしてダウンロードできるdebパッケージは
こうなる
euboea% sudo dpkg -i skype-debian_2.0.0.72-1_i386.deb
dpkg: skype-debian_2.0.0.72-1_i386.deb.ng の処理中にエラーが発生しました (–install):
パッケージアーキテクチャ (i386) がシステム (amd64) と一致しません
以下のパッケージの処理中にエラーが発生しました:
skype-debian_2.0.0.72-1_i386.deb
Dynamicをダウンロードして解凍、skypeを実行すると
こうなる
euboea% ./skype
./skype: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory
euboea% locate libasound.so.2
/usr/lib/libasound.so.2
/usr/lib/libasound.so.2.0.0
euboea% ldd skype
linux-gate.so.1 => (0xffffe000)
[…]

[perl]TheSchwartzのWorkerにIDをつける

こういうときはどうやってやるのがいいのかなぁ
・なんか限れられた数のリソース(例えば、DISPLAYとか?、)があって、リソースにはTheSchwartzのWorkerを1対1対応させて、Workerを動かしたい
・Jobをinsertする方はどのWorkerに仕事させるか意識したくない
Jobをinsertする方はこんな
feeder.pl
PLAIN TEXT
PERL:

#!/usr/bin/env perl

use strict;

use warnings;

use FindBin;

use File::Spec;

use YAML::Syck;

use TheSchwartz;

 

my $conf = LoadFile( File::Spec->catfile($FindBin::Bin, '..', 'myapp.yml') );

my $pool = TheSchwartz->new( %{ $conf->{TheSchwartz}{args} } );

$pool->insert('MyApp::SleepWorker');

1;

0~9秒間の間でランダムな秒数寝るだけのWorkerを起動させるpl。
こいつを複数プロセス動かして、それぞれは自分に割り当てられてるリソースを知っている、っていう状態をつくりたい。
workの引数になんか入れてもだめっぽいので、、
worker.pl
PLAIN TEXT
PERL:

#!/usr/bin/env perl

use strict;

use warnings;

 

use FindBin;

use File::Spec;

use lib File::Spec->catfile( $FindBin::Bin, '..', 'lib' );

use YAML::Syck;

use TheSchwartz;

use MyApp::SleepWorker;

 

my $conf = LoadFile( File::Spec->catfile($FindBin::Bin, '..', 'myapp.yml') );

my $worker = TheSchwartz->new( %{ $conf->{TheSchwartz}{args} } );

$worker->can_do('MyApp::SleepWorker');

$worker->work;

 

1;

環境変数なのかなぁ
PLAIN TEXT
PERL:

package [...]

オープンソースなbittorrent-trackerまとめ

trackerとは、torrentファイルDLした後につなぎにいって、本体ファイルをDLするための接続先ピアの一覧を返すサーバ。
どれがいいんだろ
○公式bittorrentのbittorrent-trackerサーバ
 maybe slow..
 http://www.bittorrent.com/
 http://download.bittorrent.com/dl/
 pythonで動いてる
 ./bittorrent-tracker.py --port 6969 --dfile dstate
○apache2とmod_btの組み合わせ
 http://www.crackerjack.net/mod_bt/mod_bt.html
 裏でlibbttrackerを使用
 Net::BitTorrent::LibBT::Tracker これでそこにつなげるかも
○Net::BitTorrent::LibBT::Tracker 使って自前perlサーバ
 mod_bt の libbttrackerのperlから使う
○Open Tracker
 http://erdgeist.org/arts/software/opentracker/
 http://opentracker.blog.h3q.com/
 It aims for minimal resource usage and is intended to run at your wlan router.
○The Hydra Project
 A Distributed, private BitTorrent tracker framework with goals of:
 ... user privacy, anonymity, survivability & distributed ratio maintainability.
 The primary goal of this project is to replace the aging TorrentBits [...]

FlashPlayer10のP2P

Peer to Peer (P2P) in Flash Player 10 beta
ho-
利用シーンに関わる部分はここ。
Will RTMFP enable massive file-sharing applications through Flash Player 10 beta?
No. Large-scale file-sharing network applications rely on the ability to read from and write to the hard drive constantly to only load parts of files into memory when needed. In Flash Player 10 beta you can load [...]

[git]gitに入門してみた

svn使ってます
myappの下には、trunk, tags, branches がある状態
PLAIN TEXT
CODE:

git svn init -s https://path/to/myapp/ myapp

cd myapp

git svn fetch

これに時間かかる
PLAIN TEXT
CODE:

git checkout trunk

これがちょっぱやでびびるなぁ
編集した後、
PLAIN TEXT
CODE:

git add file1 file2 file3

git commit -m"[edited file1,2,3]"

ローカルへのコミットは気軽にしていいみたい
perlのcatalystアプリで、myapp_local.yml とかもろもろローカルで変更しているのがあるので、
そいつらがある状態で
svnにコミットしようとすると、
PLAIN TEXT
CODE:

Cannot dcommit with a dirty index.  Commit your changes first, or stash them with `git stash'.

って怒られる
PLAIN TEXT
CODE:

git stash

ってやるとmyapp_local.ymlとかdirtyなファイル達がどっかに退避されるみたい
そこで
PLAIN TEXT
CODE:

git svn dcommit

するとsvnにコミットできる
PLAIN TEXT
CODE:

git stash apply [...]

[skype api]skypeで電話をかけ指定のwavを再生して切断

skypeで電話をかけ指定のwavを再生して切断。
フレームレート16kHz、16bitサンプリングのwavを再生できる。
44.1kHzのはNGでした。
skypeは
DISPLAY=127.0.0.1:0.0
で立ち上がっている。
再生できるんだけど、
再生開始後の数秒間、音程が異常に崩れる。。
なんかおまじないがあるのかなぁ
PLAIN TEXT
PYTHON:

#!/usr/bin/python

# -*- coding: utf-8 -*-

 

# コマンドラインで指定したskypeidに電話をかける

 

import Skype4Py

import sys

import os

 

os.environ['DISPLAY'] = '127.0.0.1:0.0'

 

# This variable will get its actual value in OnCall handler

CallStatus = 0

 

# Here we define a set of call statuses that indicate a call has been either aborted or finished

CallIsFinished = set ([Skype4Py.clsFailed, Skype4Py.clsFinished, Skype4Py.clsMissed, Skype4Py.clsRefused, Skype4Py.clsBusy, Skype4Py.clsCancelled]);

 

def AttachmentStatusText(status):

   return skype.Convert.AttachmentStatusToText(status)

 

def CallStatusText(status):

    [...]