2016年1月23日土曜日

GitHubのコードを他サイトに貼る

GitHubのコードをGistのようにブログで表示する方法。

http://gist-it.appspot.com/

例えば

https://github.com/toshi-sakai/hellonode/blob/master/hello.js

のコードを表示するには、以下のHTMLを書く。
<script src="http://gist-it.appspot.com/github/toshi-sakai/hellonode/blob/master/hello.js"></script>

結果はこちら。


いいかもね。

オレオレ証明書の作り方

備忘録として。環境はCentOS6+OpenSSL。

$ openssl genrsa 2048 > test.key
$ openssl req -key test.key -new -x509 -days 3650 -out test.cer
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:JP
State or Province Name (full name) []:Tokyo
Locality Name (eg, city) [Default City]:Minato-ku
Organization Name (eg, company) [Default Company Ltd]:OreOre Co., Ltd.
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:www.example.com
Email Address []:
$ ls
test.cer  test.key
$ cat test.key test.cer > test.pem
$ ls
test.cer  test.key  test.pem

このtest.pemを使ってhaproxyのSSL Terminationを試してみよう。。。