Skip to content

Instantly share code, notes, and snippets.

View nak3's full-sized avatar

Kenjiro Nakayama nak3

View GitHub Profile
@nak3
nak3 / divide.sh
Last active September 5, 2015 15:55
num=0; for i in is bc dc svc ; do cat hello.json | /usr/local/bin/jq .items[$num] > $i.json; num=$(( num + 1 )); done
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "helloworld-v3",
@nak3
nak3 / bc.json
Created September 7, 2015 17:12
{
"status": {
"lastVersion": 0
},
"spec": {
"resources": {},
"output": {
"to": {
"name": "helloworld-v3:latest",
"kind": "ImageStreamTag"
@nak3
nak3 / is.json
Created September 7, 2015 17:12
{
"status": {
"dockerImageRepository": ""
},
"spec": {},
"metadata": {
"labels": {
"app": "helloworld-v3"
},
"creationTimestamp": null,
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
  • This is a basic installation example

  1. Preequires ===
#!/bin/bash
# Prerequires
yum -y install docker
sed -i -e "s/OPTIONS='--selinux-enabled'/OPTIONS='--insecure-registry=172.30.0.0\/16 --selinux-enabled'/" /etc/sysconfig/docker
systemctl restart docker
# Master setup
yum -y install openshift-master
#!/bin/bash
yum install -y wget git net-tools bind-utils iptables-services bridge-utils
yum update -y
yum -y install docker
sed -i -e "s/OPTIONS='--selinux-enabled'/OPTIONS='--insecure-registry=172.30.0.0\/16 --selinux-enabled'/" /etc/sysconfig/docker
systemctl restart docker
systemctl enable docker
@nak3
nak3 / cpu-eater-small.service
Created November 12, 2015 04:43
systemd quick test place in /run/systemd/system
[Unit]
Description=Eat CPU
[Service]
Restart=always
CPUShare=1500
ExecStart=/bin/bash -c 'while true; do echo foo; done > /dev/null'
@nak3
nak3 / example.nomad
Created November 15, 2015 03:16
exec driver test with sleep
# There can only be a single job definition per file.
# Create a job with ID and Name 'example'
job "example" {
# Run the job in the global region, which is the default.
# region = "global"
# Specify the datacenters within the region this job can run in.
datacenters = ["dc1"]
# Service type jobs optimize for long-lived services. This is