Skip to content

Instantly share code, notes, and snippets.

@ks07
ks07 / ping_error.go
Created October 17, 2020 16:39
Demonstration for unsafe Stop() https://github.com/go-ping/ping/issues/94
package main
import (
"log"
"sync"
"time"
"github.com/go-ping/ping"
)
@ks07
ks07 / mongo bug log
Created April 8, 2020 13:38
Console log showing how to reproduce the mongodb oplog size bug
[george@c7 ~]$ docker run --name mongo-server -d mongo:4.2.5 mongod --replSet rs0
f6810e93af750a6d4520d9d708233b52ca5f5ace07d8aa6505e69a81fafbba56
[george@c7 ~]$ docker cp mongo-bug/ f6810e93af75:/mongo-bug
[george@c7 ~]$ docker exec -it f6810e93af75 bash
root@f6810e93af75:/# ls mongo-bug/
go.mod go.sum init largetx
#!/usr/bin/expect -f
# llength = listlength, need 5 arguments
if {[llength $argv] != 5} {
puts "usage: ssh_test.exp user pass host port cmd"
# exit takes a return code
exit 1
}
# Use lrange with equal start and end to get a single item - same as Redis
@ks07
ks07 / powerset.sh
Created May 15, 2015 23:17
Quick and dirty set of CPU upper frequency bound and governor
for i in {0..7}; do sudo cpufreq-set -c 7 -g ondemand -u 2400MHz ; done