h4c

ただのメモ

Install Postgresql10 on Amazon Linux

sudo yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-6-x86_64/pgdg-redhat10-10-2.noarch.rpm sudo sed -i "s/rhel-\$releasever-\$basearch/rhel-6.9-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo" sudo yum install …

Compiling Plim on the fly with Sublime Text

Put this on your packages directory of st. ex) $HOME/Library/Application\ Support/Sublime\ Text\ 2/Packages/PlimCompiler/plim_compiler.py import sublime, sublime_plugin import os import subprocess class PlimCompiler(sublime_plugin.EventLis…

convert python datetime to javascript

ff, chrome, IE それぞれ Date.parse の実装がまちまち。なので YYYY-mm-dd なんて渡すとバグの温床になる。面倒臭いが timestamp にしてから渡す。 python: import datetime, time d = datetime.datetime.utcnow() for_js = int(time.mktime(d.timetuple())…

CORSメモ

XHR2 送信側 JS: var xhr2 = new XMLHttpRequest(); xhr2.open("GET", "https://api.example.jp/xhr/"); xhr2.setRequestHeader("X-CSRF-Token", "r4nd0MStr1ng"); xhr2.withCredentials = "true"; xhr2.send 同一OriginでもXSSが無いとも限らないから付けと…

$resource on Angular

I recommend that you use $resource. It may support (url override) in next version of Angularjs. Then you will be able to code like this: // need to register as a serviceName $resource('/user/:userId', {userId:'@id'}, { 'customActionName': …

都道府県コード一覧

01 北海道 02 青森県 03 岩手県 04 宮城県 05 秋田県 06 山形県 07 福島県 08 茨城県 09 栃木県 10 群馬県 11 埼玉県 12 千葉県 13 東京都 14 神奈川県 15 新潟県 16 富山県 17 石川県 18 福井県 19 山梨県 20 長野県 21 岐阜県 22 静岡県 23 愛知県 24 三重…

Our Deepest Fear

Our Deepest Fear . . . - YouTube Our deepest fear is not that we are inadequate. Our deepest fear is that we are powerful beyond measure. It is our light, not our darkness That most frightens us. We ask ourselves Who am I to be brilliant, …

shellだけでURLエンコード/デコード

$ echo -n あいうえお|nkf -wMQ|tr = % %E3%81%82%E3%81%84%E3%81%86%E3%81%88%E3%81%8A $ echo -n '%E3%81%82%E3%81%84%E3%81%86%E3%81%88%E3%81%8A'|tr % =|nkf -WwmQ あいうえお

pcapからX509 SSL証明書を取り出す

(1) TCPの設定で "Allow subdissector to reassemble TCP streams" のチェックがONになっている事を確認。 (2) "Certificate" というSSLハンドシェイクメッセージが含まれるパケットを探す。 (3) パケット詳細パネルでSSLプロトコルを展開。 (4) TLSレコード…