Skip to content

Instantly share code, notes, and snippets.

View fpletz's full-sized avatar
🦺
building

Franz Pletz fpletz

🦺
building
  • Munich, Germany
  • 02:27 (UTC +02:00)
View GitHub Profile
@fpletz
fpletz / esphome-print-async.py
Last active February 23, 2024 00:47
aioesphomeapi minimal examples
#!/usr/bin/env python3
import aioesphomeapi
import asyncio
async def main():
loop = asyncio.get_running_loop()
cli = aioesphomeapi.APIClient(loop, "foobarhostname", 6053, "foobarpassword")
await cli.connect(login=True)
@fpletz
fpletz / configuration.nix
Created February 23, 2021 21:43
nixos docker zfs
{
systemd.services.docker.path = with pkgs; [ zfs ];
services = {
docker = {
enable = true;
extraOptions = "--storage-driver zfs --exec-opt native.cgroupdriver=systemd --bip=192.168.234.1/24";
autoPrune = {
enable = true;
dates = "weekly";
@fpletz
fpletz / configuration.nix
Created November 18, 2022 19:59
tuigreet nixos config
{
services.greetd = {
enable = true;
settings.default_session.command = "${lib.makeBinPath [pkgs.greetd.tuigreet]}/tuigreet --time --cmd ${cfg.greetCmd}";
};
}
@fpletz
fpletz / hm-config.nix
Created July 28, 2023 19:10
NixOS home-manager wayland screensharing
{ pkgs, ... }:
{
services.pipewire = {
enable = true;
};
xdg.portal = {
enable = true;
wlr = {
enable = true;
@fpletz
fpletz / azure-images.nix
Last active February 19, 2022 17:34
Parametrized Azure Images
{ system ? "x86_64-linux" }:
let
buildAzureImage = params: (import <nixpkgs/nixos> {
inherit system;
configuration = import ./test.nix params;
}).config.system.build.azureImage;
in
@fpletz
fpletz / nginx.conf
Last active December 4, 2020 20:04
OSM Caching
http {
proxy_cache_path /tmp/nginx/cache/osmhot keys_zone=osmhot:1024m inactive=7d;
upstream osmhot {
server a.tile.openstreetmap.fr;
#server b.tile.openstreetmap.fr;
keepalive 4;
}
server {
@fpletz
fpletz / module.nix
Created June 19, 2020 09:05
NixOS module test skeleton
{ config, lib, ... }:
with lib;
let
cfg = config.foo.bar;
in
{
@fpletz
fpletz / alfred2influx.py
Created August 19, 2015 15:56
Simple Alfred to InfluxDB importer
#!/usr/bin/env python3
import json
import sys
from influxdb import InfluxDBClient
series = {
'loadavg': ['value'],
'idletime': ['value'],
{
services.dovecot2 = {
modules = with pkgs; [ dovecot_pigeonhole ];
extraConfig = ''
protocol lmtp {
mail_plugins = $mail_plugins sieve
}
service managesieve-login {
inet_listener sieve {
### Keybase proof
I hereby claim:
* I am fpletz on github.
* I am fpletz (https://keybase.io/fpletz) on keybase.
* I have a public key whose fingerprint is 8A39 615D CE78 AF08 2E23 F303 846F DED7 7926 17B4
To claim this, I am signing this object: