Skip to content

Instantly share code, notes, and snippets.

```bash
# k get -n flux-system cm cluster-bootstrap-conf -o yaml
apiVersion: v1
data:
DOMAIN_NAME: k3s.example.com
SOMETHING: unrelated
kind: ConfigMap
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
@ppat
ppat / 1_vars.yaml
Created April 24, 2020 16:30
Home Assistant Integrations configuration
integration:
unifi:
host: "127.0.0.1"
port: 8443
username: "{{ credentials.unifi_username }}"
password: "{{ credentials.unifi_password }}"
cast: {}
wemo: {}

Tuning Storm+Trident

Tuning a dataflow system is easy:

The First Rule of Dataflow Tuning:
* Ensure each stage is always ready to accept records, and
* Deliver each processed record promptly to its destination
@ppat
ppat / Maven plugin configuration
Created July 30, 2014 20:31
Adding scala style to your project
<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
<version>0.4.0</version>
<configuration>
<verbose>false</verbose>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<failOnWarning>false</failOnWarning>
<sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="PeterCodeStyle">
<ScalaCodeStyleSettings>
<option name="WRAP_BEFORE_WITH_KEYWORD" value="true" />
<option name="FINALLY_BRACE_FORCE" value="1" />
<option name="TRY_BRACE_FORCE" value="1" />
<option name="CASE_CLAUSE_BRACE_FORCE" value="1" />
<option name="MULTILINE_STRING_SUPORT" value="1" />
<option name="PROCESS_MARGIN_ON_COPY_PASTE" value="false" />
</ScalaCodeStyleSettings>
action.auto_create_index: false
bootstrap.mlockall: true
cluster.name: search_0.90.5-1_prod
discovery.zen.minimum_master_nodes: 9
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["es-a-1", "es-a-2", "es-a-3", "es-a-4", "es-a-5", "es-a-6", "es-a-7", "es-a-8", "es-b-1", "es-b-2", "es-b-3", "es-b-4", "es-b-5", "es-b-6", "es-b-7", "es-b-8"]
gateway.expected_nodes: 16
gateway.recover_after_nodes: 12
index.mapper.dynamic: false
node.max_local_storage_nodes: 1
def currentEnvironment: RiakRestClientParams = EnvironmentSelector.current match {
case "PROD" => {
MetricsInitializer.init(MetricsConfig("riemann-1.idc.theladders.com", "match-jobseekers-with-jobs", "doesnotmatter"))
PROD
}
case _ => QA
}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
/* interleave slots so that slots of different nodes are given priority during assignment of topology as opposed to slots of the same node */
private def interleaveSlotsByNode(slots: Set[WorkerSlot]): List[WorkerSlot] = {
val groupedSeq = slots.groupBy(_.getNodeId).toSeq
val slotsByNode = mutable.Map[String, Set[WorkerSlot]](groupedSeq: _*)
val nodes = slotsByNode.keys.toList.sorted
val results = mutable.ListBuffer[WorkerSlot]()
while (!slotsByNode.isEmpty) {
for (node <- nodes) {
slotsByNode.get(node) match {
case Some(slots) => {
implicit def createRecommenderInput(job: Job) = new {
def toInput: Input = {
val input = new Input (
title = job.title,
disciplines = Set.empty, // TODO get job.disciplines
industries = Set.empty, // TODO get job.industries
positionLevel = 24, // TODO get job.positionLevel
salaryMin = -1, // TODO get job.salaryMin
salaryMax = -1 // TODO get job.salaryMax
)