Skip to content

Instantly share code, notes, and snippets.

View harshavardhana's full-sized avatar
🌚
I may be slow to respond.

Harshavardhana harshavardhana

🌚
I may be slow to respond.
View GitHub Profile
~ kubectl create secret generic my-secret --from-file=config.yml

~ kubectl apply -f minio1.yml
~ kubectl apply -f minio2.yml
~ kubectl apply -f minio3.yml

~ kubectl apply -f radio.yml
mirror:
- local:
bucket: radiobucket1
access_key: Q3AM3UQ867SPQQA43P2F
secret_key: zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
remote:
- bucket: bucket1
endpoint: http://domain1.com:9001
access_key: TX8mIIOGC12QBMJ45F0Z
secret_key: 9ule1ga5JMfMmQXCoEPNcM2jij
version: '3.7'
# starts 4 docker containers running minio server instances. Each
# minio server's web interface will be accessible on the host at port
# 9001 through 9004.
services:
minio1:
image: y4m4/minio:latest
volumes:
- data1-1:/data1
@harshavardhana
harshavardhana / install-quake3.sh
Last active December 11, 2019 05:11 — forked from simonewebdesign/install-quake3.sh
Install Quake 3: Arena on a mac
#!/bin/bash
# Install Quake 3: Arena on a mac
set -e # exit on error
if [ ! -d ${HOME}/ioq3 ]; then
(cd ${HOME} && git clone https://github.com/ioquake/ioq3)
else
(cd ${HOME}/ioq3 && git pull --rebase)
@harshavardhana
harshavardhana / xl-meta_test.go
Created August 11, 2019 23:19
go test -bench .
/*
* Minio Cloud Storage, (C) 2017 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software

Start vault with file backend

~ docker run --rm --cap-add=IPC_LOCK --name vault -e 'VAULT_LOCAL_CONFIG={"api_addr": "http://127.0.0.1:8200", "backend": {"file": {"path": "/vault/file"}}, "default_lease_ttl": "168h", "max_lease_ttl": "720h",  "listener": { "tcp": { "address": "0.0.0.0:8200", "tls_disable": 1 } }, "ui": true}' vault server
==> Vault server configuration:

             Api Address: http://127.0.0.1:8200
                     Cgo: disabled
         Cluster Address: https://127.0.0.1:8201
              Listener 1: tcp (addr: "0.0.0.0:8200", cluster address: "0.0.0.0:8201", max_request_duration: "1m30s", max_request_size: "33554432", tls: "disabled")
               Log Level: info

Start vault with file backend

~ docker run --rm --cap-add=IPC_LOCK --name vault -e 'VAULT_LOCAL_CONFIG={"api_addr": "http://127.0.0.1:8200", "backend": {"file": {"path": "/vault/file"}}, "default_lease_ttl": "168h", "max_lease_ttl": "720h",  "listener": { "tcp": { "address": "0.0.0.0:8200", "tls_disable": 1 } }, "ui": true}' vault server
==> Vault server configuration:

             Api Address: http://127.0.0.1:8200
                     Cgo: disabled
         Cluster Address: https://127.0.0.1:8201
              Listener 1: tcp (addr: "0.0.0.0:8200", cluster address: "0.0.0.0:8201", max_request_duration: "1m30s", max_request_size: "33554432", tls: "disabled")
               Log Level: info
package main
import (
"errors"
"fmt"
"io/ioutil"
"os"
"time"
"github.com/djherbis/atime"
@harshavardhana
harshavardhana / go-os-arch.md
Created June 18, 2019 17:57 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@harshavardhana
harshavardhana / random-servers.go
Last active December 26, 2018 21:44 — forked from fwessels/random-servers.go
Create a list of random servers
package main
import (
"fmt"
"hash/crc32"
)
func randomServers(token string, count int) []int {
hTok := crc32.Checksum([]byte(token), crc32.IEEETable)
val := uint32(hTok)