Skip to content

Instantly share code, notes, and snippets.

View shudipta's full-sized avatar

Shudipta Sharma shudipta

View GitHub Profile
@shudipta
shudipta / MinGW-w64.sublime-build
Created September 30, 2017 07:38 — forked from sagebind/MinGW-w64.sublime-build
Sublime Text 3 C++ build system for mingw-w64
{
"cmd": ["g++", "-o", "${file_path}/${file_base_name}.exe", "-static-libgcc", "-static-libstdc++", "*.cpp"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.cpp, source.c++",
"path": "c:/Program Files/mingw-w64/mingw64/bin",
"shell": true,
"variants": [
{
"name": "Run",
@shudipta
shudipta / contents
Last active April 10, 2018 12:18
gist for patch issue
obj:
{"metadata":{"name":"labels-567ffd7c48","namespace":"kube-system","creationTimestamp":null,"labels":{"app":"label_extractor","pod-template-hash":"1239983704"},"annotations":{"deployment.kubernetes.io/desired-replicas":"1","deployment.kubernetes.io/max-replicas":"2","deployment.kubernetes.io/revision":"1","docker.com/labels-git-commit":"unkown","hi":"hello"},"ownerReferences":[{"apiVersion":"extensions/v1beta1","kind":"Deployment","name":"labels","uid":"ff0c41a7-3cb6-11e8-b788-080027b151f8","controller":true,"blockOwnerDeletion":true}]},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"label_extractor","pod-template-hash":"1239983704"}},"template":{"metadata":{"creationTimestamp":null,"labels":{"app":"label_extractor","pod-template-hash":"1239983704"}},"spec":{"containers":[{"name":"labels","image":"shudipta/labels","ports":[{"containerPort":80,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always"}],"restartPolic
Wed Jun 20 05:59:16 UTC 2018
@shudipta
shudipta / Uninstall.md
Created August 14, 2018 17:57 — forked from pokisin/Uninstall.md
Uninstall git, ubuntu

Uninstall git

To remove just git package itself from Ubuntu 14.04 execute on terminal:

$ sudo apt-get remove git

Uninstall git and it's dependent packages

To remove the git package and any other dependant package which are no longer needed from Ubuntu Trusty.

$ sudo apt-get remove --auto-remove git
@shudipta
shudipta / redis-ha-sentinel
Last active August 17, 2018 10:11
redis-ha-sentinel
apiVersion: v1
kind: Pod
metadata:
name: redis-master
labels:
app: sentinel
role: master
spec:
containers:
- name: redis-master
@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 " "
#!/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 " "
$ kubectl create -f sts-svc.yaml
$ kubectl logs -f web-0
PING web-0.test (10.28.0.104): 56 data bytes
64 bytes from 10.28.0.104: seq=0 ttl=64 time=0.029 ms
--- web-0.test ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.029/0.029/0.029 ms
PING web-1.test (10.28.2.71): 56 data bytes
@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:

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