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
@rch850
rch850 / post-update
Created December 2, 2013 07:04
git push で node アプリ走らせる時のとりあえずスクリプト。なんかいいのあったら教えて
#!/bin/sh -eu
git update-server-info
APP_HOME=/home/rch850/hogeapp
APP_BRANCH=develop
PIDFILE=$APP_HOME/node.pid
export GIT_DIR=$APP_HOME/.git
(cd $APP_HOME && git --git-dir=.git pull && git checkout $APP_BRANCH)
import javax.crypto.Cipher;
import java.security.NoSuchAlgorithmException;
public class KeyLengthDetector {
public static void main(String[] args) {
String transformation = "AES";
if (args.length >= 1) transformation = args[0];
int allowedKeyLength = 0;
try {
@rch850
rch850 / s3apidoc.cmd
Last active December 31, 2015 05:09
apidoc でドキュメント作って S3 につっこむコマンド
@echo off
goto checkaws
::
:: apidoc のインストールチェック
::
cmd /C apidoc -h >NUL 2>&1
if not errorlevel 1 goto runapidoc
rem for ckw
start %~dp0ckw\ckw.exe -x "CMD /K cd %USERPROFILE%\git\myproj && set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25 && PATH=C:\Program Files\Java\jdk1.7.0_25\bin;%PATH%;C:\Ruby200\bin;%APPDATA%\npm;C:\Program Files\nodejs-v0.10.22"
rem for PowerShell
powershell -NoExit -Command "cd $env:USERPROFILE\git\myproj; $env:JAVA_HOME = \"C:\Program Files\Java\jdk1.7.0_25\"; $env:PATH = \"C:\Program Files\Java\jdk1.7.0_25\bin;$env:PATH;C:\Ruby200\bin;$env:APPDATA\npm;C:\Program Files\nodejs-v0.10.22\""

カレンダー共有

  • カレンダーの▼から[カレンダーの設定]を選ぶ
  • 上の方の[このカレンダーを共有]を押す
  • [このカレンダーを他のユーザーと共有する]にチェックを入れる
  • [このカレンダーを組織……]にチェックを入れ、[閲覧権限]を選ぶ
  • [保存]する
  • 再度カレンダーの設定を開き、下の方にある[カレンダーID]に書いてあるメールアドレスを相手に教える
  • 相手は、カレンダートップ右側の[他のカレンダー]の下にある入力欄に、教えてもらったメールアドレスを貼り付けてエンターを押す

AWS で動いている nginx のログを fluentd で S3 に転送している状態で、 ログを Elastic Search に飛ばして Kibana 3 で眺めるまでの流れ。

セキュリティグループを作る

  • 拠点からの80番と9200番を許可(443にできるなら443で)
  • ログを発生させるサーバからの9200番を許可

適当なEC2インスタンスを立てる

@rch850
rch850 / ltsv2csv.rb
Last active August 29, 2015 13:55 — forked from remore/ltsv2csv.rb
#!/usr/bin/ruby
require 'optparse'
separator = ","
source = false
ARGV.clone.options do |opts|
opts.banner = "Usage: #{$0} [options]"
opts.on('-f', '--file=/path/to/file', String, 'Source file'){|v|
source = v
# Reset max_connections
aws rds reset-db-parameter-group --db-parameter-group-name ENTERYOURS --parameters "ParameterName=max_connections,ApplyMethod=immediate"
# Enable All Cross-Zone Load Balancing
for lb in $(aws elb describe-load-balancers --query="LoadBalancerDescriptions[].LoadBalancerName" --output text); do
echo $lb
aws elb modify-load-balancer-attributes --load-balancer-name $lb --load-balancer-attributes '{"CrossZoneLoadBalancing":{"Enabled":true}}'
done
# Print my cf stack
log_format postdata '$time_local $request $request_body';
location = /path {
access_log /var/log/nginx/postdata.log postdata;
proxy_pass http://localhost:8080; # <= set your port
}