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 / Dockerfile
Last active January 15, 2016 08:36
consul on centos5.11
FROM centos:5.11
RUN \
yum install -y curl wget unzip && \
wget --no-check-certificate -O consul.zip https://releases.hashicorp.com/consul/0.6.0/consul_0.6.0_linux_amd64.zip && \
unzip consul.zip && \
rm -f consul.zip && \
mv consul /usr/local/sbin && \
chmod 755 /usr/local/sbin/consul && \
curl https://gist.githubusercontent.com/Lorentzca/98c7e00b3313155a53e2/raw/consul > /etc/init.d/consul && \
@lorentzca
lorentzca / config.json
Last active January 29, 2016 08:53
consul server用設定
{
"bootstrap_expect": 1 ,
"server": true,
"data_dir": "/var/consul",
"bind_addr": "127.0.0.1",
"client_addr": "0.0.0.0"
}
@lorentzca
lorentzca / consul
Last active February 1, 2016 06:59 — forked from yunano/consul
/etc/init.d/consul for CentOS 5
#!/bin/sh
#
# consul - this script manages the consul agent
#
# chkconfig: 345 95 05
# description: consul_0.6.0
# processname: consul
### BEGIN INIT INFO
# Provides: consul
@lorentzca
lorentzca / Dockerfile
Created December 11, 2015 01:07
オフィシャルのcentosのosバージョン指定はこんな感じ
FROM centos:5.11
RUN \
yum install -y httpd && \
chkconfig httpd on && \
/etc/init.d/httpd start
@lorentzca
lorentzca / Dockerfile_centos7
Last active February 9, 2016 00:53
vault on docker
FROM centos:7
RUN \
yum install -y wget unzip && \
cd /usr/local/bin && \
wget https://releases.hashicorp.com/vault/0.4.1/vault_0.4.1_linux_amd64.zip && \
unzip vault_0.4.1_linux_amd64.zip && \
rm vault_0.4.1_linux_amd64.zip
@lorentzca
lorentzca / ks.cfg
Created December 1, 2015 03:17
centos kickstart config file
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard jp106
network --onboot yes --device eth0 --bootproto dhcp --noipv6
network --onboot no --device eth1 --bootproto dhcp --noipv6
rootpw --iscrypted <暗号化されたパスワード>
@lorentzca
lorentzca / sample.json
Created October 28, 2015 03:07
virtualbox image -> vagrant box
{
"builders": [
{
"type": "virtualbox-ovf",
"source_path": "/path/to/sample.ova",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"shutdown_command": "echo 'vagrant' | sudo -S /sbin/shutdown -h now"
}
],
@lorentzca
lorentzca / public_ip.rb
Created October 5, 2015 06:03
Ohai plug-in to get the public ip address
Ohai.plugin(:PublicIp) do
provides 'public_ip'
collect_data do
public_ip Mash.new
public_ip[:public_ip] = `curl -s http://whatismyip.akamai.com/`
end
end
@lorentzca
lorentzca / cookman
Last active October 8, 2015 02:26
複数のホストにcookするやつ
#!/usr/bin/env ruby
require 'thor'
class CookMan < Thor
desc "prepare", "Prepare to one or more hosts"
option :hostname, :required => true, :aliases => :h, :type => :array
def prepare
options[:hostname].each do |h|
system "bundle exec knife solo prepare #{h}"
@lorentzca
lorentzca / vault.sh
Created September 4, 2015 05:20
Install vault by HashiCorp
#!/bin/bash
#
# Install vault by HashiCorp
cd /usr/local/bin
wget -O vault.zip https://dl.bintray.com/mitchellh/vault/vault_0.2.0_linux_amd64.zip
yum install -y unzip
unzip vault.zip
rm vault.zip