Skip to content

Instantly share code, notes, and snippets.

View stoshiya's full-sized avatar

Toshiya SAITOH stoshiya

View GitHub Profile
@stoshiya
stoshiya / selenium chrome.md
Last active June 7, 2019 07:14
MacでSeleniumをつかってChromeを起動するまで

MacでSeleniumをつかってChromeを起動するまで

必要なもの

  • Mac OS X
  • Google Chrome
  • Homebrew
  • Node.js
  • selenium-server-standalone
  • chromedriver
@stoshiya
stoshiya / certbot.sh
Last active May 19, 2019 17:42
Let's encrypt wildcard certificates
$ certbot certonly -d '*.saitoh.nu' -m toshiya@saitoh.nu \
--server https://acme-staging-v02.api.letsencrypt.org/directory \
--manual-public-ip-logging-ok \
--manual \
--preferred-challenges dns-01
$ openssl s_client -connect example.com:443 -showcerts
@stoshiya
stoshiya / ebs-resize.sh
Last active May 31, 2018 00:53
EBS Resizing Script
#!/bin/sh
#
# $ sudo yum install jq
# $ sudo pip install -U awscli
# # sh ./ebs-resize.sh -d /dev/xvdf -v ebs-volume-name
#
usage() {
echo "Usage: $0 -d device-name -v ebs-volume-name" 1>&2
exit 1

mongodbのデータディレクトリをアーカイブしてs3に保存.レプリカセットの場合はPRIMARYで実施.

% sudo tar -C /var/lib -cvz mongo | aws s3 cp - s3:///backup/mongodb-date '+%Y%m%d'

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.

Publishing

@stoshiya
stoshiya / hello.js
Created November 23, 2012 11:00 — forked from shigeki/hello.js
第1回Node.js入門勉強会 レポート課題
var http = require('http');
server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
server.close();
});
server.listen(8080, 0, function () {
console.log('Server running at http://localhost:8080/');
});
@stoshiya
stoshiya / elasticsearch.md
Last active August 29, 2015 14:05
elasticsearchのメモ

elasticsearchのメモ

インストール

$ brew install elasticsearch

plugin

kuromoji

$ aws ec2 run-instance --image-id <ami-xxxxxxxx>
                       --key-name <keyName>
                       --security-group-ids <sg-xxxxxx>
                       --subnet-id <subnet-xxxxx>
                       --instance-type t1.micro
                       --associate-public-ip-address

AWS EC2でChef Solo

$ sudo yum update -y
$ sudo yum install -y ruby-gem ruby-devel gcc
$ sudo gem install knife-solo --no-ri --no-rdoc
$ knife configure

$ knife solo init chef-solo
$ cd chef-solo