Skip to content

Instantly share code, notes, and snippets.

Avatar

Yuuki Niikura niiku-y

  • Tokyo, Japan
View GitHub Profile
View add_san.sh
#!/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
View make_certs.sh
#!/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 ,
View Gemfile.sample1228
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
View install_docker_compose.sh
#!/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
View Gemfile.181224
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 Mar 10, 2019
rails5 sample
View Makefile
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 Dec 13, 2018
Canonical Distributed Kubernetesのインストール ref: https://qiita.com/niiku-y/items/e8732512100c448cb29f
View file0.txt
$ 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 Dec 11, 2018
GitLab 11.5.3とGitLab runner 11.5.1のセットアップ ref: https://qiita.com/niiku-y/items/27fd113d68b5e4cefb4c
View file0.txt
$ 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
$
View install_rails5_2.sh
#!/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"
View nginx.conf.L4_loadbalancer_sample
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;
You can’t perform that action at this time.