Skip to content

Instantly share code, notes, and snippets.

View chrislovecnm's full-sized avatar
😃
Living LIFE!!

Chris Love chrislovecnm

😃
Living LIFE!!
View GitHub Profile
@pydevops
pydevops / gcp_ca_cert.md
Last active July 14, 2023 14:12
google cloud architect cert prepare
FROM mirror-hub.docker.tech.lastmile.com/alpine:3.5
RUN apk add --no-cache curl jq
RUN curl -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.5.3/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl
COPY rmpeers /
CMD ["/rmpeers"]
enabled = True
host = localhost
port = 8778
# metric path
path = cassandra.jmx
# jolokia url path
jolokia_path = jolokia
use_canonical_names = False
domains = '''
org.apache.cassandra.metrics |
@jeroenr
jeroenr / WeirdIntegerParser.scala
Last active November 15, 2017 09:26
Scala pattern matching with regex: parsing weird integer strings
val MaxInt = """(inf)""".r
val NormalInt = """(\d*)""".r
def parseInt(integerString:String): Int = {
integerString match {
case MaxInt(_) => Integer.MAX_VALUE
case NormalInt(_) => Integer.valueOf(integerString)
case _ => throw new NumberFormatException(String.format("Cannot parse %s as an integer", integerString))
}
}
@rbraband
rbraband / example 1
Created February 24, 2012 14:12
Howto implement stored procedures within Redis
# Step 0 -- create test data
redis-cli HSET :object:30343552:data foo bar
# Step 1 -- store sample function 'sampleFunction'
redis-cli SET :functions:sample "redis.call('SELECT', 0);local data=redis.call('HGETALL',':object:' .. ARGV[1] .. ':data');return data"
# Step 2 -- create function loader
redis-cli SCRIPT LOAD "f=loadstring(redis.call('get',':functions:' .. KEYS[1]));return f()"
# Step 3 -- test