Skip to content

Instantly share code, notes, and snippets.

@madmo
madmo / immich.nix
Last active November 28, 2023 19:56
nixos config file to run immich containers (based on compose2nix output)
let
# The location where your uploaded files are stored
immich.upload_location="/srv/immich";
# Connection secrets for postgres and typesense. You should change these to random passwords
immich.typesense_api_key="";
immich.db_password="";
in
{ pkgs, lib, ... }:
@madmo
madmo / kakrc
Last active January 26, 2023 21:04
My kakoune config (.config/kak/kakrc)
evaluate-commands %sh{
plugins="$kak_config/plugins"
mkdir -p "$plugins"
[ ! -e "$plugins/plug.kak" ] && \
git clone -q https://github.com/andreyorst/plug.kak.git "$plugins/plug.kak"
printf "%s\n" "source '$plugins/plug.kak/rc/plug.kak'"
}
plug "andreyorst/plug.kak" noload
plug "andreyorst/smarttab.kak"
plug "alexherbo2/auto-pairs.kak"
@madmo
madmo / README
Created November 22, 2012 22:51
n9 PAN Networking
1. Remove network from the DisabledPlugins option in /etc/bluetooth/main.conf
2. start test-nap.py
3. Connect to pan
4. run tether.sh start to setup ip/dns/dhcp
@madmo
madmo / gist:8548738
Created January 21, 2014 21:27
golang websocket over https proxy
func HttpConnect(proxy, url_ string) (io.ReadWriteCloser, error) {
p, err := net.Dial("tcp", proxy)
if err != nil {
return nil, err
}
turl, err := url.Parse(url_)
if err != nil {
return nil, err
}
@madmo
madmo / onair-sign.py
Created August 31, 2021 05:37
Simple webcam on/off script used to control a onair sign with tasmota firmware
#!/usr/bin/python
import pyinotify
import asyncio
import aiohttp
import sys
def debounce(wait):
def decorator(fn):
def debounced(*args, **kwargs):
@madmo
madmo / init.el
Created June 29, 2021 08:51
emacs config
(require 'cl-lib)
(require 'package)
;; add melpa as package source
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
;; list of packages to install
(defvar my-packages
'(smart-tabs-mode smart-tab company flycheck lsp-mode lsp-ui rustic)
@madmo
madmo / Tronxy X3S Fast.fff
Created January 10, 2018 18:35
Tronxy X3S Simplify3d
<?xml version="1.0"?>
<profile name="Tronxy X3S Fast" version="2018-01-08 20:51:17" app="S3D-Software 4.0.1">
<baseProfile>Default</baseProfile>
<printMaterial>PLA</printMaterial>
<printQuality>High</printQuality>
<printExtruders></printExtruders>
<extruder name="Primary Extruder">
<toolheadNumber>0</toolheadNumber>
<diameter>0.4</diameter>
<autoWidth>0</autoWidth>
@madmo
madmo / build-mspgcc.sh
Created August 30, 2012 23:15
OSX msp430 toolchain install script
#!/bin/bash
# Based on the script found here: http://xpg.dk/projects/msp430/msp430-gcc-uniarch-build-script/
# brew install gmp mpfr libmpc
set -e
function gitUpdate()
{
SRC_ROOT=$1
@madmo
madmo / pass2csv.sh
Created April 13, 2018 18:56
pass to keepass xc csv exporter
#!/bin/bash
# export passwords to external file
shopt -s nullglob globstar
prefix=${PASSWORD_STORE_DIR:-$HOME/.password-store}
for file in "$prefix"/**/*.gpg; do
file="${file/$prefix//}"
GROUP=$(dirname "$file" | sed 's#^//##')

Keybase proof

I hereby claim:

  • I am madmo on github.
  • I am moritzbitsch (https://keybase.io/moritzbitsch) on keybase.
  • I have a public key whose fingerprint is 9D7C D293 4B21 D0C5 ABA7 BA6C 0ED4 B6A9 67C3 4B54

To claim this, I am signing this object: