Skip to content

Instantly share code, notes, and snippets.

@ric03uec
ric03uec / s3Accessors.js
Last active January 19, 2017 19:33
generating short lived credentials for s3
'use strict';
var util = require('util');
var aws = require('aws-sdk');
var async = require('async');
var EXPIRATION_TIME_SECS = 60 * 60; //60 mins
var BUCKET = 'myTestBucket';
var OBJECT_PATH = 'path/where/the/object/is/store';
@ric03uec
ric03uec / console.md
Last active August 25, 2015 22:49
openshift error

$ oc get pods

NAME                    READY     STATUS                                                                    RESTARTS   AGE
nodejs-hello-1-deploy   0/1       Image: openshift/origin-deployer:v1.0.4 is ready, container is creating   0          3m

$ oc describe pods nodejs-hello-1-deploy

Name:                           nodejs-hello-1-deploy
Namespace:                      ric03uec-cli
@ric03uec
ric03uec / .gitignore
Last active August 29, 2015 14:26
kube install multi node
*.swp
*.swo
@ric03uec
ric03uec / clean.sh
Created April 17, 2015 19:09
remove docker containers based on time
#!/bin/bash -e
if [[ $# > 0 ]]; then
export MAX_CONTAINER_UPTIME_MINS=$1
else
export MAX_CONTAINER_UPTIME_MINS=30
fi
echo "Removing containers older than: $MAX_CONTAINER_UPTIME_MINS minutes"
@ric03uec
ric03uec / Vagrantfile
Last active January 2, 2023 11:39
flannel setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.define "host1" do |hostone|
@ric03uec
ric03uec / Vagrantfile
Last active June 26, 2018 09:36
kube cluster setup on 2 nodes
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.define "kube-master" do |master|
@ric03uec
ric03uec / install
Created December 25, 2014 23:39
haproxy install
$ sudo add-apt-repository ppa:vbernat/haproxy-1.5
$ apt-get update
$ apt-get install haproxy
$ mkdir -p /etc/haproxy/ssl
$ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/haproxy/ssl/haproxy.key -out /etc/haproxy/ssl/haproxy.crt
Generating a 2048 bit RSA private key
.................+++
.....................+++
writing new private key to '/etc/haproxy/ssl/haproxy.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
@ric03uec
ric03uec / console
Created December 25, 2014 18:09
telnet into rabbitmq
$ telnet localhost 5672
Trying 127.0.0.1
Connected to localhost
Escape character is '^]'.
AMQP Connection closed by foreign host.
@ric03uec
ric03uec / haproxy.cfg
Last active August 29, 2015 14:12
haproxy configuration
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
user haproxy
group haproxy
daemon
defaults