Skip to content

Instantly share code, notes, and snippets.

View lorentzca's full-sized avatar
🏕️
In the Woods.

Kohta Kunishima lorentzca

🏕️
In the Woods.
View GitHub Profile
@lorentzca
lorentzca / twitter-trends.rb
Created August 26, 2015 15:21
日本のトレンドのワードを1つだけ返す
@lorentzca
lorentzca / droplet-controller.rb
Last active August 29, 2015 14:02
droplet作ったり消したり
require 'rubygems'
require 'bundler/setup'
require 'digitalocean'
require 'yaml'
@settings = YAML.load_file('./config/settings.yml')
Digitalocean.client_id = @settings['initialize']['client_id']
Digitalocean.api_key = @settings['initialize']['api_key']
@lorentzca
lorentzca / settings.yml
Last active August 29, 2015 14:02
起動するdropletの内容を書く
initialize:
client_id: XXXXXXXX
api_key: YYYYYYYY
create:
droplet_name: digio
region_id: 6
size_id: 66
image_id: 3445812
ssh_key_id: ZZZZZZZZ
@lorentzca
lorentzca / wercker.yml
Last active August 29, 2015 14:02
werckerで使うやつ
box: wercker/ruby
build:
steps:
- script:
name: make .ssh directory
code: mkdir -p $HOME/.ssh
- create-file:
name: put ssh public key
filename: $HOME/.ssh/id_rsa.pub
@lorentzca
lorentzca / initializer.sh
Created December 7, 2014 16:29
update system, initialize disk and swap
#!/bin/bash
yum update -y
resize2fs -p /dev/xvde
mkdir /mnt/store_vol
mount /dev/xvdf /mnt/store_vol/
dd if=/dev/zero of=/mnt/store_vol/swapfile bs=1M count=1024
mkswap /mnt/store_vol/swapfile
swapon /mnt/store_vol/swapfile
@lorentzca
lorentzca / install_elasticsearch_and_kibana.sh
Last active August 29, 2015 14:10
elasticsearch and kibana
#!/bin/bash
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 9200 -j ACCEPT
yum install -y java-1.7.0-openjdk wget unzip
rpm -ivh https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.noarch.rpm
chkconfig --add elasticsearch
yum install -y httpd
on run argv
tell application "iTunes"
set command to first item of argv
if command = "play" then
play
else if command = "pause" then
pause
else if command = "next" then
next track
else if command = "prev" then
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "chef/ubuntu-12.04"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update -y
sudo apt-get install -y curl
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "chef/centos-7.0"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", inline: <<-SHELL
sudo yum update -y
sudo yum install -y \
@lorentzca
lorentzca / mha
Last active August 29, 2015 14:16
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.define 'manager' do |manager|
manager.vm.box = "chef/centos-5.11"
manager.vm.network 'private_network', ip: '192.168.44.10'
manager.cache.scope = :box if Vagrant.has_plugin? 'vagrant-cachier'
manager.vm.provision "shell", inline: <<-SHELL
sudo hostname manager