Skip to content

Instantly share code, notes, and snippets.

@anastop
anastop / deepcopy.go
Created July 4, 2018 12:58
deep copy
package main
import (
"github.com/mitchellh/copystructure"
"fmt"
)
type OvsStats map[string]BridgeStats
type BridgeStats map[string]InterfaceStats
type InterfaceStats struct {
@anastop
anastop / global_test.go
Created February 5, 2018 11:26
Global test env setup/teardown for Go
// run with go test -v
package features
import (
"flag"
"fmt"
"os"
"testing"
)
@anastop
anastop / do-libvirt.go
Last active December 21, 2017 14:14
digitalocean-libvirt
package main
import (
"fmt"
"log"
"net"
"time"
"github.com/digitalocean/go-libvirt"
"os"
)
@anastop
anastop / xml_parse.go
Created April 27, 2017 11:07
Parse XML Libvirt Domain
package main
import (
"encoding/xml"
"fmt"
"strconv"
"time"
)
func parseDomCfg(domcfg []byte) (dompid int, vcpupids []int, err error) {
@anastop
anastop / concurrent_pollers.py
Created October 10, 2016 12:23
Concurrent pollers with gevent
import gevent
def poller1():
i=1
while i<10:
print('Poller1: ' + str(i))
i=i+1
gevent.sleep(1)
print('Poller 1: finished')

Keybase proof

I hereby claim:

  • I am anastop on github.
  • I am anastop (https://keybase.io/anastop) on keybase.
  • I have a public key whose fingerprint is 2B45 03A2 51BE A377 4623 4398 A186 68AC 3B9D 2B92

To claim this, I am signing this object:

@anastop
anastop / gist:262f66e49b01ba196ff7
Last active February 9, 2016 11:46
Pandoc cmd line to produce something closer to a technical report
pandoc --toc \
--number-sections \
-V author="Author Name" \
-V title="Report Title" \
-V geometry:margin=1in \
-o file.pdf file.md