Skip to content

Instantly share code, notes, and snippets.

View alok87's full-sized avatar
🎧
Working from home

Alok Kumar Singh alok87

🎧
Working from home
View GitHub Profile
code: 0
data:
avg_latency: 0.001652
histogram:
- [0, 993783]
- [1, 2130949]
- [2, 720051]
- [3, 163491]
- [4, 107124]
- [5, 51909]
@alok87
alok87 / conditonalDefaultsCobra.go
Created November 19, 2016 03:23
spf13/cobra Providing conditional default values
## Question
Suppose i have a command cmd
```
cmd --opt1=['public'|'private'] --opt2=[true|false]
```
How do i define `--opt2` defaut value to `false` if `--opt1` is `public`
and `--opt2` default value to `true` if `--opt1` is `private` ?
unbind C-b
# set -g prefix `
# bind-key ` send-prefix
# Example tmux.conf
# 2014.10
### General
###########################################################################
set -g mouse on
@alok87
alok87 / sendmail.go
Created October 21, 2015 10:10
Sendmail Using Golang without SMTP- Example
package main
import (
"io/ioutil"
"os/exec"
"fmt"
)
// EXAMPLE: echo "Subject: TestnHello" | sendmail -f you@domain.com you@domain.com
// Useful Links: https://gobyexample.com/spawning-processes