Skip to content

Instantly share code, notes, and snippets.

@dalitun
dalitun / jwt-example.go
Created January 7, 2018 02:26
JsonWebTokens Example with generated key.
/* rewritten example of JsonWebToken example
* from https://gist.github.com/thealexcons/4ecc09d50e6b9b3ff4e2408e910beb22
* Keys are generated and packed to PEM-format at server start
* Plus some fixes and refactors
*
* My respect to thealexcons
*/
package main
import (
@dalitun
dalitun / jwt_golang_example.go
Created January 7, 2018 02:27 — forked from thealexcons/jwt_golang_example.go
JSON Web Tokens in Go
package main
import (
"io/ioutil"
"log"
"strings"
"net/http"
"encoding/json"
"fmt"
"time"
@dalitun
dalitun / main.go
Created January 7, 2018 02:30 — forked from chadlung/main.go
An example Go (golang) REST service that uses JWT (JSON Web Tokens) and Negroni http://www.giantflyingsaucer.com/blog/?p=5994
package main
// Generate RSA signing files via shell (adjust as needed):
//
// $ openssl genrsa -out app.rsa 1024
// $ openssl rsa -in app.rsa -pubout > app.rsa.pub
//
// Code borrowed and modified from the following sources:
// https://www.youtube.com/watch?v=dgJFeqeXVKw
// https://goo.gl/ofVjK4
@dalitun
dalitun / Dockerfile
Created January 9, 2018 21:51 — forked from orenitamar/Dockerfile
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
@dalitun
dalitun / awxinstalleronopenshift.sh
Created August 16, 2018 09:12 — forked from erbrito/awxinstalleronopenshift.sh
Deploy of AWX (Ansible Tower) on OpenShift
mkdir Tower
cd Tower/
git clone https://github.com/ansible/awx.git
cd awx
cd installer/
#vi inventory
-# openshift_host=127.0.0.1:8443
-# awx_openshift_project=awx
-# openshift_user=developer
@dalitun
dalitun / receive.py
Created August 28, 2018 07:49 — forked from tomas-stefano/receive.py
RabbitMQ example in Python
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
def callback(ch, method, properties, body):
print "[x] Received: %r" % (body,)
channel.basic_consume(callback, queue='hello', no_ack=True)
@dalitun
dalitun / gist:36d90b47bde4d88c097907f8d3e8c772
Created September 28, 2018 21:52 — forked from jcantrill/gist:eca85af2057b84642510cc086f1e5b97
Standing up Openshift using 'oc cluster up' and ansible
Overview
At the time of writing this document, 'oc cluster up --logging' or its 3.11 equivalent is broken. Following are instructions on using 'oc cluster up' followed by ansible to install logging. These instructions are generally valid for any Openshift release from 3.5 to 3.11.
Environment
These instructions are based on using:
Host: Centos 7 on libvirt
Mem: 8G
@dalitun
dalitun / README.md
Created September 29, 2018 11:57 — forked from kmassada/README.md
Vagrant and KVM(QEMU) on Centos7

Libvirt

yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf
@dalitun
dalitun / Install Vagrant Libvirt Fedora 27.md
Created September 29, 2018 12:03 — forked from gangsta/Install Vagrant Libvirt Fedora 27.md
How to install Libvirt Vagrant on Fedora 27

How to Install Vagrant and Livbirt Fedora 27

Check for cpu Virtualization

lsmod | grep kvm
kvm_intel             167936  3
kvm                   499712  1 kvm_intel

Install

@dalitun
dalitun / k8s-user-data.sh
Created October 8, 2018 19:40 — forked from initcron/k8s-user-data.sh
kubernetes user data script
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install \
apt-transport-https \
ca-certificates \
curl \