Skip to content

Instantly share code, notes, and snippets.

View niiku-y's full-sized avatar

Yuuki Niikura niiku-y

  • Tokyo, Japan
View GitHub Profile
#!/bin/bash
# add subject alternative name to openssl.cnf
# ubunt 18.04
CNF_FILE=/etc/ssl/openssl.cnf
sudo cp ${CNF_FILE} ${CNF_FILE}.org
linenum=$( grep -n "^# Include email address in subject alt name: another PKIX recommendation" ${CNF_FILE} | cut -f 1 -d ':' )
FQDN=hoge.local
#!/bin/bash
# make_certs.sh
# ----------------------------
# generate private key file, certificate signing request,
# and self-signed certificates with Subject Alternative Name.
#
# environment:
# ubuntu 18.04 , openssl 1.1.1
#
# if you want to use @-notation in subjectAltName ,
@niiku-y
niiku-y / Gemfile.sample1228
Last active March 10, 2019 14:44
webapp104
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.3.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.2'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
#!/bin/bash
# install_docker_compose.sh
#
# https://docs.docker.com/compose/install/#install-compose
# https://docs.docker.com/compose/completion/#compose-documentation
#
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo curl -L https://raw.githubusercontent.com/docker/compose/1.23.1/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.3.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.2'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
@niiku-y
niiku-y / Makefile
Last active March 10, 2019 14:33
rails5 sample
NAME=myapp
VERSION=v101
HOST_PORT=3000
CONT_PORT=3000
container=`sudo docker ps -a -q`
image=`sudo docker images | awk '/^<none>/ { print $$3 }'`
build:
sudo docker build -t $(NAME):$(VERSION) .
@niiku-y
niiku-y / file0.txt
Last active December 13, 2018 23:48
Canonical Distributed Kubernetesのインストール ref: https://qiita.com/niiku-y/items/e8732512100c448cb29f
$ sudo apt update
$ sudo apt upgrade
$ which snap
/usr/bin/snap
$ sudo snap install conjure-up --classic
$ sudo snap install lxd
$ /snap/bin/lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
@niiku-y
niiku-y / file0.txt
Last active December 11, 2018 16:59
GitLab 11.5.3とGitLab runner 11.5.1のセットアップ ref: https://qiita.com/niiku-y/items/27fd113d68b5e4cefb4c
$ dpkg -l gitlab-ce
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-========================-=================-=================-======================================================
ii gitlab-ce 11.5.3-ce.0 amd64 GitLab Community Edition (including NGINX, Postgres, R
$
#!/bin/bash
# install_rails5_2.sh
# active admin app
sudo apt-get update
sudo apt-get install -y ruby sqlite3 libsqlite3-dev
sudo apt-get install -y build-essential liblzma-dev patch ruby-dev zlib1g-dev
sudo gem install rails
APPNAME="app001"
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;