Skip to content

Instantly share code, notes, and snippets.

View thiyagaraj's full-sized avatar

Thiyagaraj Krishna thiyagaraj

View GitHub Profile

TLS/Certificates cheatsheet

Save certificate being presented by any endpoint

$ echo -n | openssl s_client -connect HOSTNAME:PORT | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > server.pem
@thiyagaraj
thiyagaraj / git_submodules.md
Created July 19, 2018 03:00 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@thiyagaraj
thiyagaraj / README.MD
Created August 6, 2018 18:34 — forked from samdenty/README.MD
VS Code CSS addition to increase readability on file tree.

How to install

Custom CSS plugin

Install the custom CSS plugin, then make a file on your computer that will hold your custom CSS, I like to make one in my home directory called ~/.vscodestyles.css and then add the CSS into it.

Once done, open your command palette and select enable custom CSS and JS

@thiyagaraj
thiyagaraj / README.md
Created December 23, 2018 03:48 — forked from squidpickles/README.md
Multi-platform (amd64 and arm) Kubernetes cluster

Multiplatform (amd64 and arm) Kubernetes cluster setup

The official guide for setting up Kubernetes using kubeadm works well for clusters of one architecture. But, the main problem that crops up is the kube-proxy image defaults to the architecture of the master node (where kubeadm was run in the first place).

This causes issues when arm nodes join the cluster, as they will try to execute the amd64 version of kube-proxy, and will fail.

It turns out that the pod running kube-proxy is configured using a DaemonSet. With a small edit to the configuration, it's possible to create multiple DaemonSets—one for each architecture.

Steps

Follow the instructions at https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ for setting up the master node. I've been using Weave Net as the network plugin; it see

@thiyagaraj
thiyagaraj / jquery.slider.custom.step.js
Created February 4, 2014 14:38
jQuery UI slider, custom step or snap points
//This should have each valid amount that can be selected in the slider
var sliderAmountMap = [10000, 20000,30000, 40000, 45000,50000,65000];
$(function() {
$( "#slider" ).slider({
value: 4, //array index of onload selected default value on slider, for example, 45000 in same array will be selected as default on load
min: 0, //the values will be from 0 to array length-1
max: sliderAmountMap.length-1, //the max length, slider will snap until this point in equal width increments
@thiyagaraj
thiyagaraj / jks-to-pem.md
Last active November 28, 2023 23:48
Convert jks/java keystore and get public and private keys as pem

Convert jks and get public and private keys out:

keytool -importkeystore -srckeystore default.keystore -destkeystore new-store.p12 -deststoretype PKCS12

  • Gives new-store.p12

openssl pkcs12 -in new-store.p12 -nokeys -out public.pem

  • Gives public key as public.pem

openssl pkcs12 -in new-store.p12 -nodes -nocerts -out private.pem

  • Gives private key as private.pem