Skip to content

Instantly share code, notes, and snippets.

View collinvandyck's full-sized avatar
🏠
Working from home

Collin Van Dyck collinvandyck

🏠
Working from home
View GitHub Profile
@collinvandyck
collinvandyck / delaysquawk.go
Last active December 19, 2015 10:09
squawks about network lag while you're playing minecraft to correlate oddities in the game with digitalocean's spotty network
package main
import (
"flag"
"io/ioutil"
"net/http"
"os/exec"
"time"
)
no idea what IS NOTHING WRONG WITH CONSENSUAL LOVE BETWEEN A MAN AND THERE IS NOTHING WRONG WITH CONSENSUAL LOVE BETWEEN A MAN AND THERE IS NOTHING WRONG WITH CONSENSUAL LOVE BETWEEN A MAN AND CAT
[09:28:51] [cvandyck] Hello all. I'm sending a batch of documents with _version_ timestamps to a Solr4 cluster with the SolrJ client. having a hard time from the exceptions it generates (when optimistic concurrency fails) figuring out which ones failed
[09:29:25] [cvandyck] The wiki has some nice ideas about how this might be done in the future with a certain exception hierarchy but that doesn't seem to be present in the latest 4.x release
[09:29:33] [cvandyck] Is this possible?
case "`uname`" in
Darwin)
;;
*)
exit 0
esac
[8920420.514283] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8920486.012528] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8920551.510786] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8920617.009039] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8920682.507289] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8920748.005539] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8920813.503782] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8920879.002042] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8920944.500285] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
[8921010.000022] BUG: soft lockup - CPU#1 stuck for 61s! [swapper:0]
func main() {
flag.Parse()
c := irc.SimpleClient("gesturebot")
c.SSL = true
c.AddHandler(irc.CONNECTED,
func(conn *irc.Conn, line *irc.Line) {
for _, channel := range channels {
conn.Join(channel)
}
})
type Event struct {
OrganizationId string `json:"organizationId"`
CreatedAt uint64 `json:"createdAt"`
Level string `json:"level"`
Status string `json:"status"`
Source Source `json:"source"`
Properties map[string]interface{} `json:"properties"`
FingerprintFields []string `json:"fingerprintFields"`
Tags []string `json:"tags"`
}
ERROR [2013-02-22 22:34:07,998] kafka.network.Processor: java.io.IOException: Connection reset by peer
! java.io.IOException: Connection reset by peer
! at sun.nio.ch.FileDispatcher.read0(Native Method)
! at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
! at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:198)
! at sun.nio.ch.IOUtil.read(IOUtil.java:171)
! at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:245)
! at kafka.utils.Utils$.read(Utils.scala:483)
! at kafka.network.BoundedByteBufferReceive.readFrom(BoundedByteBufferReceive.scala:53)
! at kafka.network.Processor.read(SocketServer.scala:298)
class Foo {
Bar bar;
}
class Bar {
Collection<String> strings;
}
Is it possible to serialize Foo as:
import org.codehaus.jackson.map.ObjectMapper;
import java.io.StringReader;
public class Testing {
private String foo;
public static void main(String[] args) throws Exception {
final ObjectMapper objectMapper = new ObjectMapper();
final StringReader reader = new StringReader("{\"foo\":\"bar\"}");