Skip to content

Instantly share code, notes, and snippets.

View verchol's full-sized avatar

Oleg Verhovsky verchol

View GitHub Profile
FROM debian:wheezy
RUN useradd --create-home user
ENV SKYPE_URL http://download.skype.com/linux/skype-debian_4.3.0.37-1_i386.deb
RUN dpkg --add-architecture i386 \
&& apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/* \
&& wget "${SKYPE_URL}" -O skype.deb \
&& apt-get purge -y --auto-remove wget \
@verchol
verchol / Dockerfile
Created August 28, 2016 15:27 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@verchol
verchol / afterPromiseFinally.js
Created December 22, 2016 05:30
using promise value after finally was called by using q
var Q = require('q');
var p = Q(2).then((a)=>{return 15}).finally(function (a){
console.log('finally:' + JSON.stringify(arguments));
})
.then((afterFinally)=>{console.log(`after finally ${JSON.stringify(afterFinally)}`)})
.catch((e)=>{console.log(`exception ${e}`)});
@verchol
verchol / gist:9b9005ecacef10ad8d518b72b44ff32f
Created November 14, 2017 18:44
using kefir and nodejs stream
const { Duplex } = require('stream');
const kefir = require('kefir');
class MyWritable extends Duplex {
constructor(options) {
// Calls the stream.Writable() constructor
super(options);
this.buffer = [];
// ...
}
const yargs = require('yargs');
const assert = require('assert');
const _ = require('lodash');
class TopCommand {
constructor(command){
this.command = command;
this.subCommands = [];
}
subCommand(command){
const yargs = require('yargs');
const assert = require('assert');
const _ = require('lodash');
const run = require('./run');
run.subCommand({
command: "pipeline",
description : "run pipeline",
handler : ()=>{
console.log('run pipeline ->');
@verchol
verchol / kubernetes_add_service_account_kubeconfig.sh
Created January 18, 2018 22:18 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
# Add user to k8s 1.6 using service account, no RBAC (must create RBAC after this script)
if [[ -z$1” ]] || [[ -z$2” ]];then
echo “usage: $0 <username> <environment (stg|prod)>
exit 1
fi
USER=$1
environment=$2
@verchol
verchol / kubernetes_add_service_account_kubeconfig.sh
Created January 18, 2018 22:18 — forked from vdboor/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
# Add user to k8s 1.6 using service account, no RBAC (must create RBAC after this script)
if [[ -z$1” ]] || [[ -z$2” ]];then
echo “usage: $0 <username> <environment (stg|prod)>
exit 1
fi
USER=$1
environment=$2
@verchol
verchol / kubernetes_add_service_account_kubeconfig.sh
Created January 18, 2018 22:18 — forked from vdboor/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
# Add user to k8s 1.6 using service account, no RBAC (must create RBAC after this script)
if [[ -z$1” ]] || [[ -z$2” ]];then
echo “usage: $0 <username> <environment (stg|prod)>
exit 1
fi
USER=$1
environment=$2
@verchol
verchol / helm=>package
Last active March 13, 2018 13:57
helm package and export to chart museum
export PACKAGE=$(helm package $CF_VOLUME_PATH /cf-ui/cfui --version $CHRAT_FULL_SEMVER --destination $CF_VOLUME_PATH | cut -d " " -f 8 )
curl --user $BASIC_AUTH_USER:$BASIC_AUTH_PASS --fail --data-binary "@$PACKAGE" $HELM_REPO_FULL_PATH