Skip to content

Instantly share code, notes, and snippets.

View lucassardois's full-sized avatar
🎯
Writing in progress...

Lucas S. lucassardois

🎯
Writing in progress...
View GitHub Profile
@lucassardois
lucassardois / docker-compose.yml
Last active February 26, 2023 11:12
A simple docker-compose file to enable MongoDB replica set using a single node setup.
version: '3.0'
services:
mongo:
image: mongo:4.4
ports:
- '27017:27017'
command: mongod --replSet rs0
healthcheck:
test: test $$(echo "rs.initiate({_id:'rs0',members:[{_id:0,host:\"127.0.0.1:27017\"}]}).ok || rs.status().ok" | mongo --host mongo:27017 --quiet) -eq 1
@lucassardois
lucassardois / gen_vec.rs
Last active June 20, 2021 21:01
An implementation of generationel indices in Rust
#[cfg(test)]
pub mod test {
use super::GenVec;
#[test]
fn gen_vec() {
let mut gv = GenVec::new();
// Insert
let a = gv.insert("a");
@lucassardois
lucassardois / docker-compose.yml
Created November 23, 2020 15:06
medium-iot-data-handling
version: "3.8"
services:
mosquitto:
image: eclipse-mosquitto:latest
restart: always
ports:
- "1883:1883"
- "9001:9001"
networks:
@lucassardois
lucassardois / telegraf.conf
Created November 21, 2020 19:03
medium-iot-telegraf-conf
[[outputs.influxdb]]
urls = ["http://influxdb:8086"]
[[outputs.file]]
files = ["stdout", "/tmp/metrics.out"]
[[inputs.mqtt_consumer]]
servers = ["tcp://mosquitto:1883"]
topics = [
"bedroom/#"