Skip to content

Instantly share code, notes, and snippets.

View Kiran01bm's full-sized avatar

kiran01bm Kiran01bm

View GitHub Profile
@Kiran01bm
Kiran01bm / markdown-details-collapsible.md
Created February 10, 2021 02:01 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

A collapsible section containing markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets
@Kiran01bm
Kiran01bm / cpuprofiler.js
Last active May 17, 2020 04:07 — forked from danielkhan/cpuprofiler.js
nodejs v8 cpu profiler
/**
* Simple userland CPU profiler using v8-profiler
* Usage: require('[path_to]/CpuProfiler').init('datadir')
*
* @module CpuProfiler
* @type {exports}
*/
var fs = require('fs');
// v8-profiler-node8 is Based on v8-profiler-node8@5.7.0, Solved the v8-profiler segment fault error in node-v8.x.
@Kiran01bm
Kiran01bm / mvnSetUp.md
Last active November 26, 2019 06:01
SpringBoot Sample and Maven Set-up + Build

General Notes

Download Maven Zip

Unzip and Update PATH

tar -tvzf ~/Downloads/apache-maven-3.6.2-bin.tar.gz
tar -xvzf ~/Downloads/apache-maven-3.6.2-bin.tar.gz

Append the below to your shell profile ex: ~/.zshrc
@Kiran01bm
Kiran01bm / mvnSetUp.md
Created November 26, 2019 05:26
maven set-up

General Notes

Download Maven Zip

Unzip and Update PATH

tar -tvzf ~/Downloads/apache-maven-3.6.2-bin.tar.gz
tar -xvzf ~/Downloads/apache-maven-3.6.2-bin.tar.gz

Append the below to your shell profile ex: ~/.zshrc
@Kiran01bm
Kiran01bm / incrementalAndMultiStageBuilds.md
Created November 25, 2019 02:39
Incremental and Multi-Stage Builds

Incremental Builds and Multi-Stage Builds

From here

Multi-stage Builds Key Points to Note:

  1. Multi-stage builds are commonly used to keep build dependencies out of the final Docker image.
  2. The first stage imports the source tree, installs the build toolchain, and produces the build artifact.
  3. The second stage extracts the build artifact and copies it into a minimal base image. This is achieved using the COPY --frominstruction, which allows copying files from another image or build stage.
@Kiran01bm
Kiran01bm / npmrc.md
Last active July 30, 2019 02:35
NPM Repo Auth

Assumptions:

  1. You have created the private, public and virtual NPM repos and associated blob stores.
  2. Created a user with access to be able to read and publish to npm repo
  3. You have added a npm bearer token realm to be able to do publish. Publish requires user authentication and realm config on server. Note: The default realm that is applied is called the Local Authentication and Local Authorization realm. They allow the repository manager to manage security setup without additional external systems.
  4. No npmrc to begin with, If you have one then rename it before going ahead.
~/Documents/GIT/project/temp/tulsi-node on  master! ⌚ 13:48:15
$ cat ~/.npmrc
cat: /Users/kiran/.npmrc: No such file or directory
@Kiran01bm
Kiran01bm / gist:86f91b668abea18de82de15ac4bcdd78
Created July 18, 2019 03:12 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@Kiran01bm
Kiran01bm / ec2RHELSetStaticHostName
Created July 18, 2019 00:51
Set Static hostname on EC2 RHEL
1. hostname - Before change
2. sudo hostnamectl set-hostname --static ip-xxx-xxx-xxx-xxx.us-east-2.compute.internal
3. Add "preserve_hostname: true" to /etc/cloud/cloud.cfg
4. Reboot
5. hostname - After change
@Kiran01bm
Kiran01bm / EBS expansion of LVM Backed volumes
Created June 7, 2019 07:55
EBS expansion of LVM Backed volumes
Procedure:
1. Expand EBS volume
2. Grow Partition - growpart
3. Physical Volume Resize - pvresize
4. Logical Volume Resize - lvresize
5. Resize File System - resize2fs
In this Example we have - 2 Disks, 1 VG, 2 PVs, 3 LVs and EXT4 Filesystem. For XFS use xfs_growfs instead of resize2fs
[root@ip-masked docker-compose-related]# pvs
@Kiran01bm
Kiran01bm / nginx.conf
Created May 21, 2019 23:03
Nginx config when Backend is SNI based.
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
#####################################################################################################################
########## For backend which is based on SNI - 3 options:
#1. Set HOST header with the actual domain name for the backend.
# OR
#2. Add the SNI lines below and HOST header (#1) not required in that case.
# OR