Skip to content

Instantly share code, notes, and snippets.

@clairvy
clairvy / target_host.rb
Last active March 28, 2019 08:16
modify to use identityfile setting in .ssh/config
#
# Copyright:: Copyright (c) 2017-2019 Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
FROM ubuntu:18.04
# copied from https://github.com/chef/chef-dk/blob/master/Dockerfile
ARG PACKAGE=chef-workstation
ARG CHANNEL=stable
ARG VERSION=0.2.48
RUN apt-get update && \
apt-get install -y wget && \
@clairvy
clairvy / Dockerfile
Last active September 17, 2018 08:35
sample to read book
FROM ubuntu:16.04
RUN apt-get update \
&& apt-get install -y binutils build-essential sysstat strace \
&& apt-get install -y \
binutils build-essential sysstat \
strace \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app

how to run

make project

$ docker run --rm rails:4.2.5 rails new . -d mysql
$ git init
$ git add .
$ git commit -m 'initial revision'
$ cat docker-compose.yml
/local.env
/tf/*.tf
/tf/*.tfstate*
/**
*
*/
package lesson.test.util;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.PrintStream;
@clairvy
clairvy / README.md
Last active August 29, 2015 14:05 — forked from koshigoe/mymemcheck.rb

my.cnf memory check

  1. my.cnf か SHOW VARIABLES の結果を入力にとる
  2. 入力を解析し、必要なパラメータ値を取得する
  3. 計算
  4. 結果を標準出力に出力する
# docker
if whence -p boot2docker 2>&1 > /dev/null; then
alias boot2dockerenv="boot2docker up | awk '/export/{print \$2}'"
alias boot2dockerhost="boot2docker up | awk -F= '/export/{print \$2}'"
alias boot2dockerstatus="boot2docker status | awk '{print \$5}'"
if whence -p docker 2>&1 > /dev/null; then
function docker {
if [[ x"`boot2dockerstatus`" == x"running." ]]; then
command docker --host="`boot2dockerhost`" "$@"
else
FROM centos
# スクリプトで使われているコマンドを入れる
RUN yum install -y which sudo
# コマンド置換できるようにする (<() ってやつ)
#RUN ln -s /proc/self/fd /dev/fd
# rvm:rvm を作る(root だとインストール先が /home/<USER> にならないため一般ユーザで)
RUN groupadd rvm
RUN useradd -g rvm rvm
# sudo でパスワードなし,tty 不要に
@clairvy
clairvy / -
Created January 7, 2014 12:46
grep -v '#' .gitignore|grep -v '^!'|grep -v '^$'|perl -lne 'push(@a,$_);END{print "find . ", join(" -o ", map {"-name '\''$_'\''"} @a), " | xargs git rm -r"}'