Skip to content

Instantly share code, notes, and snippets.

View toyama0919's full-sized avatar

Toyama Hiroshi toyama0919

View GitHub Profile
@toyama0919
toyama0919 / is_crawler.rb
Last active July 26, 2017 01:30
railsでcrawler、botのアクセスを制御する ref: http://qiita.com/toyama0919/items/52ffaeb6142c3770ed7a
# -*- coding: utf-8 -*-
def crawler? ua
crawler_ua = [
"crawler",
"bot",
"spider",
"YahooFeedSeeker",
"Y!J-(?:BSC|BRO|SRD)/",
"internal +dummy +connection",
"libwww",
@toyama0919
toyama0919 / gist:6047508
Created July 21, 2013 04:43
ElasticIpをVPCで発行するコマンド。 aws cliで使用。
aws ec2 allocate-address --domain vpc
@toyama0919
toyama0919 / gist:6047520
Last active December 20, 2015 01:09
aws cli でec2インスタンスを絞り込む。
aws ec2 describe-instances --filters '{"name":"tag:Name","values": "WEB*"}'
@toyama0919
toyama0919 / gist:6047569
Created July 21, 2013 05:14
aws cliでrdsにインスタンス作成
aws rds create-db-instance --db-instance-identifier test --master-username root --engine mysql --allocated-storage 10 --master-user-password test --db-instance-class db.t1.micro
@toyama0919
toyama0919 / gist:6093658
Last active December 20, 2015 07:29
chefのインストール
curl -L https://www.opscode.com/chef/install.sh | sudo bash
gem install knife-solo
gem install geocoder
@toyama0919
toyama0919 / file0.txt
Created October 20, 2013 10:09
elasticsearchでインデックスのバックアップ、リストア ref: http://qiita.com/toyama0919/items/ccd5eb9169967db54a76
sudo easy_install esclient
@toyama0919
toyama0919 / file0.txt
Created October 26, 2013 14:20
macのrubyでclipboardの内容を取得する ref: http://qiita.com/toyama0919/items/a8101f9f46f44758f01b
brew install nkf
age:20 AND name:"太郎"
@toyama0919
toyama0919 / file0.txt
Created November 19, 2013 09:23
elasticsearchの便利なプラグイン集 ref: http://qiita.com/toyama0919/items/383b97bdd6cfcd098ce4
sudo su - root
cd /usr/share/elasticsearch/
bin/plugin -install elasticsearch/elasticsearch-cloud-aws
bin/plugin -install mobz/elasticsearch-head
bin/plugin -install lukas-vlcek/bigdesk
bin/plugin -install royrusso/elasticsearch-HQ
yum install python-setuptools
easy_install esclient