Skip to content

Instantly share code, notes, and snippets.

View atulsingh0's full-sized avatar
🎯
Focusing

Atul S atulsingh0

🎯
Focusing
View GitHub Profile
@atulsingh0
atulsingh0 / keybase.md
Last active September 11, 2023 21:04
keybase.md

Keybase proof

I hereby claim:

  • I am atulsingh0 on github.
  • I am datagenx (https://keybase.io/datagenx) on keybase.
  • I have a public key ASCDVeOwxialswIyGGVxeA8-_LfgwhG4r98XtEe14XrmkQo

To claim this, I am signing this object:

@atulsingh0
atulsingh0 / sorted-random-no-list.go
Last active September 20, 2022 22:54
Math/Rand or Crypto/Rand Package - Golang
// Go Playground
// https://go.dev/play/p/enEBiI2_5hd
package main
import (
"fmt"
"math/rand"
"sort"
"time"
@atulsingh0
atulsingh0 / create-directory.go
Last active September 28, 2022 03:23
Package OS - Golang
// Go Playground
// https://go.dev/play/p/MF-dT57HXTM
package main
import (
"fmt"
"os"
)
@atulsingh0
atulsingh0 / element-exists-in-slice.go
Last active September 11, 2022 06:13
GoLang Snippets
// Go Playground
// https://go.dev/play/p/PxPhvxz5PQh
package main
import "fmt"
func isExists(list []int, item int) bool {
for _, v:= range list {
@atulsingh0
atulsingh0 / random_string.sh
Created July 18, 2022 15:48
Random Generation of Password String in Linux, Mac & Windows (WSL)
alias randstr='cat /dev/urandom | env LC_ALL=C tr -dc 'A-Za-z0-9' | head -c'
# usage
randstr 20 # lmfcYuRZ0xAlRZhN3Uy2
@atulsingh0
atulsingh0 / mountVol_k8s.yml
Last active March 22, 2022 15:41
Mount Volume
apiVersion: v1
kind: Pod
metadata:
name: z-test-pod
spec:
containers:
- name: test
image: busybox
command: [ "/bin/sh", "-c", "sleep 7200" ]
volumeMounts:
@atulsingh0
atulsingh0 / delete_all_pod_oneliner.sh
Last active December 7, 2021 19:49
Deleting All Kubernetes POD in one line
kubectl get pods --no-headers -o "name" | xargs kubectl delete pod
@atulsingh0
atulsingh0 / urldecode.sh
Created December 7, 2021 13:19
Urldecode - Bash/Python Oneliner/Alias for Url decoding
alias urldecode='python -c "import sys, urllib as ul; print ul.unquote_plus(sys.argv[1])"'
### Usgae
#
# $ urldecode https%3A%2F%2Fwww.google.com
# https://www.google.com
@atulsingh0
atulsingh0 / urlencode.sh
Last active December 7, 2021 13:17
Urlencode - Bash/Python Oneliner/Alias for Url encoding
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1])"'
### Usgae
#
# $ urlencode https://www.google.com
# https%3A%2F%2Fwww.google.com
@atulsingh0
atulsingh0 / yml2json.sh
Last active December 7, 2021 13:08
Yaml to JSON - One Liner in Python/Bash
alias yml2json='python -c "import sys, yml, json; print json.safe_dump(yaml.loads(sys.stdin.read()))"'
## Usage
##
##
## cat yaml_file | yml2json