Skip to content

Instantly share code, notes, and snippets.

View kun432's full-sized avatar

Kuniaki Shimizu kun432

View GitHub Profile
@kun432
kun432 / Vagrantfile
Last active August 29, 2015 14:01 — forked from leifg/Vagrantfile
Add two or more disks to system using Vagrant
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'base'
config.vm.provider "virtualbox" do |vb|
disk_num = 4
disk_size = 4096
i = 0
while i < disk_num do
@kun432
kun432 / default.rb
Created June 10, 2014 08:21
chef-locale-cookbook added support for ubuntu
if platform?("ubuntu", "debian")
package "locales" do
action :install
end
if platform?("ubuntu")
[lang,lc_all].each do |l|
if /^(C|POSIX|)$/i !~ l
langcode = l.slice(0,2)
@kun432
kun432 / Brewfile
Created July 7, 2014 14:17
Brewfile
update
upgrade
tap caskroom/cask
install brew-cask
tap sanemat/font
install ricty
install zsh
@kun432
kun432 / setup.sh
Created July 7, 2014 14:22
setup OSX with Homebrew
#!/bin/bash
# HOMEBREW_GITHUB_API_TOKEN
if [ -f ~/.brew_api_token ];then
source ~/.brew_api_token
fi
# dotfiles
git clone https://github.com/kun432/dotfiles.git ~/dotfiles && ~/dotfiles/link_dotfiles.sh
@kun432
kun432 / client.rb
Created July 17, 2014 08:31
for DigitalOcean API V2.0 paging feature
unless method == :delete
begin
body = JSON.parse(result.body)
@logger.info "Response: #{body}"
nextpage = body["links"]["pages"]["next"] rescue nil
+ unless nextpage.nil?
+ uri = URI.parse(nextpage)
+ next_result = self.request("#{path}?#{uri.query}")
+ target = path.split("/")[-1]
+ body["#{target}"].concat(next_result["#{target}"])
@kun432
kun432 / osx-setup.yml
Last active August 29, 2015 14:04
[WIP] Ansible playbook for OSX setup
---
# osx setup
- hosts: localhost
connection: local
gather_facts: no
sudo: no
vars:
host_name: mac-mini
tasks:
export PATH="{{ plenv.install_path }}/bin:$PATH"
if [ -s "${HOME}/.plenv/bin" ]; then
plenv_root="${HOME}/.plenv"
export PATH="${plenv_root}/bin:$PATH"
eval "$(plenv init -)"
elif [ -s "{{ plenv.install_path }}" ]; then
plenv_root="{{ plenv.install_path }}"
export PLENV_ROOT="$plenv_root"
eval "$(plenv init -)"
plenv:
git_url: https://github.com/tokuhirom/plenv.git
git_version: 2.1.1
install_path: /usr/local/plenv
perlbuild_files:
- name: perl-build
url: https://raw.githubusercontent.com/tokuhirom/Perl-Build/master/perl-build
- name: plenv-install
url: https://raw.githubusercontent.com/tokuhirom/Perl-Build/master/bin/plenv-install
- name: plenv-uninstall
plenv:
git_url: https://github.com/tokuhirom/plenv.git
git_version: 2.1.1
install_path: /usr/local/plenv
env: system
plenv_root: /usr/local/plenv
perls:
- 5.20.0
- 5.16.1
@kun432
kun432 / gist:b634da13332381b38568
Last active August 29, 2015 14:05
plenvメモ

plenvメモ

必要があってちょっと調べてみた。コードをきちんと読んだわけではないので間違ってるかも。

plenvの各コマンドの戻り値

plenv install

  • 0 : 成功
  • 2 : 失敗(ビルド失敗等)