Skip to content

Instantly share code, notes, and snippets.

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

Roman I. riuvshin

🏠
Working from home
View GitHub Profile
#!/bin/bash
set -e
command -v jq >/dev/null 2>&1 || { echo >&2 "[ERROR] Command line tool jq (https://stedolan.github.io/jq) is required but it's not installed. Aborting."; exit 1; }
command -v curl >/dev/null 2>&1 || { echo >&2 "[ERROR] Command line tool curl (https://curl.haxx.se/) is required but it's not installed. Aborting."; exit 1; }
CHE_API_ENDPOINT="${CHE_API_ENDPOINT:-http://che-eclipse-che.192.168.65.2.nip.io/api}"
CHE_GEN="${CHE_GEN:-6}"
WS_RAM_BYTES="${WS_RAM_BYTES:-2147483648}"
@riuvshin
riuvshin / k8s.sh
Last active August 1, 2018 16:37
#!/bin/bash
set -e
up() {
echo "[k8s] starting k8s dind cluster"
docker run -d --privileged --shm-size 8G --name=k8s_dind -p 30000:30000 -p 8443:8443 -p 80:80 --rm riuvshin/minikube-dind:latest
wait_k8s
enable_ingress_addon
install_helm
@riuvshin
riuvshin / test.sh
Last active February 12, 2018 22:48
#!/bin/bash
set -e
execute_with_timer() {
START=`date +%s`
$@ >/dev/null 2>&1
END=`date +%s`
EXECUTION_TIME=$((END-START))
}
test_io_write() {
echo "running $FUNCNAME, write 1g file, iterations: $ITERATIONS"
local TIME_SUM=0
local SPEED_SUM=0
for i in $(seq 1 $ITERATIONS); do
rm -rf $VOLUME/largefile_write
result=$(dd if=/dev/zero of=$VOLUME/largefile_write bs=1M count=1000 2>&1)
echo "1 $result"
local TIME=$(echo $result | cut -d ' ' -f 12)
echo "2 $TIME"
---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-class: gluster-subvol
name: gluster
---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
volume.beta.kubernetes.io/storage-class: gp2
name: ebs
@riuvshin
riuvshin / k8s.yml
Last active February 14, 2018 16:23
---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: che
name: che
BASE_DIR=$(cd "$(dirname "$0")"; pwd)
test() {
cat ${BASE_DIR}/deploy/openshift/deploy_che.sh
}
echo $BASE_DIR
test
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes b{0%{opacity:1}50%{opacity:0}to{opacity:1}}[src$="blue.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDA5Njg4IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}[src$="red.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjQ0MzM2IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtMmgydjJ6bTAtNGgtMlY3aDJ2NnoiLz48L3N2Zz4=)}[src$="yellow.png
@riuvshin
riuvshin / Vagrantfile
Created June 1, 2018 12:11
ansible_sandbox_vm
Vagrant.configure("2") do |config|
public_key_path = '~/.ssh/id_rsa.pub'
ram = '4096'
cpus = '4'
config.vm.box = "centos/7"
config.vm.box_version = "1801.02"
config.ssh.insert_key = false
config.vm.network :private_network, ip: "192.168.56.77"
config.vm.provider :virtualbox do |vbox|
vbox.name = "ansible_sandbox"