Skip to content

Instantly share code, notes, and snippets.

Avatar

Toshiya SAITOH stoshiya

  • Kanagawa, Japan
View GitHub Profile
View openssl-s_client-command.sh
$ openssl s_client -connect example.com:443 -showcerts
@stoshiya
stoshiya / certbot.sh
Last active May 19, 2019
Let's encrypt wildcard certificates
View certbot.sh
$ 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
@stoshiya
stoshiya / ebs-resize.sh
Last active May 31, 2018
EBS Resizing Script
View ebs-resize.sh
#!/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
View mongodb backup command line.md

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

% sudo tar -C /var/lib -cvz mongo | aws s3 cp - s3://<BUCKET NAME>/backup/mongodb-`date '+%Y%m%d'`
@stoshiya
stoshiya / elasticsearch.md
Last active Aug 29, 2015
elasticsearchのメモ
View elasticsearch.md

elasticsearchのメモ

インストール

$ brew install elasticsearch

plugin

kuromoji

View aws cli.md
$ 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
View Chef Solo on EC2.md

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
View test_mnesia.erl
-module(test_mnesia).
-import(lists, [foreach/2]).
-compile(export_all).
-include_lib("stdlib/include/qlc.hrl").
-record(shop, {item, quantity, cost}).
-record(cost, {name, price}).
-record(design, {id, plan}).
@stoshiya
stoshiya / selenium chrome.md
Last active Jun 7, 2019
MacでSeleniumをつかってChromeを起動するまで
View selenium chrome.md

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

必要なもの

  • Mac OS X
  • Google Chrome
  • Homebrew
  • Node.js
  • selenium-server-standalone
  • chromedriver
View phantomejs-webdriver-sample.js
var client = require('webdriverjs').remote({
desiredCapabilities: {
browserName: 'phantomejs'
},
logLeve: 'silent'
});
client.init();
client