Skip to content

Instantly share code, notes, and snippets.

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

Evgeny Zislis kesor

🏠
Working from home
View GitHub Profile
@kesor
kesor / Vagrantfile
Last active January 22, 2019 17:40
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'etc'
Vagrant.configure('2') do |config|
config.vm.box = "raring"
config.vm.box_url = 'http://cloud-images.ubuntu.com/vagrant/raring/current/raring-server-cloudimg-amd64-vagrant-disk1.box'
config.vm.define :testbox do |v|
# Description:
# Allows Hubot to search a Graphite server for saved graphs
#
# Dependencies:
# A HuBot robot brain of some kind. MongoDB/Redis/...
#
# Configuration
# HUBOT_HIPCHAT_TOKEN
# GRAPHITE_URL (e.g. https://graphite.example.com)
# GRAPHITE_AUTH (e.g. user:password for Basic Auth)
service{"refrigerator":
ensure => running,
}
@kesor
kesor / docker_workshop.md
Last active January 22, 2019 17:40
docker workshop prerequisites

Docker Workshop

  • This workshop is intended for people who are familiar with Linux and running services like a web server, database, etc.

To make it and easier for everyone, and save us some time please prepare a couple of simple things beforehand. Coming unprepared can cause delays and you might miss the whole workshop because the internet is not fast enough for everyone to download the requirements.

  1. Bring your Laptop - this is a workshop!
    It does not matter which operating system you have installed.
@kesor
kesor / Vagrantfile
Last active August 29, 2015 14:02
docker workshop
ENV['VAGRANT_NO_PLUGINS'] = 'true'
Vagrant.configure("2") do |v|
v.vm.box = "yungsang/boot2docker"
v.vm.box_version = ">= 1.3.7"
v.vm.box_check_update = false
v.vm.network :forwarded_port, guest: 5000, host: 60050
v.vm.network :forwarded_port, guest: 8500, host: 60085
v.vm.network :forwarded_port, guest: 8080, host: 60080
@kesor
kesor / docker_workshop_microservices_cheat_sheet.md
Last active September 27, 2020 17:54
docker workshop cheat sheet #2 - microservices
@kesor
kesor / go-web.go
Last active January 22, 2019 17:40
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Printf(w, "Hello World!")
}
root@89de118f2aa3:~# ps -ef ; date ; nohup ./zombie & ; sleep 2 ; ps -ef ; sleep 65 ; date ; ps -ef
bash: syntax error near unexpected token `;'
root@89de118f2aa3:~# ps -ef ; date ; (nohup ./zombie &) ; sleep 2 ; ps -ef ; sleep 65 ; date ; ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 16:41 ? 00:00:00 /bin/bash
root 364 1 0 16:47 ? 00:00:00 ps -ef
Wed May 20 16:47:37 UTC 2015
nohup: appending output to 'nohup.out'
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 16:41 ? 00:00:00 /bin/bash
@kesor
kesor / upload-certificate.sh
Last active September 9, 2015 11:18
Uploading ssl to AWS
#!/bin/sh
cert_name="mycompany"
decrypted_rsa_key=$(mktemp `dirname $0`/${cert_name}-com-server-key-UNENCRYPTED.pem.XXXXXXX)
trap "rm -rf $decrypted_rsa_key" EXIT
openssl rsa -in ${cert_name}-com-server-key.pem -out $decrypted_rsa_key
# The certificate chain must start with the immediate signing certificate,
#!/usr/bin/env python
import sys
import yaml
import json
with open(sys.argv[1], 'r') as fd_r:
with open(sys.argv[2], 'w') as fd_w:
json.dump(yaml.load(fd_r), fd_w)