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 / 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 / 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"

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 / 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

@nk-gears
nk-gears / wildcard-certificates.md
Created October 19, 2018 11:19 — forked from joepie91/wildcard-certificates.md
Why you probably shouldn't use a wildcard certificate

Recently, Let's Encrypt launched free wildcard certificates. While this is good news in and of itself, as it removes one of the last remaining reasons for expensive commercial certificates, I've unfortunately seen a lot of people dangerously misunderstand what wildcard certificates are for.

Therefore, in this brief post I'll explain why you probably shouldn't use a wildcard certificate, as it will put your security at risk.

A brief explainer

It's generally pretty poorly understood (and documented!) how TLS ("SSL") works, so let's go through a brief explanation of the parts that are important here.

The general (simplified) idea behind how real-world TLS deployments work, is that you:

@nk-gears
nk-gears / Windows10-Setup.ps1
Created November 16, 2018 17:03 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@nk-gears
nk-gears / csv_import_magic.js
Created February 8, 2019 11:58 — forked from ianlewis/csv_import_magic.js
A Google Apps Script for importing CSV data into a Google Spreadsheet.
// vim: ft=javascript:
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true */
/*global SpreadsheetApp, UiApp, UrlFetchApp, Utilities */
/*
* A script to automate requesting data from an external url that outputs CSV data.
*
* Adapted from the Google Analytics Report Automation (magic) script.
* @author nickski15@gmail.com (Nick Mihailovski)
* @author ianmlewis@gmail.com (Ian Lewis)
*/
@nk-gears
nk-gears / sparse_clones.md
Created March 16, 2019 15:38 — forked from hofnerb/sparse_clones.md
Make sparse clone
git init <repo>
cd <repo>
git remote add -f origin <url>

This creates an empty repository with your remote, and fetches all objects but doesn't check them out. Then do:

git config core.sparseCheckout true
@nk-gears
nk-gears / MySQL_5-7_macOS.md
Created March 21, 2019 11:06 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.