Skip to content

Instantly share code, notes, and snippets.

View mfenniak's full-sized avatar

Mathieu Fenniak mfenniak

View GitHub Profile
@mfenniak
mfenniak / immich.nix
Last active April 26, 2024 09:22
NixOS configuration for Immich, based upon upstream docker-compose.yml
{ config, ... }:
let
immichHost = "immich.example.com"; # TODO: put your immich domain name here
immichRoot = "/tank/immich"; # TODO: Tweak these to your desired storage locations
immichPhotos = "${immichRoot}/photos";
immichAppdataRoot = "${immichRoot}/appdata";
immichVersion = "release";
immichExternalVolume1 = "/tank/BackupData/Google Photos/someone@example.com"; # TODO: if external volumes are desired
@mfenniak
mfenniak / YNAB_Report____Google_Sheets.json
Created October 31, 2023 18:50
n8n Integration to Copy Data from YNAB to Google Sheets
{
"name": "YNAB Report -> Google Sheets",
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
-520,
@mfenniak
mfenniak / detect-reboot-needed.nix
Created January 6, 2023 15:39
NixOS module that provides hourly notifications when a reboot is needed for a kernel, initrd, or kernel-module upgrade
{ pkgs, ... }:
let
readlink = "${pkgs.coreutils}/bin/readlink";
notify-send = "${pkgs.libnotify}/bin/notify-send";
in {
systemd.user.services.detect-reboot-for-upgrade = {
script = ''
set -eu -o pipefail
@mfenniak
mfenniak / mdcheck.nix
Last active December 4, 2022 21:29
NixOS module to add mdcheck capabilities, which automatically scrubs swraid md devices on a fixed schedule; eventually I'd like to upstream this to nixpkgs but just shoved it here for now...
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.hardware.raid.swraid.monitor;
in
{
options.hardware.raid.swraid.monitor = {
@mfenniak
mfenniak / sink-pin.rs
Created February 21, 2021 20:45
Not sure how to resolve this Rust compilation issue
pub struct SqsSink {
// ...snip...
sqs_client: SqsClient,
send_message_future: Option<std::pin::Pin<std::boxed::Box<dyn futures::Future<Output = std::result::Result<rusoto_sqs::SendMessageBatchResult, rusoto_core::RusotoError<rusoto_sqs::SendMessageBatchError>>> + std::marker::Send>>>,
}
impl Sink<Arc<Box<dyn MessageChunk>>> for SqsSink {
type Error = ();
// ...snip...
fn poll_flush(mut self: std::pin::Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
@mfenniak
mfenniak / dashboard.json
Last active January 25, 2020 15:07
iotawatt power & energy Grafana dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@mfenniak
mfenniak / gist:d1bfa2c1c94ee9980113e70ba19ca563
Created May 23, 2017 14:04
4.9.27-14.31.amzn.x86_64 ena issue
May 21 12:05:37 ip-172-16-15-126 ec2net: [get_meta] Trying to get http://169.254.169.254/latest/meta-data/network/interfaces/macs/06:1e:aa:71:34:ca/local-ipv4s
May 21 12:05:37 ip-172-16-15-126 ec2net: [rewrite_aliases] Rewriting aliases of eth0
May 21 12:06:50 ip-172-16-15-126 dhclient[3314]: XMT: Solicit on eth0, interval 125920ms.
May 21 12:07:59 ip-172-16-15-126 consul[3614]: 2017/05/21 12:07:59 [INFO] consul: New leader elected: i-0f14d98ae903e7de2
May 21 12:08:56 ip-172-16-15-126 dhclient[3314]: XMT: Solicit on eth0, interval 114310ms.
May 21 12:10:51 ip-172-16-15-126 dhclient[3314]: XMT: Solicit on eth0, interval 119760ms.
May 21 12:12:51 ip-172-16-15-126 dhclient[3314]: XMT: Solicit on eth0, interval 115570ms.
May 21 12:13:36 ip-172-16-15-126 consul[3614]: 2017/05/21 12:13:36 [INFO] serf: attempting reconnect to i-0bd3ab67982f1fe55 172.16.17.249:8301
May 21 12:14:46 ip-172-16-15-126 dhclient[3314]: XMT: Solicit on eth0, interval 114980ms.
May 21 12:15:54 ip-172-16-15-126 consul[3614]: 2017/
@mfenniak
mfenniak / gist:56f050b9a4877d1b07388e4d01de829c
Created May 23, 2017 14:00
4.4.51-40.58.amzn1.x86_64 ena output
May 17 06:30:26 ip-172-16-15-126 consul[13099]: 2017/05/17 06:30:26 [INFO] serf: attempting reconnect to i-0ffe3ee8de2922539 172.16.14.98:8301
May 17 06:30:46 ip-172-16-15-126 consul[13099]: 2017/05/17 06:30:46 [INFO] agent: Synced node info
May 17 06:31:35 ip-172-16-15-126 dhclient[3332]: XMT: Solicit on eth0, interval 109170ms.
May 17 06:31:39 ip-172-16-15-126 consul[13099]: 2017/05/17 06:31:39 [WARN] memberlist: Refuting a suspect message (from: i-09ee29f77300a149d)
May 17 06:32:45 ip-172-16-15-126 consul[13099]: 2017/05/17 06:32:45 [INFO] serf: EventMemberJoin: i-03549fcaa8f4e1636 172.16.15.66
May 17 06:32:49 ip-172-16-15-126 consul[13099]: 2017/05/17 06:32:49 [INFO] memberlist: Marking i-057b08569e51a333d as failed, suspect timeout reached
May 17 06:32:49 ip-172-16-15-126 consul[13099]: 2017/05/17 06:32:49 [INFO] serf: EventMemberLeave: i-057b08569e51a333d 172.16.16.105
May 17 06:32:53 ip-172-16-15-126 consul[13099]: 2017/05/17 06:32:53 [WARN] memberlist: Refuting a suspect me
# ========
# captured on: Fri May 12 20:07:59 2017
# hostname : ip-10-34-11-79
# os release : 4.4.0-70-generic
# perf version : 4.4.49
# arch : x86_64
# nrcpus online : 1
# nrcpus avail : 1
# cpudesc : Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
# cpuid : GenuineIntel,6,63,2
Analysis of sampling postgres (pid 94571) every 1 millisecond
Process: postgres [94571]
Path: /Users/mathieu.fenniak/Development/pgsql-9.5.4-avoid-search/bin/postgres
Load Address: 0x1061db000
Identifier: postgres
Version: 0
Code Type: X86-64
Parent Process: postgres [94365]
Date/Time: 2017-05-10 09:40:17.180 -0600