Skip to content

Instantly share code, notes, and snippets.

View coolbrg's full-sized avatar

Budh Ram Gurung (BRG) coolbrg

View GitHub Profile

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"sync"
)
@coolbrg
coolbrg / types.go
Last active August 29, 2015 14:11 — forked from meson10/types.go
package main
import "fmt"
type myInt int
const unTypedC = 20
const typedC int = 30
func main() {
package main
import "log"
func alterValue(val interface{}) {
INCR := 10
switch i := val.(type) {
case nil:
log.Println("Nil value")
package main
import "log"
type EventLogger interface {
Log() int
}
type EventA struct {
Id int
@coolbrg
coolbrg / README.md
Last active August 29, 2015 14:20 — forked from jonhoo/README.md

Distributed Read-Write Mutex in Go

The default Go implementation of sync.RWMutex does not scale well to multiple cores, as all readers contend on the same memory location when they all try to atomically increment it. This gist explores an n-way RWMutex, also known as a "big reader" lock, which gives each CPU core its own RWMutex. Readers take only a read lock local to their core, whereas writers must take all locks in order.

@coolbrg
coolbrg / irc.md
Created February 29, 2016 06:02 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@coolbrg
coolbrg / kubernetes_steps.rst
Created August 10, 2016 07:41
Connect to kubernetes outside host
@coolbrg
coolbrg / VagrantLauncher.java
Last active August 19, 2016 11:29 — forked from jeffmaury/VagrantLauncher.java
VagrantLauncher program for end-to-end test of ADB
import java.util.*;
import java.io.*;
class StreamGobbler extends Thread
{
InputStream is;
String type;
StreamGobbler(InputStream is, String type)
{