gentoo + OpenSIPS + tls でハマる

keyword:[はてなダイアリー:detail]

いつものようにTLS付きでOpen SIPSをビルドして問題なかったが、
Gentoo Linuxでは次のようなエラーが出てビルドできない。

Compiling tls/tls_init.c
tls/tls_init.c: In function ‘set_ec_params’:
tls/tls_init.c:383:3: error: unknown type name ‘EC_KEY’
tls/tls_init.c:383:3: warning: implicit declaration of function ‘EC_KEY_new_by_curve_name’ [-Wimplicit-function-declaration]
tls/tls_init.c:383:18: warning: initialization makes pointer from integer without a cast [enabled by default]
tls/tls_init.c:392:3: warning: implicit declaration of function ‘EC_KEY_free’ [-Wimplicit-function-declaration]
Makefile.rules:25: recipe for target 'tls/tls_init.o' failed
make: *** [tls/tls_init.o] Error 1

調べてみるとopenssl/ec.hが何故かシステムにインストールされていない。

equery belongs ec.h

ググってみると

http://forums.gentoo.org/viewtopic-t-854118-view-previous.html?sid=cac7cb9bbeafb1feae55f0345b8e5761

どうやら、どこかのサイトを参考にして、意味もわからず設定していたbindistという言うUSEFLAGが問題を起こしていた模様。
調べてみると、外部へのバイナリ配布用のオプションらしくて、自分には不要だったので、さくっとmake.confから削除。いつものうどんワールドを実行したら無事入りました。

sudo emerge -uDNp world

cygwinにapt-cygを導入

Cygwinに追加パッケージを導入する場合、setup.exeを起動して導入する必要があるが、
わざわざ呼び出すのが面倒。
そこで、コマンドラインからDebian系のaptに似たコマンド apt-cyg を導入してみる。

cd /usr/src
git clone  https://github.com/kou1okada/apt-cyg.git
cd /usr/local/bin/
ln -s /usr/src/apt-cyg/apt-cyg

基本は下記のコマンド。

"apt-cyg find " :検索
"apt-cyg install " :インストール

詳細はヘルプに記載

$ apt-cyg --help
apt-cyg: Installs and removes Cygwin packages.
  "apt-cyg install <package names>" to install packages
  "apt-cyg remove <package names>" to remove packages
  "apt-cyg update" to update setup.ini
  "apt-cyg show" to show installed packages
  "apt-cyg find <patterns>" to find packages matching patterns
  "apt-cyg describe <patterns>" to describe packages matching patterns
  "apt-cyg packageof <commands or files>" to locate parent packages
  "apt-cyg pathof <cache|mirror|mirrordir|cache/mirrordir|setup.ini>"
                                                          to show path
  "apt-cyg key-add <files> ..." to add keys contained in <files>
  "apt-cyg key-del <keyids> ..." to remove keys <keyids>
  "apt-cyg key-list" to list keys
  "apt-cyg key-finger" to list fingerprints
  "apt-cyg upgrade-self" to upgrade apt-cyg
  "apt-cyg depends <package names>"
         to show forward dependency information for packages with depth.
  "apt-cyg rdepends <package names>"
         to show reverse dependency information for packages with depth.
  "apt-cyg completion-install" to install completion.
  "apt-cyg completion-uninstall" to uninstall completion.
  "apt-cyg mirrors-list" to show list of mirros.
  "apt-cyg benchmark-mirrors <url> ..." to benchmark mirrors.
  "apt-cyg benchmark-parallel-mirrors <url> ..." to benchmark mirrors in parallel.
  "apt-cyg benchmark-parallel-mirrors-list" to benchmark mirrors-list in parallel.
Options:
  --charch <arch>          : change archetecture
  --use-setuprc            : set cache and mirror with /etc/setup/setup.rc
  --ignore-case, -i        : ignore case distinctions for <patterns>
  --force-remove           : force remove
  --force-fetch-trustedkeys: force fetch trustedkeys
  --no-verify, -X          : Don't verify setup.ini signatures
  --no-check-certificate   : Don't validate the server's certificate
  --proxy, -p <auto|inherit|none|URL> :
                             set proxy (default: ${APT_CYG_PROXY:-auto})
  --completion-get-subcommand:
                             get subcommand (for completion internal use)
  --completion-disable-autoupdate:
                             disable completion autoupdate
  --max-jobs, -j <n>       : Run n jobs in parallel
  --mirror, -m <url>       : set mirror
  --cache, -c <dir>        : set cache
  --file, -f <file>        : read package names from file
  --noupdate, -u           : don't update setup.ini from mirror
  --ipv4, -4               : wget prefer ipv4
  --help
  --version

MacでiOSデバイス上のパケットをキャプチャする

MaciOSバイス上のNICをRemote Virtual Interfaceとして認識させてパケットキャプチャが取れる。

1) USBでiOSバイスを接続。事前にiOSバイスのUUIDをメモっておく。
2) インターフェイスの確認(※以下 Macのターミナルで実行)

$ ifconfig -l

3)下記コマンドでInterfaceを追加する

$ rvictl -s <対象デバイスのUUID>

4)もう一度インターフェイス一覧を確認。インターフェイス「rvi0」が増えるはず。

$ ifconfig -l

5)tcpdumpコマンドでパケットキャプチャ。wiresharkで開くことができる(開くとき警告がでるけどとりあえず無視)

$ sudo tcpdump -i rvi0 -n -s 0 -w ~/`date +"%Y%m%d_%k%M%s"`.pcap

6)作業が終了し、インターフェイスが不要になれば次のコマンドでインターフェイスを削除できる。

$ rvictl -x <対象デバイスのUUID>

参考:
https://developer.apple.com/library/mac/qa/qa1176/_index.html#//apple_ref/doc/uid/DTS10001707-CH1-SECIOSPACKETTRACING

Windows8でスタート画面のショートカットを作成

ユーザー単位の場合は下記のディレクトリにショートカットを作成することで「スタート」画面の「すべてのアプリ」に表示されるようになる。
右クリック→ピン留めでスタート画面に表示される。

C:\Users\[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs