Skip to content

Instantly share code, notes, and snippets.

View shudipta's full-sized avatar

Shudipta Sharma shudipta

View GitHub Profile
@shudipta
shudipta / colors.go
Last active July 28, 2020 00:35 — forked from ik5/colors.go
Simple golang expirement with ANSI colors
package main
// http://play.golang.org/p/jZ5pa944O1 <- will not display the colors
import "fmt"
const (
InfoColor = "\033[1;34m%s\033[0m"
NoticeColor = "\033[1;36m%s\033[0m"
WarningColor = "\033[1;33m%s\033[0m"
ErrorColor = "\033[1;31m%s\033[0m"
DebugColor = "\033[0;36m%s\033[0m"
@shudipta
shudipta / update-golang.md
Created January 9, 2020 09:15 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@tamalsaha
tamalsaha / instructions.md
Last active October 24, 2019 21:31
Linter fixes

Regular Code

utilruntime "k8s.io/apimachinery/pkg/util/runtime"

func Must(err error) {
	if err != nil {
		panic(err)
	}
}
#!/bin/bash
export MINIKUBE_VER=v1.0.0
export KUBECTL_VER=`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`
show_help() {
echo "mk-kc.sh - update minikube and kubectl"
echo " "
echo "mk-kc.sh [options]"
echo " "
@shudipta
shudipta / cp+.sh
Last active August 7, 2020 14:27
Build and run c++ source file, flags for c++11 and c++14 can be used, some simple checking for flags and arg, show help
#!/bin/bash
set -eou pipefail
export VERSION=14
export ARGS=0
export FILE=
show_help() {
echo "c++14 - builds and runs a c++ source file specified by the only argument"
echo " "
@fjudith
fjudith / kubernetes_service_session_affinity.md
Last active May 13, 2024 01:10
Enable Session Affinity (a.k.a Sticky Session) to Kubernetes service
@sanjid133
sanjid133 / Install etcd On Ubuntu 16.04.md
Last active March 23, 2021 09:33
Install etcd On Ubuntu 16.04/18.04
#!/bin/bash
ETCD_VERSION=${ETCD_VERSION:-v3.3.1}
curl -L https://github.com/coreos/etcd/releases/download/$ETCD_VERSION/etcd-$ETCD_VERSION-linux-amd64.tar.gz -o etcd-$ETCD_VERSION-linux-amd64.tar.gz
tar xzvf etcd-$ETCD_VERSION-linux-amd64.tar.gz
rm etcd-$ETCD_VERSION-linux-amd64.tar.gz
cd etcd-$ETCD_VERSION-linux-amd64
@nikhita
nikhita / update-golang.md
Last active July 3, 2024 13:01
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@lefred
lefred / addition_to_sys.sql
Last active May 24, 2023 12:28
MySQL Group Replication extra functions and views to sys schema
USE sys;
DELIMITER $$
CREATE FUNCTION IFZERO(a INT, b INT)
RETURNS INT
DETERMINISTIC
RETURN IF(a = 0, b, a)$$
CREATE FUNCTION LOCATE2(needle TEXT(10000), haystack TEXT(10000), offset INT)
@rponte
rponte / get-latest-tag-on-git.sh
Last active May 16, 2024 06:48
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples