Skip to content

Instantly share code, notes, and snippets.

View nk-gears's full-sized avatar
💥
experimenting...

Nirmal nk-gears

💥
experimenting...
View GitHub Profile
@nk-gears
nk-gears / install-comodo-ssl-cert-for-nginx.md
Created October 19, 2018 11:16 — forked from sharathchandramg/install-comodo-ssl-cert-for-nginx.md
Steps to install a Comodo Wildcard certificate with Nginx.

The steps below show how to install comodo certificate on centos7.

I have used bigrock.in for the domain registration and procuring the certificates

Create a certificate request

  1. Create a folder to put all our ssl certificates

     mkdir /etc/nginx/ssl/c2r_com
    

cd /etc/nginx/ssl/c2r_com

Steps to create ssh-key pai required when creating the VM's in GCP/AWS

ssh-keygen -t rsa ~/.ssh/staging.mobileoffize.com -C <user_name>

This will generate public key and private key pairs in the location sepcified above

Copy the ssh-keys in to cloud instances

If we are creating new instance

@nk-gears
nk-gears / cloudbuild.yaml
Created October 4, 2018 15:19 — forked from ShakataGaNai/cloudbuild.yaml
A sample cloudbuild.yml - details at https://obviate.io/?p=7913
steps:
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'gcr.io/yourorg/mystaticsite:$COMMIT_SHA', '.' ]
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'gcr.io/yourorg/mystaticsite:latest', '.' ]
images:
- 'gcr.io/yourorg/mystaticsite:$COMMIT_SHA'
- 'gcr.io/yourorg/mystaticsite:latest'
tags:
- "cloudbuild"
@nk-gears
nk-gears / bitbucket-pipelines.yml
Created September 20, 2018 06:37 — forked from adilsoncarvalho/bitbucket-pipelines.yml
Bitbucket Pipelines deployment to a Google Container Engine configuration
options:
docker: true
pipelines:
branches:
master:
- step:
image: google/cloud-sdk:latest
name: Deploy to production
deployment: production
caches:
@nk-gears
nk-gears / bitbucket-pipelines.yml
Created September 20, 2018 06:37 — forked from adilsoncarvalho/bitbucket-pipelines.yml
Bitbucket Pipelines deployment to a Google Container Engine configuration
options:
docker: true
pipelines:
branches:
master:
- step:
image: google/cloud-sdk:latest
name: Deploy to production
deployment: production
caches:
@nk-gears
nk-gears / Login-Page.js
Created September 5, 2018 07:47 — forked from joelgriffith/Login-Page.js
Simple React login-page for testing
import React, { Component } from 'react';
import './App.css';
class LoginPage extends Component {
constructor() {
super();
this.state = {
username: '',
password: '',
error: '',

I have been an aggressive Kubernetes evangelist over the last few years. It has been the hammer with which I have approached almost all my deployments, and the one tool I have mentioned (shoved down clients throats) in almost all my foremost communications with clients, and it was my go to choice when I was mocking my first startup (saharacluster.com).

A few weeks ago Docker 1.13 was released and I was tasked with replicating a client's Kubernetes deployment on Swarm, more specifically testing running compose on Swarm.

And it was a dream!

All our apps were already dockerised and all I had to do was make a few modificatons to an existing compose file that I had used for testing before prior said deployment on Kubernetes.

And, with the ease with which I was able to expose our endpoints, manage volumes, handle networking, deploy and tear down the setup. I in all honesty see no reason to not use Swarm. No mission-critical feature, or incredibly convenient really nice to have feature in Kubernetes that I'm go

@nk-gears
nk-gears / nginxproxy.md
Created August 30, 2018 06:23 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@nk-gears
nk-gears / README.md
Created August 25, 2018 05:10 — forked from mill1000/README.md
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

@nk-gears
nk-gears / 01-directory-structure.md
Created June 30, 2018 09:13 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used