Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Utkarsh Mani Tripathi utkarshmani1997

🎯
Focusing
Block or report user

Report or block utkarshmani1997

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@utkarshmani1997
utkarshmani1997 / map.go
Created Jun 1, 2019
Idiomatic vs non-idiomatic
View map.go
package main
import "fmt"
type myMap map[string]string
func (m myMap) contains(key string) (val string, ok bool) {
val, ok = m[key]
return val, ok
}
@utkarshmani1997
utkarshmani1997 / vm-resize-hard-disk.md
Created Nov 13, 2018 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.
View vm-resize-hard-disk.md

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

View battery_monitor.py
#!/usr/bin/env python
from gi.repository import Notify
import subprocess
from time import sleep, time
from sys import argv
import dbus
def send_notification(title, text):
try:
View openebs-provisioner.go
// logic with decorator
// logging functions are exported from github.com/opentracing/opentracing-go/log
func Objdecorator(f func(key string, obj interface{}) log.Field) func(string, interface{}) log.Field {
return func(key string, obj interface{}) log.Field {
return log.Object(key, obj)
}
}
func Strdecorator(f func(key, val string) log.Field) func(string, string) log.Field {
return func(key, value string) log.Field {
View maya-exporter.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: maya-agent
spec:
replicas: 1
template:
metadata:
labels:
name: maya-agent
View service.yaml
apiVersion: v1
kind: Service
metadata:
name: goserver-service
spec:
selector:
app: goserver
type: NodePort
ports:
- port: 80
View hello.yaml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: server-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: goserver
View hello.go
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, the end point is : %s !", r.URL.Path[1:])
}
View weave net describe
Name: weave-net-t88k6
Namespace: kube-system
Node: kubeminion-02/172.28.128.5
Start Time: Wed, 11 Oct 2017 05:09:52 +0000
Labels: controller-revision-hash=2720543195
name=weave-net
pod-template-generation=1
Annotations: kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"DaemonSet","namespace":"kube-system","name":"weave-net","uid":"8f898ca2-ae41-11e7-b962-021c6f7dbe9d","apiV...
Status: Running
IP: 172.28.128.5
View percona describe
Name: percona
Namespace: default
Node: kubeminion-02/172.28.128.5
Start Time: Wed, 11 Oct 2017 07:15:34 +0000
Labels: name=percona
Annotations: <none>
Status: Running
IP: 10.36.0.3
Containers:
percona:
You can’t perform that action at this time.