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
@harshavardhana
harshavardhana / Public_Time_Servers.md
Created August 27, 2022 05:45 — forked from mutin-sa/Top_Public_Time_Servers.md
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@harshavardhana
harshavardhana / generate_hive_schema.scala
Created October 10, 2021 21:58 — forked from spektom/generate_hive_schema.scala
Generate Hive schema from Spark Dataframe
import org.apache.spark.sql.DataFrame
def dataFrameToDDL(dataFrame: DataFrame, tableName: String): String = {
val columns = dataFrame.schema.map { field =>
" " + field.name + " " + field.dataType.simpleString.toUpperCase
}
s"CREATE TABLE $tableName (\n${columns.mkString(",\n")}\n)"
}
import spark.sqlContext.implicits._
#!/bin/sh
#
# Resource script for Minio
#
# Description: Manages Minio as an OCF resource in
# an Active-Passive High Availability setup.
#
# Author: Ricardo Branco <tsmgeek@gmail.com> : Initial script for minio server
# License: GNU General Public License (GPL)
#
@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 / 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)
@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 / main.go
Created August 7, 2017 07:19 — forked from FZambia/main.go
Verify armored GPG signature using Go language
package main
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"
"golang.org/x/crypto/openpgp/armor"
@harshavardhana
harshavardhana / check_sig.go
Created August 7, 2017 07:18 — forked from lsowen/check_sig.go
GPG Signature Verification in go (with golang.org/x/crypto/openpgp)
package main
import (
"fmt"
"golang.org/x/crypto/openpgp"
"os"
)
func main() {
keyRingReader, err := os.Open("signer-pubkey.asc.txt")
@harshavardhana
harshavardhana / nginx-minio-static.md
Last active December 7, 2024 21:36 — forked from koolhead17/gist:4b8dd8d95ec86368634693cf9ad9391c
How to configure static website using Nginx with MinIO ?

How to configure static website using Nginx with MinIO ?

1. Install nginx

2. Install minio

3. Install mc client

4. Create a bucket:

$ mc mb myminio/static
Bucket created successfully ‘myminio/static’.