Skip to content

Instantly share code, notes, and snippets.

View rch850's full-sized avatar
:shipit:
Delivery every week

rch850 (りちゃ) rch850

:shipit:
Delivery every week
View GitHub Profile
#!/bin/sh -eu
timeout=30
since=15
function usage() {
cat >&2<<EOT
Usage: $(basename $0) [-s since] [-t timeout] PATH...
EOT
var AWS = require("aws-sdk");
AWS.config.loadFromPath("./config.json");
var kinesis = new AWS.Kinesis();
var params = {
StreamName: "rch850-stream",
PartitionKey: i + "",
Data: new Buffer("oisiiryokucha" + i).toString("base64"),
};
var AWS = require("aws-sdk");
AWS.config.loadFromPath("./config.json");
var kinesis = new AWS.Kinesis();
kinesis.describeStream({
StreamName: "rch850-stream"
}, function(err, data) {
var startingSequenceNumber = data.StreamDescription.Shards[0].SequenceNumberRange.StartingSequenceNumber;

Elastic Beanstalk で node.js のサーバ立てたときの様子。

80 番ポートへのアクセスはできる。

$ curl -I http://localhost:80/
HTTP/1.1 200 OK
Server: nginx/1.4.3
Date: Wed, 16 Apr 2014 02:19:18 GMT
Connection: keep-alive
@rch850
rch850 / iPhoneFiddlerUsage.md
Last active August 29, 2015 14:01
FiddlerでiPhoneのSSL通信を読む

導入:

  • http://getfiddler.com/ から Fiddler をインストールする
  • [Tools] > [Fiddler Options] を開いて
    • [HTTPS] タブで Decrypt HTTPS traffic ...from remote client only にチェックを入れる。Decrypt するときに聞かれる Yes/No は No
    • [Connections] タブで Allow remote computers to connect にチェックを入れる
  • 設定後、Fiddlerを再起動する
  • 終わったら、iPhone 側でプロキシを設定する。IPは自分のマシン、ポートは8888
  • Safari を起動し、http://ipv4.fiddler:8888 にアクセス
  • そこでルートCA証明書をインストールして、だいたい終わり
@rch850
rch850 / i-want-this-bucket.sh
Created May 26, 2014 09:46
I want this bucket
#!/bin/sh
# sh i-want-this-bucket.sh bucket-name region-name
while :; do
date
aws s3api create-bucket --bucket $1 --create-bucket-configuration LocationConstraint=$2 && break
sleep 60
done
@rch850
rch850 / push-f-pr.md
Last active August 29, 2015 14:02
push -f for merge requests, pros and cons.

I like to do push -f of branch for merge request.

pros

  • can squash unnecessary 'fix bug' commit of following branch. 'fix bug' commit does not fix bug of original branch so it should be squashed.
    • 'add feature xxx'
    • 'fix bug of feature xxx'

cons

@rch850
rch850 / CCSInjectionVulnerabilitySummary.md
Last active August 29, 2015 14:02
CCS Injection Vulnerability ざっくり

ブラウザからの閲覧についての影響は小さい

クライアント、サーバの両方が OpenSSL を使っていて、かつ脆弱なバージョンのときだけ攻撃できる。 メジャーなブラウザは OpenSSL を使っていないらしい(参考:ssl - which browser is using openssl - Stack Overflow)。 よって、ブラウザからの閲覧についての影響は小さい。

ではどういう時が対象なのか?

例えば、ウェブサイトが何らかの Web API を使っていて、ウェブサイトのサーバと API が脆弱な OpenSSL を使っている場合は対象となる。

git clone https://github.com/keiko713/rails-todo.git
cd rails-todo
bundle install --without production
foreman run bundle exec rake db:migrate
foreman start
@rch850
rch850 / LoggerLister.java
Created March 18, 2015 05:42
LoggerLister
import java.util.Iterator;
import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.Appender;
public class LoggerLister {