Skip to content

Instantly share code, notes, and snippets.

View dfch's full-sized avatar

Ronald Rink dfch

View GitHub Profile
@dfch
dfch / HttpClient.cs
Last active November 26, 2023 16:59
HttpClient and how to use Headers, Content-Type and PostAsync
// HttpClient and how to use Headers, Content-Type and PostAsync
// http://d-fens.ch/2014/04/12/httpclient-and-how-to-use-headers-content-type-and-postasync/
// Copyright 2014-2015 Ronald Rink, d-fens GmbH
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
@dfch
dfch / RaspberryPi400WlanSupportOnVenusOS.sh
Last active July 4, 2023 14:14
Commands necessary to enable WLAN support on Raspberry Pi 400 for Venus OS v3.00, https://watenan.uk/2023/07/02/enabling-wifi-on-a-raspberry-pi-400-with-venus-os/
mount -o remount,rw /
cd /lib/firmware/cypress
cp /run/media/sda1/cypress/cyfmac4356* .
chmod 644 cyfmac4356*
cd /lib/firmware/brcm
cp /run/media/sda1/brcm/brcmfmac4356-pcie.gpd-win-pocket.txt .
chmod 644 brcmfmac4356-pcie.gpd-win-pocket.txt
@dfch
dfch / VirtualBatteryMonitor.py
Last active May 31, 2023 22:01
A simple service for top balancing LiFePO4 batteries with a Victron MultiPlus-II with a constant current
#!/usr/bin/env python3
"""
A class to put a simple service on the dbus, according to victron standards, with constantly updating
paths. See example usage below. It is used to generate dummy data for other processes that rely on the
dbus. See files in dbus_vebus_to_pvinverter/test and dbus_vrm/test for other usage examples.
To change a value while testing, without stopping your dummy script and changing its initial value, write
to the dummy data via the dbus. See example.
@dfch
dfch / CacheManagerBase.cs
Created March 3, 2017 07:32
CacheManager - Strongly typed caching with System.Runtime.Caching.MemoryCache - https://d-fens.ch/2017/03/02/nobrainer-strongly-typed-caching-with-system-runtime-caching-memorycache/
/**
* Copyright 2017 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dfch
dfch / ODataQueryOptionsExtensions.cs
Last active August 23, 2022 15:16
ODataQueryOptionExtensions - Modifying ODataQueryOptions on the fly - https://d-fens.ch/2017/02/26/modifying-odataqueryoptions-on-the-fly/
/**
* Copyright 2017 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dfch
dfch / ### PowerShell modules, digital signatures, NuGet nuspec and packages.md
Last active January 1, 2022 20:19
PowerShell modules, digital signatures, NuGet nuspec and packages

PowerShell modules, digital signatures, NuGet nuspec and packages

d-fens GmbH General-Guisan-Strasse 6 CH-6300 Zug Switzerland

/**
* Copyright 2017 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dfch
dfch / Retry.cs
Last active August 28, 2021 22:20
Transient Error Handling with automatic Retries in C# - d-fens.net -
/**
* Copyright 2017 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dfch
dfch / RepositorySingleton.cs
Last active August 28, 2021 22:19
Simplifying Sparx Enterprise Architect Development with C# Interactive (CSI)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.IO;
using System.Threading;
namespace biz.dfch.CS.EA.ProductModeler.Tests.Repository
{
public class RepositorySingleton : IDisposable
@dfch
dfch / BaselineComparison.cs
Created August 11, 2019 09:39
Handling Sparx Enterprise Architect Baseline Information
/**
* Copyright 2018 d-fens GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software