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"
)
package main
import "log"
type EventLogger interface {
Log() int
}
type EventA struct {
Id int
package main
import "log"
func alterValue(val interface{}) {
INCR := 10
switch i := val.(type) {
case nil:
log.Println("Nil value")
@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() {
@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 / kvm_cheatsheet.sh
Created July 30, 2016 08:16 — forked from mayurah/kvm_cheatsheet.sh
KVM / QEMU Cheatsheet
# List System(s)
virsh -c qemu:///system list
virsh list # List running
virsh list --all # List all
# Open guest VM console
virsh console <instance>
# Control specific instance
virsh start <instance>