]
トップ 最新 追記

Yukiharu YABUKI の tDiary



このtDiaryを検索します。

2013-09-03 [長年日記]

_ [Debian][Python] sitecustom.py

pythonで、システムワイドの設定を行う手の一つに sitecustom.py があるようだ。(see also (http://d.hatena.ne.jp/kakurasan/20101217/p1)

pythonの対話*1モードにおいて、ipythonのようなtab補完を効かせる設定(既出リンク)や、デフォルトエンコードを設定する(http://d.hatena.ne.jp/motie/20090615/sitecustomize20090615)などの設定*2は、もちろん手動でやってもいいが、Debian的には、Debconf でやるか、コマンドを作った方がいいのかしら?

import rlcompleter
import readline
readline.parse_and_bind ('tab: complete')

で、tab補完を有効にして

import sys
sys.getdefaultencoding()

とすると、'ascii' 返ってくる。毎回プログラムで宣言するというスタイルを取るのも一理あるが、site wide で utf8 に変更してもいいよねえ?

*1 インタラクティブ

*2 いまの時点で日本語を扱うなら、utf8が妥当か。


2013-09-21 [長年日記]

_ [Debian] perf in Wheezy

パフォーマンス測定ツールのperfですが、対応するパッケージが入っていないと

$ perf --version
/usr/bin/perf: 24 行: exec: perf_3.2: 見つかりません
E: linux-tools-3.2 is not installed.
という、メッセージが出て、足りないパッケージを教えてくれます。

そこで、足りないパッケージを補うわけです。

$ sudo apt-get install linux-tools-3.2
[sudo] password for yabuki: 
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
以下の特別パッケージがインストールされます:
  libdw1
提案パッケージ:
  linux-doc-3.2
以下のパッケージが新たにインストールされます:
  libdw1 linux-tools-3.2
アップグレード: 0 個、新規インストール: 2 個、削除: 0 個、保留: 0 個。
618 kB のアーカイブを取得する必要があります。
この操作後に追加で 1,509 kB のディスク容量が消費されます。
続行しますか [Y/n]? 
取得:1 http://cdn.debian.or.jp/debian/ wheezy/main libdw1 i386 0.152-1+wheezy1 [217 kB]
取得:2 http://cdn.debian.or.jp/debian/ wheezy/main linux-tools-3.2 i386 3.2.17-1 [402 kB]
618 kB を 1秒 で取得しました (371 kB/s)
以前に未選択のパッケージ libdw1 を選択しています。
(データベースを読み込んでいます ... 現在 472298 個のファイルとディレクトリがインストールされています。)
(.../libdw1_0.152-1+wheezy1_i386.deb から) libdw1 を展開しています...
以前に未選択のパッケージ linux-tools-3.2 を選択しています。
(.../linux-tools-3.2_3.2.17-1_i386.deb から) linux-tools-3.2 を展開しています...
man-db のトリガを処理しています ...
libdw1 (0.152-1+wheezy1) を設定しています ...
linux-tools-3.2 (3.2.17-1) を設定しています ...
という、風にインストールが進むわけです。

_ perf自体の使い方

perfの使いかた(http://int.main.jp/txt/perf/)を参照せよ。


2013-09-22 [長年日記]

_ [Debian] dgit

関西 Debian 勉強会に顔を出してきた。ALSAのお話を拝聴し、dgitのことを聞いていたら、Debian Developerでないと dgit は実行できないという。

それじゃあ、困るべなと。せめて実演するぐらいはガンバロウと。躓いていた点は、自分のアカウント名(yabuki)とDDのアカウント名(yyabuki)が違っていたこと。基本的に~/.ssh/config に

HOST *.debian.org
  USER yyabuki
ってのを追加しておけという、オチでした。
$ dgit clone etckeeper
canonical suite name for unstable is sid
fetching existing git history
remote: Counting objects: 2693, done.
remote: Compressing objects: 100% (809/809), done.
Receiving objects:   7% (189/2693), 36.00 KiB | 56.00 KiB/s
[snip!]
Receiving objects:  99% (2667/2693), 292.00 KiB | 24.00 KiB/s
Receiving objects: 100% (2693/2693), 292.00 KiB | 24.00 KiB/s
Receiving objects: 100% (2693/2693), 327.28 KiB | 24.00 KiB/s, done.
Resolving deltas: 100% (1859/1859), done.
From git+ssh://git.debian.org/git/dgit-repos/repos/etckeeper
 * [new ref]         refs/dgit/sid -> dgit/dgit/sid
 * [new tag]         debian/1.9 -> debian/1.9
From git+ssh://git.debian.org/git/dgit-repos/repos/etckeeper
 * [new tag]         debian/1.8 -> debian/1.8
downloading http://ftp.debian.org/debian//pool/main/e/etckeeper/etckeeper_1.9.dsc...
last upload to archive specified git hash
HEAD is now at def8d3a releasing package etckeeper version 1.9
dgit ok: ready for work in etckeeper
ってな感じ。branchは
$ git branch -a
* dgit/sid
  remotes/dgit/dgit/sid
$ dgit fetch wheezy
W: suite 'wheezy' not recognised.
E: No valid suite given.
no version available from the archive
dgit: package etckeeper does not exist in suite wheezy
wheezy は用意されてなかっかった。まあこれからですね。