Skip to content

Instantly share code, notes, and snippets.

View yudai's full-sized avatar

Iwasaki Yudai yudai

View GitHub Profile
@yudai
yudai / gist:6308528
Created August 22, 2013 15:15
dns-yml.all の変更点。director_uuidは`bosh stats`コマンドで表示されるUUIDに、各URLのIPアドレスはCFのエンドポイントのIPアドレスに、passwordは`bosh cf show attributes`コマンドで表示されるパスワードの値で修正してください。
diff --git a/examples/dns-all.yml b/examples/dns-all.yml
index d7c27e6..1e614ec 100644
--- a/examples/dns-all.yml
+++ b/examples/dns-all.yml
@@ -1,10 +1,10 @@
---
name: cf-services-contrib
-director_uuid: DIRECTOR_UUID # CHANGE
+director_uuid: 4dcab38b-3939-4d13-f3ad-dbb38c7b5c939 # CHANGE
@yudai
yudai / gist:5518417
Last active December 17, 2015 00:09
rbenv
sudo apt-get -y install build-essential libreadline-dev libssl-dev zlib1g-dev git
git clone http://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
exec $SHELL -l
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 1.9.3-p484
rbenv global 1.9.3-p484
---
properties:
domain: vcap.me
networks:
apps: default
management: default
nats:
user: nats
@yudai
yudai / gist:5310346
Created April 4, 2013 13:30
Rewrite .git files to use a relative path in them
#!/usr/bin/env ruby
require 'fileutils'
require 'pathname'
def ensure_relative_gitdir()
%x{git ls-files --error-unmatch --stage}.split("\n").each do |line|
value = line.split(" ")
if value[0] == "160000"
FileUtils.cd(value[3]) do
@yudai
yudai / Invalid
Last active December 14, 2015 15:29
with Ada.Text_IO; use Ada.Text_IO;
procedure Array_Test is
From_Array : array (1 .. 3) of Integer;
To_Array : array (1 .. 3) of Integer;
begin
From_Array := (1, 2, 3);
To_Array := From_Array;
From_Array := (others => 0);
@yudai
yudai / vcap_me.sh
Created February 13, 2013 11:38
Set up script for self-hosting vcap.me domain
#!/bin/sh
cat <EOF >> /etc/bind/named.conf.local
zone "vcap.me" IN {
type master; file "vcap.me.zone"; allow-update { none; };
};
EOF
cat <EOF > /etc/bind/db/vcap.me.zone
$TTL 86400@ IN SOA localhost root (
1 ; serial (d. adams)
class PropertyChain
def initialize(value)
@value = value
end
def method_missing(action, *args)
if @value.key?(action)
PropertyChain.new(@value[action])
else
nil
end