This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -x | |
GITLAB_URL='http://ec2-xx-xx-xx-xx.ap-northeast-1.compute.amazonaws.com:81' | |
# docker | |
sudo apt-get update | |
sudo apt-get install -y libsqlite3-dev | |
sudo apt-get install -y docker.io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# カーネルパニックで再起動する | |
kernel.panic = 10 | |
# tcp | |
# net.ipv4.tcp_tw_recycle = 1 # LB以下で使うと副作用あり?/でもtimestamp=0で指定すれば問題なさそう? | |
net.ipv4.tcp_tw_reuse = 1 | |
net.ipv4.tcp_fin_timeout = 5 | |
# ソケットあたりのメモリチューニング | |
# データ受信バッファ サイズ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'optparse' | |
require 'aws/rikanjo/base' | |
module Aws | |
module RiKanjoo | |
class CLI | |
def initialize | |
@options = {} | |
@optparse = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hoge | |
class Fuga | |
end | |
end | |
module Hoge | |
module Fuga | |
class Piyo | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use WebService::Dropbox; | |
my $app = '/'; | |
my $dropbox = WebService::Dropbox->new({ | |
key => 'xxxxxx', # App Key | |
secret => 'xxxxxx' # App Secret | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example: | |
# perl ikachan_color_notice.pl ikachan-server.com \#main '%{red:hoge}%fuga%{yellow:piyo}%e' | |
# screenshot: | |
# http://gyazo.com/b7cb0bc5013b724d6ddbb9bf983a8ffa | |
use strict; | |
use warnings; | |
use LWP::UserAgent; | |
my $usage = 'usage: ikachan_color_notice.pl <host> <channel> <message>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Web::Scraper; | |
use URI; | |
my $uri = URI->new('http://www.lgtm.in/g'); | |
my $scraper = scraper { | |
process '//input[@id="imageUrl"]', 'image_url' => '@value'; | |
process '//input[@id="dataUrl"]', 'data_url' => '@value'; | |
}; | |
my $result = $scraper->scrape($uri); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
while [ ! -e /dev/sdb ]; do echo Waiting for Ephemeral Disk to attach; sleep 5; done | |
if ! `df | grep -q /media/ephemeral0` ; then | |
mkfs.ext3 /dev/sdb | |
mount -t ext3 /dev/sdb /media/ephemeral0 | |
fi | |
# snip... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### | |
T 172.31.22.82:46389 -> 172.31.17.27:3000 [AP] | |
GET /engine.io/?EIO=2&transport=polling HTTP/1.1. | |
User-Agent: node-XMLHttpRequest. | |
Accept: */*. | |
Host: 172.31.17.27:3000. | |
Connection: close. | |
. | |
## |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from flask import Flask | |
app = Flask(__name__) | |
app.config['DEBUG'] = True | |
import boto.sqs | |
AWS_ACCESS_KEY = 'xxxxxxxxxxxxxx' | |
AWS_SECRET_KEY = 'xxxxxxxxxxxxxx' | |
class SqsClient(object): |