Skip to content

Instantly share code, notes, and snippets.

View yudai's full-sized avatar

Iwasaki Yudai yudai

View GitHub Profile
@yudai
yudai / gist:864840c497b643db7c31
Last active December 12, 2022 00:07
runC quick start
# generate rootfs
sudo debootstrap --arch=amd64 trusty rootfs
# container.json (from README.md)
cat <<__EOF__>container.json
{
"version": "0.1",
"os": "linux",
"arch": "amd64",
"processes": [
@yudai
yudai / gist:8ac50af71dccd3fd390c
Created March 20, 2015 23:05
To fix go-remove-unused-imports
(defun my-go-unused-imports-lines ()
;; FIXME Technically, -o /dev/null fails in quite some cases (on
;; Windows, when compiling from within GOPATH). Practically,
;; however, it has the same end result: There won't be a
;; compiled binary/archive, and we'll get our import errors when
;; there are any.
(reverse (remove nil
(mapcar
(lambda (line)
(when (string-match "^\\(.+\\):\\([[:digit:]]+\\): imported and not used: \".+\".*$" line)
@yudai
yudai / gist:c613913b1123647655b1
Last active August 29, 2015 14:16
Find .gvm_local
function activate_gvm_pkgset() {
if [ -n "$__in_active_gvm_pkgset" ]; then
return
fi
__in_active_gvm_pkgset=true
nearest_local=((../)#.gvm_local/..(#qN)(:a))
if [ -d "$nearest_local" ] && \
[ "$nearest_local" != "$__gvm_local_path" ]; then
current=$(pwd)
cd $nearest_local
---
name: firstbosh
logging:
level: DEBUG
network:
type: dynamic
vip: <FLOATING_IP> # CHANGE
cloud_properties:
network_name: <SUBNETWORK_NAME> # CHANGE
@yudai
yudai / gist:8857785
Created February 7, 2014 05:32
which do you like?
#1
obj.method0(
arg1,
arg2)
.method1
.method2
#2
obj.method0(
arg1,
Error 450001: Compile Package Failure (exit code: 2)
/var/vcap/bosh/lib/ruby/gems/1.9.1/gems/bosh_agent-1.5.0.pre.1644/lib/bosh_agent/message/compile_package.rb:206:in `block in compile'
/var/vcap/bosh/lib/ruby/gems/1.9.1/gems/bosh_agent-1.5.0.pre.1644/lib/bosh_agent/message/compile_package.rb:190:in `chdir'
/var/vcap/bosh/lib/ruby/gems/1.9.1/gems/bosh_agent-1.5.0.pre.1644/lib/bosh_agent/message/compile_package.rb:190:in `compile'
/var/vcap/bosh/lib/ruby/gems/1.9.1/gems/bosh_agent-1.5.0.pre.1644/lib/bosh_agent/message/compile_package.rb:64:in `start'
/var/vcap/bosh/lib/ruby/gems/1.9.1/gems/bosh_agent-1.5.0.pre.1644/lib/bosh_agent/message/compile_package.rb:31:in `process'
/var/vcap/bosh/lib/ruby/gems/1.9.1/gems/bosh_agent-1.5.0.pre.1644/lib/bosh_agent/handler.rb:265:in `process'
/var/vcap/bosh/lib/ruby/gems/1.9.1/gems/bosh_agent-1.5.0.pre.1644/lib/bosh_agent/handler.rb:250:in `process_long_running'
/var/vcap/bosh/lib/ruby/gems/1.9.1/gems/bosh_agent-1.5.0.pre.1644/lib/bosh_agent/handler.rb:177:in `block in pro
@yudai
yudai / gist:7540823
Last active December 28, 2015 18:09
Log Instrumentor for OpenStack CPI
module Bosh::OpenStackCloud
class ExconLoggingInstrumentor
def self.instrument(name, params = {}, &block)
params = params.dup
if params.has_key?(:headers) && params[:headers].has_key?('Authorization')
params[:headers] = params[:headers].dup
params[:headers]['Authorization'] = REDACTED
end
if params.has_key?(:password)
params[:password] = REDACTED
@yudai
yudai / gist:7539098
Created November 19, 2013 02:12
Fog request logging
module Fog
module Core
class Connection
def request(params, &block)
reset unless @persistent
p params
@excon.request(params, &block)
end
end
end
ァィゥェォ
ヵ‡੭ヶ⊐
⧺ㇱㇲըそ
た∓⺍⫧ㇳ
ᚋ⚌ㇴね৴
ㇵㇶㇷㇸㇹ
੨𝞝ㇺ𝘹も
ャュョ
ㇻㇼㇽㇾㇿ
ヮ╕ん
@yudai
yudai / local.rake
Created September 26, 2013 06:04
For building stemcells locally. Put this rake file as `bosh-dev/lib/bosh/dev/tasks/local.rake`, and run `sudo CANDIDATE_BUILD_NUMBER=3939 bundle exec rake "local:build_microbosh[openstack,ubuntu]"`.
namespace :local do
desc 'build MicroBOSH Stemcell locally'
task :build_microbosh, [:infrastructure_name, :operating_system_name] do |_, args|
require 'bosh/dev/build'
require 'bosh/dev/micro_bosh_release'
require 'bosh/dev/stemcell_builder'
build = Bosh::Dev::Build.candidate
release_tarball_path = Bosh::Dev::MicroBoshRelease.new.tarball