Skip to content

Instantly share code, notes, and snippets.

Avatar

Anoop Vijayan Maniankara maniankara

View GitHub Profile
@maniankara
maniankara / fabric-node-configs.csv
Last active Dec 8, 2019
Used as a table for medium article
View fabric-node-configs.csv
NODE SERVICES IP OS HARDWARE
Admin node Orderer/fabric-ca 192.168.10.142 Ubuntu 18.04 1vCPU/1GB RAM/80GB HDD
Peer node Peer0 192.168.10.143 Ubuntu 18.04 1vCPU/1GB RAM/80GB HDD
View elastic-blog-versions.csv
APPLICATION VERSION
elastic 7.1
golang 1.11
docker 18.09
docker-compose 1.23
python 2.7
@maniankara
maniankara / elasticstack-docker.yaml
Created May 30, 2019
Elasticsearch and Kibana 7.2
View elasticstack-docker.yaml
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.2
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
@maniankara
maniankara / walk.go
Last active May 30, 2019
Simple Golang snippet which checks for file availability on filesystem - Used in blog
View walk.go
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() {
err := filepath.Walk("/home/go", func(path string, info os.FileInfo, err error) error {
@maniankara
maniankara / fe-be-lb-stack.yaml
Created May 10, 2019
Deploy a node frontend with elasticsearch backend
View fe-be-lb-stack.yaml
---
apiVersion: v1
kind: Service
metadata:
name: loadbalancer
spec:
selector:
app: node
ports:
- protocol: TCP
View kubenetes_max_pod_limit_medium
$ kubectl describe po/nginx-77c5cd5446-8rcjm
Name: nginx-77c5cd5446-8rcjm
Namespace: default
Priority: 0
PriorityClassName: <none>
Node: <none>
Labels: app=nginx
pod-template-hash=77c5cd5446
Annotations: <none>
Status: Pending
@maniankara
maniankara / provision-moosefs.sh
Last active Sep 7, 2018
Script for provisioning moosefs chunk server on redhat/amazon based distros
View provision-moosefs.sh
#!/bin/bash
ip=$1
size=$2
device=$3
# Install certificates and Repository
curl "https://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > /etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS
curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > /etc/yum.repos.d/MooseFS.repo
# Install moosefs-chunkserver, fuse and others
yum install -y gnupg2 ca-certificates e2fsprogs xfsprogs moosefs-chunkserver
# Provision and mount volume
@maniankara
maniankara / unmarshal.go
Created Aug 24, 2018
Unmarshalling a arbitrary json list. There are several examples of nested list but not at root
View unmarshal.go
// try here: https://play.golang.org/p/SChzGHXYgOU
package main
import (
"encoding/json"
"fmt"
)
func main() {
birdJson := `{"birds":[{"pigeon":"likes to perch on rocks","eagle":"bird of prey"}]}`
View kubernetes-csi-node.proto
service Node {
// temporarily mount the volume to a staging path
rpc NodeStageVolume (NodeStageVolumeRequest)
returns (NodeStageVolumeResponse) {}
// unmount the volume from staging path
rpc NodeUnstageVolume (NodeUnstageVolumeRequest)
returns (NodeUnstageVolumeResponse) {}
// mount the volume from staging to target path
View kubernetes-csi-controller.proto
service Controller {
// provisions a volume
rpc CreateVolume (CreateVolumeRequest)
returns (CreateVolumeResponse) {}
// deletes a previously provisioned volume
rpc DeleteVolume (DeleteVolumeRequest)
returns (DeleteVolumeResponse) {}
// make a volume available on some required node