Skip to content

Instantly share code, notes, and snippets.

View meson10's full-sized avatar

Piyush Verma meson10

View GitHub Profile
@meson10
meson10 / changeset.md
Last active November 22, 2018 05:11
Deployment Changeset
name about
Deploy Changes
Ship a new Update to an existing Deployment

Part [1/5] : Pre-requisities (Delivery Team)

Link to Changeset

Provide a Link to the Changeset that describes the changes to be deployed

--- FAIL: TestCookiesJarPersistence (0.00s)
main_test.go:186: unable to start cookie server unable to determine port strconv.Atoi: parsing "0.0.0.0:36515": invalid syntax
=== RUN TestEmbeddedClientTimeout
--- FAIL: TestEmbeddedClientTimeout (0.00s)
main_test.go:216: unable to start timeout server unable to determine port strconv.Atoi: parsing "0.0.0.0:36293": invalid syntax
=== RUN TestConcurrentRequestsNotRacyAndDontLeak_FailedRequest
--- FAIL: TestConcurrentRequestsNotRacyAndDontLeak_FailedRequest (0.00s)
main_test.go:234: unable to start server unable to determine port strconv.Atoi: parsing "0.0.0.0:42805": invalid syntax
@meson10
meson10 / htpasswd.py
Last active March 17, 2017 06:31
Ship this utility instead of installing htpasswd
#!/usr/local/bin/python
"""Replacement for htpasswd"""
# Original author: Eli Carter
import os
import sys
import random
from optparse import OptionParser
# We need a crypt module, but Windows doesn't have one by default. Try to find
@meson10
meson10 / profile.go
Created November 13, 2016 16:19
Profiling explained
package main
import (
"fmt"
"log"
"os"
"runtime"
"runtime/pprof"
"strconv"
"sync"
@meson10
meson10 / gilmour_race_condition.go
Created August 18, 2016 04:27
Gilmour race condition
piyush:gilmour-e-go master λ go test --race -v ./...
=== RUN TestMergeHash
--- PASS: TestMergeHash (0.00s)
=== RUN TestMergeMismatch
--- PASS: TestMergeMismatch (0.00s)
=== RUN TestMergePointer
--- PASS: TestMergePointer (0.00s)
=== RUN TestMergeInterface
--- PASS: TestMergeInterface (0.00s)
=== RUN TestMergeInterfacePointer
@meson10
meson10 / syncOnce.go
Last active June 29, 2016 15:57
Sync.Once
package main
import (
"log"
"sync"
)
type MyStruct struct {
field int
}
@meson10
meson10 / syncLock.go
Last active June 29, 2016 15:57
Sync with Lock
package main
import (
"log"
"sync"
)
type MyStruct struct {
field int
}
@meson10
meson10 / singleton.go
Created June 28, 2016 05:46
Go singleton as locks or sync.Once
package main
import (
"log"
"sync"
)
type MyStruct struct {
field int
}
@meson10
meson10 / cert.sh
Created June 17, 2016 08:26
Service to coordinate with Azure API and idempotently upload certificates
#!/bin/sh
set -e
service=$1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
output="${DIR}/ssh_thumbprint"
cd $DIR
if [[ `azure service cert list | grep -c $service` -eq 0 ]]; then
@meson10
meson10 / null_resource.tf.json
Created June 17, 2016 08:21
Null resource resource
{
"resource": {
"null_resource": {
"ssh_key": {
"triggers": {
"thumbprint": "${file(\"./ssl/ssh_thumbprint\")}"
},
"provisioner": [{
"local-exec": {
"command": "bash ./ssl/cert.sh ${azure_hosted_service.terraform.name}"