Skip to content

Instantly share code, notes, and snippets.

View celaus's full-sized avatar
🎯
Focusing

Claus Matzinger celaus

🎯
Focusing
View GitHub Profile
apiVersion: v1
kind: Service
metadata:
name: crate-discovery
labels:
app: crate
spec:
ports:
- port: 4200
name: crate-web
select avg(tip_amount) from "nyc-yellowcab" where tip_amount > 0;
select count(*), vendorid from "nyc-yellowcab" group by vendorid;
select avg(tip_amount), vendorid from "nyc-yellowcab" where tip_amount > 0 group by 2;
select avg(cast(passenger_count as integer)) from "nyc-yellowcab";
select passenger_count, avg(tip_amount) from "nyc-yellowcab" where tip_amount > 0 group by passenger_count order by 1;
select passenger_count, count(*) from "nyc-yellowcab" group by passenger_count order by 1;
version: '2'
services:
crate:
image: crate/crate:testing
cpu_shares: 100
mem_limit: 512000000
command: "/docker-entrypoint.sh crate -Des.gateway.expected_nodes=3 -Des.discovery.zen.minimum_master_nodes=2 -Des.gateway.recover_after_nodes=2"
ports:
- "4200:4200"
- "4300:4300"
version: '3'
services:
cratedb:
image: "crate/crate:testing" # :1.0.5
environment:
- CRATE_HEAP_SIZE=3g
command: ["crate", "-Cgateway.expected_nodes=3", "-Cgateway.recover_after_nodes=2", "-Cdiscovery.zen.minimum_master_nodes=2", "-Cdiscovery.zen.ping.multicast.enabled=false", "-Cdiscovery.zen.ping.unicast.hosts=cratedb", "-Cnetwork.bind=_eth0_", "-Ccluster.name=NYC"]
networks:
- cratedb_network
- client_network
@celaus
celaus / eden build
Created March 26, 2017 13:57
How to build eden for ARM
docker run -i --rm \
-v $(pwd):/source \
-v /tmp/cargo/git:/root/.cargo/git \
-v /tmp/cargo/registry:/root/.cargo/registry \
-e CXX=arm-linux-gnueabihf-gcc-with-link-search \
dlecan/rust-crosscompiler-arm
@celaus
celaus / pmx.js
Created August 25, 2018 21:19
PMX - Partially Mapped Crossover
function x(s, t) {
let _map1 = {};
let _map2 = {};
const x1 = Math.floor(Math.random() * (s.length - 1));
const x2 = x1 + Math.floor(Math.random() * (s.length - x1));
let offspring = [Array.from(s), Array.from(t)];