Skip to content

Instantly share code, notes, and snippets.

@mbarton
mbarton / command.txt
Created November 1, 2019 12:28
Remove delete on termination for CSV to ES
aws ec2 modify-instance-attribute --instance-id <EC2_INSTANCE_ID> --block-device-mappings file://mapping.json --profile investigations --region eu-west-1
<rules>
<rule name="nodemon">
<targets>
<target>/geneos/gateway/directory/probe[(@name=&quot;probe&quot;)]/managedEntity[(@name=&quot;entity&quot;)]/sampler[(@name=&quot;nodemon&quot;)][(@type=&quot;&quot;)]/dataview[(@name=&quot;nodemon&quot;)]/rows/row/cell[(@column=&quot;percentCPU&quot;)]</target>
</targets>
<priority>1</priority>
<block>
<if>
<gt>
<dataItem>
<sampler name="nodemon">
<plugin>
<processes>
<processes>
<process>
<data>
<alias>
<data>ClusterMain</data>
</alias>
</data>
import akka.actor.RootActorPath
import akka.cluster.ClusterEvent._
import akka.cluster.ClusterEvent.CurrentClusterState
import akka.cluster.ClusterEvent.MemberRemoved
import akka.cluster.ClusterEvent.MemberUp
import scala.collection.immutable.SortedSet
import scala.collection.mutable.{Map => MutableMap}
import akka.actor._
import akka.cluster.{MemberStatus, Cluster, Member}
import scala.Some
@mbarton
mbarton / gist:5815934
Last active December 18, 2015 17:08
rdtsc fun
// What the fuck does this do?
// We want to use the rdtsc instruction for timing
// It's basically the number of clock cycles on this core since the last RESET
// First up, don't use this for timing! See http://en.wikipedia.org/wiki/Time_Stamp_Counter for why
// The rdtsc is a 64 bit number available from a 32 bit processor
// So it is implemented by putting the low and high parts of the number in two seperate registers
// We define two C variables for these registers (lo and hi)
uint32_t lo, hi;
@mbarton
mbarton / Web Audio Cue Tests
Created May 8, 2013 18:47
Page to reproduce weirdness where the input to the cue node is heard on all 4 channels coming out of the merger node
<head>
<title>Cue Test</title>
</head>
<body>
<button id="main">Start Main</button>
<button id="cue">Start Cue</button>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
var ctx = new webkitAudioContext();
ctx.destination.channelCount = 4;
21:45:00.593 ERROR [OneForOneStrategy ] [Valo-SingleNode-akka.actor.default-dispatcher-13] [akka://Valo-SingleNode/user/query-root-60ec091d-7c8a-48e8-8b38-2c3545662737] -
Could not resolve member information for schema reference 'fit'. The field does not exist in any of the expression inputs.
The expression has the following inputs;
a1
{"fit_the_first":Int32Entry(false,),"fit_the_second":StringEntry(false,)}
com.itrsgroup.expression.IllegalExpressionException:
Could not resolve member information for schema reference 'fit'. The field does not exist in any of the expression inputs.
java.lang.ClassCastException: com.itrsgroup.functions.OnlineAlgorithmRegistration cannot be cast to com.itrsgroup.functions.PlainFunctionRegistration
at com.itrsgroup.query.codegen.quasiquotes.CodeGenerator.generateCode(CodeGenerator.scala:67) ~[classes/:na]
at com.itrsgroup.query.codegen.quasiquotes.CodeGenerator.generateCode(CodeGenerator.scala:37) ~[classes/:na]
at com.itrsgroup.query.codegen.quasiquotes.PayloadWriter.genCode$1(PayloadWriter.scala:33) ~[classes/:na]
at com.itrsgroup.query.codegen.quasiquotes.PayloadWriter.com$itrsgroup$query$codegen$quasiquotes$PayloadWriter$$write$1(PayloadWriter.scala:70) ~[classes/:na]
at com.itrsgroup.query.codegen.quasiquotes.PayloadWriter.com$itrsgroup$query$codegen$quasiquotes$PayloadWriter$$write$1(PayloadWriter.scala:64) ~[classes/:na]
at com.itrsgroup.query.codegen.quasiquotes.PayloadWriter.write(PayloadWriter.scala:89) ~[classes/:na]
at com.itrsgroup.repository.timeseries.query.codegen.TsrTransformGenerator$Builder.build(TsrTransformGenerator.scala:49) ~[
11:00:10.509 ERROR [LocalActorRefProvider(akka://Valo-SingleNode)] [Valo-SingleNode-akka.actor.default-dispatcher-11] [LocalActorRefProvider(akka://Valo-SingleNode)] - guardian failed, shutting down system
java.lang.AssertionError: assertion failed: Expected StartArray at null. Token is NoMoreTokens
at scala.Predef$.assert(Predef.scala:165) ~[scala-library-2.11.4.jar:na]
at com.itrsgroup.schema.Parser$class.matchStartArray(Parser.scala:306) ~[classes/:na]
at com.itrsgroup.schema.formats.JacksonParser.matchStartArray(JacksonParser.scala:9) ~[classes/:na]
at com.itrsgroup.functions.online.histograms.NumericalHistogram$.deserialiseState(NumericalHistogram.scala:59) ~[classes/:na]
at com.itrsgroup.functions.online.histograms.NumericalHistogram$.deserialiseState(NumericalHistogram.scala:14) ~[classes/:na]
at com.itrsgroup.query.codegen.quasiquotes.AggregatorStateReader.merge(AggregatorStateReader.scala:59) ~[classes/:na]
at __wrapper$1$96c53cbb32564a83b234f76c911fd4a7.__wrapper$1$96c53cbb32564a83b234f76c91
Error:(31, 82) overloaded method value apply with alternatives:
[H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, RR](f: (H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, com.itrsgroup.expression.StringLiteral, com.itrsgroup.query.topology.NodeTemplate with Product with Serializable{def normalise(topology: com.itrsgroup.query.topology.Topology,normaliser: com.itrsgroup.query.Normalizer)(implicit envContext: com.itrsgroup.query.EnvironmentContext): com.itrsgroup.query.topology.NodeTemplate with Product with Serializable{def normalise(topology: com.itrsgroup.query.topology.Topology,normaliser: com.itrsgroup.query.Normalizer)(implicit envContext: com.itrsgroup.query.EnvironmentContext): com.itrsgroup.query.topology.NodeTemplate with Product with Serializable}}, scala.collection.immutable.Seq[com.itrsgroup.query.topology.NodeTemplate with Product with Serializable]) => RR)(implicit j: org.parboiled2.support.ActionOps.SJoin[shapeless.::[H,shapeless.::[I,shapeless.::[J,shapeless.::[K,shapeless.::[