2013年1月29日火曜日

Huawei 新モデル E586 モバイル

を買ってみた
所謂、SIMフリーの無線LANルータ

2013年1月20日日曜日

ettercapで中間者攻撃(MITM)

やり方は簡単
以下のようにして192.168.0.2,192.168.0.11間のメッセージに割り込める
ettercap -Tq -M arp /192.168.0.2/ /192.168.0.11/
インターフェイスは-Tのテキスト、-Cのcurses、-GのGtkと選べる

tcpflowで覗いてみる
tcpflow -cse -i eth0 dst port 80
-c コンソールに出力
-s 印字できないもじは.へ変換
-e カラー表示
-i インターフェイス指定


PS vitaのUserAgent

Vitaのユーザーエージェントを調べてみました

2013年1月14日月曜日

マウスオーバーで単語検索

英単語を調べるときとかでも便利
翻訳もできる

1.Greasemonkeyをインストール

2. スクリプトを追加(以下URLのINSTALL)
http://userscripts.org/scripts/show/12901

alt押しながら単語選択で検索
alt+yで設定

参考リンク
http://mozilla-remix.seesaa.net/article/80993858.html
http://www.simplivillage.com/trac/wiki/Userscript/FastLookupJPandEN

2013年1月7日月曜日

gistをgitで更新する

gistは普通にgit clone してpushできます

リポジトリが以下のURLだったら
https://gist.github.com/1234567
※非公開リポジトリの場合はもっと長いです

以下のコマンドでCloneできます
git clone git@gist.github.com:1234567

あと知っておくと便利な小技として
以下のようにするとhogefileのみ貼り付けできます
<script src="https://gist.github.com/1234567.js?file=hogefile"></script>

PS vitaエラーコード一覧

https://gist.github.com/raw/4140449/PS%20Vita

http://gamegaz.com/2013010310456/

2013年1月5日土曜日

digコマンドを理解する


* usage
dig [@server] domain [query-type]

* query-type
a (Aレコード)
any (任意の情報)
mx (MXレコード)
ns (NSレコード)
soa (SOAレコード)
hinfo (HINFOレコード)
axfr (ゾーン転送)
txt (TXTレコード)

* status
NOERROR (正常)
NXDOMAIN (ドメインは存在しない)
SERVFAIL (サーバの応答エラー)

* flags
qr (クエリの回答)
aa (権威ある回答)
tc (TCPフォールバック)
ra (フルサービスリゾルバ)
rd (再帰要求,+norecオプションで消える)

参考リンク
http://d.hatena.ne.jp/japanrock_pg/20090410/1239355230
http://www.syon.co.jp/syontech/tech002.html

2013年1月2日水曜日

大量のデータをAmazonのストレージに置くサービス

Amazon Glacier
というらしいS3よりいいのかな

PCを破棄したくなったら

ごみパソに送りつけると良いらしい
http://www.53pc.com/hikitori/index.html

postfix & dovecotを特定ユーザのみログイン可能にする


/etc/pam.d/dovecot
/etc/pam.d/smtp(無かったら作る)
を以下のの内容にした
hogeuserのみログインを許す設定
#%PAM-1.0

@include common-auth
account required pam_succeed_if.so user = hogeuser
@include common-account
@include common-session


設定を変更したら再起動を忘れずに
/etc/init.d/saslauthd restart

その他pamモジュールの詳しい使い方は
man pam_listfile
みたいにする

あとログを見ればpamで使うサービス名を特定できた

参考リンク
http://wiki.debian.org/PostfixAndSASL
http://d.hatena.ne.jp/hiro-ueda/20090901/1251811629
http://www.usupi.org/sysad/105.html
http://www.usupi.org/sysad/106.html

apacheのログをsyslogにも出す


        CustomLog ${APACHE_LOG_DIR}/access.log combined
        CustomLog "|/usr/bin/logger -p local6.info --" combined

参考リンク
http://d.hatena.ne.jp/oratta/20101121/1290341166

postfixでバーチャルドメイン

postfixでバーチャルドメイン

参考リンク
http://tmtm.org/postfix/tutorial/virtual.html
http://bitwalker.dtiblog.com/blog-entry-151.html

smtp-authの設定(Postfix)


1. saslインストール
aptでsasl2-binを入れる

2. postfixの設定(main.cf)
#mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = smtpd
smtpd_recipient_restrictions =  permit_sasl_authenticated, reject_unauth_destination
mynetworksからはauth無しで許可する場合はコメント外してもOK

3. postfixの設定(master.cf)
ポイントはchrootをnにすること
しないとsocketを見つけられないのでエラーになる
submission inet n       -       n       -       -       smtpd
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject

4.グループへ参加
adduser postfix sasl

5. smtpd.conf追加
sasl/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login

参考リンク
http://www.docunext.com/wiki/Postfix#Postfix_and_SASL
http://www.uetyi.mydns.jp/wordpress/postfix-setting/entry-465.html