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
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)
DATA AND METADATA COHERENCE
Some modern cluster file systems provide perfect cache coherence among their clients. Perfect cache coherence among disparate NFS clients is expensive to achieve, especially on wide area networks. As such, NFS settles for weaker cache coherence that satisfies the requirements of most file sharing types.
Close-to-open cache consistency
Typically file sharing is completely sequential. First client A opens a file, writes something to it, then closes it. Then client B opens the same file, and reads the changes.
When an application opens a file stored on an NFS version 3 server, the NFS client checks that the file exists on the server and is permitted to the opener by sending a GETATTR or ACCESS request. The NFS client sends these requests regardless of the freshness of the file's cached attributes.
When the application closes the file, the NFS client writes back any pending changes to the file so that the next opener can view the changes. This al
"quota": {                                                                                        
            "storage": {                                                                                  
                "capacity": "1TiB",                                                                       
            }                                                                                             
            "network": {                                                                                  
                "iops": 1024,                                                                             
                "bandwidth": "250MiB",                                                                    
            }                                                                                             
            "cpu": {                                                                                      
@harshavardhana
harshavardhana / COPYING
Created May 6, 2018 22:23 — forked from davedoesdev/COPYING
Quietening Syslinux
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
@harshavardhana
harshavardhana / minio-gateway-azure.bat
Last active February 8, 2018 17:23
Minio windows batch examples
rem This program starts the minio batch.
@echo off
setlocal
path=C:\programs\minio;%path%
set MINIO_ACCESS_KEY=accountname1
set MINIO_SECRET_KEY=secretForAccountName
call minio gateway azure --address=:9001 >c:\test\c1.out
endlocal
@harshavardhana
harshavardhana / upload-minio.html
Last active January 29, 2023 01:33
Upload to play.minio.io:9000 from browser using minio-js
<!DOCTYPE html>
<html>
<head>
<title>Minio SDK for JavaScript - Sample Application</title>
@harshavardhana
harshavardhana / upload_upon_close.py
Created November 18, 2017 23:35
Watch for CLOSE events and upload the file to S3
import inotify.adapters
from minio import Minio
from minio.error import ResponseError
minioClient = Minio('play.minio.io:9000',
access_key='Q3AM3UQ867SPQQA43P2F',
secret_key='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG',
secure=True)
def _main():