Skip to content

Instantly share code, notes, and snippets.

View minimum2scp's full-sized avatar
🏠
Working from home

YAMADA Tsuyoshi minimum2scp

🏠
Working from home
View GitHub Profile
@minimum2scp
minimum2scp / debian-10-buster-changes.md
Last active July 17, 2019 18:07
Notable changes in debian 10 buster
@minimum2scp
minimum2scp / playbook.yml
Last active December 12, 2018 09:10
ansible apt_repository module replaces symlink to normal file
- hosts: localhost
become: yes
tasks:
- apt:
name: local-apt-repository
- stat:
path: /etc/apt/sources.list.d/local-apt-repository.list
register: stat_result
@minimum2scp
minimum2scp / sample_spec.rb
Last active August 24, 2018 07:26
serverspec で debian パッケージが最新になっているかどうかのテスト。apt-get update を済ませている前提。 https://twitter.com/minimum2scp/status/1032832037625847808
require 'spec_helper'
%w[
base-files
openssl
openssh-server
].each do |pkg|
describe command("LANG=C apt-cache policy #{pkg}") do
its(:stdout) {
should match /\A#{Regexp.quote(pkg)}:\n Installed: (\S+)\n Candidate: \1\n/
@minimum2scp
minimum2scp / memo.md
Last active August 20, 2017 17:34
sid で Ruby 2.3.4 をビルドしようとすると"generating enc.mk"のあとsegvする (https://twitter.com/minimum2scp/status/899301437896744961)
tsuyoshi@mira% tar xf ruby-2.3.4.tar.gz
tsuyoshi@mira% cd ruby-2.3.4
tsuyoshi@mira% ./configure
checking for ruby... /opt/rbenv/shims/ruby
config.guess already exists
config.sub already exists
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
@minimum2scp
minimum2scp / Dockerfile
Last active May 1, 2017 09:43
sidでruby 2.3系、2.2系、2.1系をlibssl1.0-devを使ってビルドする
FROM debian:sid
ARG ruby_version=2.3.4
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
build-essential autoconf bison ca-certificates git-core libgdbm-dev libncursesw5-dev libncurses5-dev libreadline-dev zlib1g-dev libssl1.0-dev libffi-dev libyaml-dev libgmp-dev \
rbenv ruby-build
RUN if [ ! -f /usr/share/ruby-build/${ruby_version} ]; then \
@minimum2scp
minimum2scp / puma-3.6.0_gem_make.out
Last active November 3, 2016 19:46
Failed to build puma (3.6.0, master) on Debian sid + OpenSSL 1.1.0 (libssl-dev 1.1.0b-2) + Ruby 2.4.0-preview2
current directory: /home/debian/a/vendor/bundle/ruby/2.4.0/gems/puma-3.6.0/ext/puma_http11
/opt/rbenv/versions/2.4.0-preview2/bin/ruby -r ./siteconf20161104-3729-1ptyu37.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/debian/a/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/puma-3.6.0/mkmf.log
@minimum2scp
minimum2scp / Rakefile
Last active May 10, 2017 05:45
Google discovery API (https://developers.google.com/discovery/v1/reference/) を使って OAuth2 の scope のリストを一覧
file 'scopes.txt' do
sh './google-oauth2-scopes.rb > scopes.txt'
end
file 'scopes.json' do
sh './google-oauth2-scopes.rb -f json > scopes.json'
end
@minimum2scp
minimum2scp / 00_haconiwa-netns.md
Last active August 24, 2016 11:46
haconiwa v0.3.2 netns 使ってみた (Fukuoka.rb #63)

環境:

  • PC: ThinkPad X1 Carbon
  • OS: Debian sid amd64
  • カーネル: 4.6.4
  • haconiwa: v0.3.2

haconiwa new で haco ファイル作成

sudo haconiwa new -n haco1 haco1.haco
tsuyoshi@mira% docker create --name systemd minimum2scp/systemd:latest
tsuyoshi@mira% sudo mkdir /var/tmp/systemd
tsuyoshi@mira% docker export systemd | sudo tar xf - -C /var/tmp/systemd
tsuyoshi@mira% vi systemd.haco
tsuyoshi@mira% sudo haconiwa run systemd.haco
Failed to mount sysfs at /sys: Operation not permitted
Failed to mount devtmpfs at /dev: Operation not permitted
Freezing execution.
@minimum2scp
minimum2scp / Dockerfile
Last active October 4, 2016 02:26
nginx mainline のsource debをベースに、nginx-module-njsを参考にしてngx_mrubyをDSOなサブパッケージnginx-modules-mrubyとしてビルドしてみる
FROM minimum2scp/baseimage-jessie:latest
ARG NGINX_VERSION=1.11.4
ARG NGX_MRUBY_VERSION=v1.18.6
ARG DEB_BASE_REVISION=1~jessie
ARG DEB_NGINX_MODULE_MRUBY_VERSION=${NGINX_VERSION}-${NGX_MRUBY_VERSION}
RUN sed -i -e 's/httpredir.debian.org/ftp.jp.debian.org/' /etc/apt/sources.list
RUN curl http://nginx.org/keys/nginx_signing.key | apt-key add -
RUN echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" > /etc/apt/sources.list.d/nginx.list