Skip to content

Instantly share code, notes, and snippets.

View worldofprasanna's full-sized avatar
🔥
Game is on

Prasanna worldofprasanna

🔥
Game is on
View GitHub Profile
@worldofprasanna
worldofprasanna / sha512-hashing.go
Created November 6, 2018 23:35
Hashing technique
input := "Hello World"
sha512Instance := sha512.New()
sha512Instance.Write([]byte(input))
fmt.Printf("sha512:\t\t%x\n", sha512Instance.Sum(nil))
@worldofprasanna
worldofprasanna / aes-gcm-encryption.go
Last active November 6, 2018 23:30
AES GCM Encryption in golang
key := "Symmetric Key" //
func getGCM() {
if block, err := aes.NewCipher(key); err != nil {
return nil, err
} else if gcm, err := cipher.NewGCM(block); err != nil {
return nil, err
} else {
return gcm, nil
}
}
@worldofprasanna
worldofprasanna / base64-encoding.go
Last active November 6, 2018 23:20
Base64 Encoding
plainText := "Hello World"
plainTextBytes := []byte(plainText)
cipherText := base64.StdEncoding.EncodeToString(plainTextBytes)
fmt.Println(cipherText)
// Output: SGVsbG8gV29ybGQ=

Keybase proof

I hereby claim:

  • I am worldofprasanna on github.
  • I am worldofprasanna (https://keybase.io/worldofprasanna) on keybase.
  • I have a public key ASAOPCbafRrvnqn7HeVnyY-sUuhIPV5R8qz2bgTbeqREigo

To claim this, I am signing this object:

@worldofprasanna
worldofprasanna / crescent-cloud-computing-session.sh
Last active April 25, 2018 12:57
Useful commands to be shown in crescent college
# Install jekyll
gem install jekyll bundler
# Create new site and serve it
jekyll new crescent-college-website
cd crescent-college-website
jekyll serve
# git commands
git clone <repo-url>
@worldofprasanna
worldofprasanna / enable-vi-command-line.sh
Created March 30, 2018 09:15
Enable vi mode in command line with indicator for Normal/Insert mode
# Indicate whether user is in Normal / Insert mode
function zle-line-init zle-keymap-select {
VIM_PROMPT="%{$fg_bold[yellow]%} [% NORMAL]% %{$reset_color%}"
RPS1="${${KEYMAP/vicmd/$VIM_PROMPT}/(main|viins)/} $EPS1"
zle reset-prompt
}
set -o vi
zle -N zle-line-init
@worldofprasanna
worldofprasanna / k8s-handy-ref.sh
Created December 8, 2017 11:28
Kubernetes Handy Ref
# To delete all the deployments
kubectl get deployments --namespace default -o jsonpath="{.items[*].metadata.name}" | xargs kubectl delete deployment
@worldofprasanna
worldofprasanna / minikube-handy-ref.sh
Last active September 15, 2020 10:48
Minikube commands
# Start minikube cluster in local
minikube start
# optionally start with cpu s and memory
minikube start --cpus=4 --memory=4096
# to change the docker machine to point to the kubernetes cluster
eval $(minikube docker-env)
# Note: Kubernetes supports docker version - 1.11.1.
@worldofprasanna
worldofprasanna / docker-handy-ref-2.sh
Last active March 7, 2017 01:18
Docker useful commands
Reference: https://prakhar.me/docker-curriculum/#busybox
# Run a static website in background. d - detach mode, P - expose all ports, --name give name to the running container
docker run -d -P --name static-site prakhar1989/static-site
# To see the ports used
docker port static-site
# Docker networks
@worldofprasanna
worldofprasanna / vim-org-mode-gotchas.md
Last active November 3, 2016 16:53
Quick Ref for Vim org mode

Useful commands in vim-orgmode

Headers

      1. *, **, etc for creating headings, sub headings
      2. To continue headers, press <enter> in normal mode
      3. >>, << to convert sub headers to headers or vice versa
      4. <Tab> and <S-Tab> to fold headers
      5. zm, zr to close the whole list