2013-08-01から1ヶ月間の記事一覧

sshログインの秘密鍵を複数管理

$HOME/.ssh/config に記載 Host xxxx IdentityFile ~/.ssh/id_rsa-xxxx Host yyyy IdentityFile ~/.ssh/id_rsa-yyyyのようにして管理できる。

キーボードを消す

resignFirstResponderにてフォーカスを解除。で表示されたキーボードが非表示となる。

xcodeのエディタに行番号を表示

mac

Xcode -> Preferences -> Text Editingタブ -> Line numbersにチェック

配列型へのデータ移行

パフォーマンス対策の為、敢えて非正規化を行い配列型で持つ配列型カラムの追加 alter table hoge add foo_ids intger[]; データ移行 array型でhogeテーブルに紐づくrecordを配列化する update hoge set foo_ids = array( select foo_id from foo f where f.…

tcpdumpファイルをmac wiresharkに取り込む

tcpdump # tcpdump -i eth0 -n tcp port 80 -w ./tcpdump.logwireshark 起動時にx11のインストールを求められるので、インストール。 でmacを再起動して、wiresharkを起動。x11インストール先を問われるのでアプリケーション/ユーティリティを指定。 wiresha…

汎用ビューを使う

一覧や詳細は汎用viewを使いurls.pyに記述することが可能。 from django.conf.urls import patterns, include, url from django.views.generic import DetailView, ListView urlpatterns = patterns('', url(r'^$', ListView.as_view( queryset=modelname.ob…

view定義からURLパターンを取得

urls.pyにこう記載がある時に urlpatterns = patterns('', url(r'^myappli/(?P<id>\d+)/$', 'appli.views.methodname'), ) viewで from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect return HttpResponseRedirect( re</id>…

gmail Network is unreachable

postfixにこんなログが。 postfix/smtp[24897]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400e:c03::1a]:25: Network is unreachableipv6で接続を求められているようなので、main.cfを #inet_protocols = all inet_protocols = ipv4としてみる。

gcm canonical_idでハマる

同一端末で違ったregistration_idが払い出されるのね。 しかも前回払い出されたidも一定期間は有効だとか ( canonicalなIDは「これ」だよのレスポンスあり 。) http://developer.android.com/google/gcm/adv.html#canonicalつーことは、IMEIなりandroid_idな…