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
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.::[
mbarton@itrspc170:~/scratch/countdown_game$ python countdown_numbers.py -c 2 4
numbers are [1, 4, 25, 50, 75, 100]
target is 410
100 [ INITIAL_STATE ]
400 [ 4 * 100 = 400 ]
404 [ 4 * 100 = 400, 1 + 400 = 401, 75 / 25 = 3, 3 + 401 = 404 ]
405 [ 4 * 100 = 400, 50 + 75 = 125, 125 / 25 = 5, 5 + 400 = 405 ]
409 [ 50 + 75 = 125, 1 + 100 = 101, 4 * 101 = 404, 125 / 25 = 5, 5 + 404 = 409 ]
408 [ 50 / 25 = 2, 2 + 100 = 102, 4 * 102 = 408 ]
Solution not found. Best was 408.
@mbarton
mbarton / reverse_connection.scala
Created August 22, 2014 09:27
Cluster -> Client Reverse Connection
log.info("Starting single node connected to two gateways")
val baseConfig = raw(
"""
machines {
machine {}
}
gateways {
gatewayA {}
@mbarton
mbarton / control.conf
Last active August 29, 2015 14:05
two clusters
machines {
machine {}
}
netprobes {
monitor-probe {}
}
gateways {
cluster-one-gateway {
@mbarton
mbarton / readable_all.py
Created August 6, 2014 14:59
Make all logs in this directory readable
#!/usr/bin/python
import glob
for log in glob.glob("**/*.log"):
f = open(log, "r")
mod_lines = []
for line in f:
split_line = line.split(" ")
mod_lines.append("%s %s %s" % (split_line[0], split_line[1], " ".join(split_line[4:])))
@mbarton
mbarton / readable.py
Created August 6, 2014 14:59
Make a single log file readable
#!/usr/bin/python
import fileinput
import sys
for line in fileinput.input():
split_line = line.split(" ")
sys.stdout.write("%s %s %s" % (split_line[0], split_line[1], " ".join(split_line[4:])))