Skip to content

Instantly share code, notes, and snippets.

View SeppPenner's full-sized avatar
😜
I like cookies 🍪🍪🍪🍪

SeppPenner SeppPenner

😜
I like cookies 🍪🍪🍪🍪
View GitHub Profile
@SeppPenner
SeppPenner / Installing Python 3.7.4 on Raspbian.rst
Last active May 9, 2024 21:52
Installing Python 3.7.4 on Raspbian

Installing Python 3.7.4 on Raspbian =================================

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).

@SeppPenner
SeppPenner / Readme.md
Last active March 17, 2022 06:16
A simple trace writer for Newtonsoft.Json serialization / deserialization debugging and logging to Serilog.
@SeppPenner
SeppPenner / Dockerfile
Last active April 9, 2021 10:05
Dockerfile for VerneMQ setup on Raspberry Pi including bridging to another broker
FROM armhf/debian:jessie
RUN apt-get update && apt-get install -y \
libssl-dev \
logrotate \
sudo \
curl \
jq \
&& rm -rf /var/lib/apt/lists/*
@SeppPenner
SeppPenner / License.txt
Last active January 7, 2021 14:22
C# MigraDoc break line in table cell if the text is too long for a cell and does not contain some split chars, e.g. commas, hypens, ...
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
@SeppPenner
SeppPenner / CheckTopic.cs
Last active May 18, 2020 16:42
MQTT: Matching a topic to a topic filter in C# based on Eclipse Mosquitto's function.
/// <summary>
/// Does a check if topics match a certain topic filter.
/// </summary>
/// <param name="allowedTopic">The allowed topic.</param>
/// <param name="topic">The topic.</param>
/// <returns><c>true</c> if the topic is valid, <c>false</c> if not.</returns>
public static bool TopicMatch(string allowedTopic, string topic)
{
if (string.IsNullOrWhiteSpace(allowedTopic) || string.IsNullOrWhiteSpace(topic))
{
@SeppPenner
SeppPenner / license-badges.md
Created February 21, 2020 09:02 — forked from lukas-h/license-badges.md
Lizenz-Buttons für dein Projekt

Markdown Lizenz-Buttons

Sammlung von Lizenz-Schildern (Badges) für die README-Datei deines Projekts. Diese Liste enthält die meist verbreiteten Open Source und Open Data Lizenzen. Kopieren und fügen Sie den Code unter den Badges einfach in Ihre Markdown-Dateien ein.

Notes

@SeppPenner
SeppPenner / ClearVisualStudioComponentModelCache.bat
Created February 21, 2020 09:02 — forked from wellwind/ClearVisualStudioComponentModelCache.bat
Clear Visual Studio component model cache, it's useful when visual studio crash but have no ideal how to fix.
DEL %userprofile%\AppData\Local\Microsoft\VisualStudio\10.0\ComponentModelCache
DEL %userprofile%\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
DEL %userprofile%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
@SeppPenner
SeppPenner / Readme.md
Last active October 10, 2019 14:28
Python upgrade Pip packages

For pip < 10.0.1:

import pip
from subprocess import call

packages = [dist.project_name for dist in pip.get_installed_distributions()]
for package in packages:
	try:
 call("pip install --upgrade " + package, shell=True)
@SeppPenner
SeppPenner / blazor-auth.md
Created October 10, 2019 13:57 — forked from SteveSandersonMS/blazor-auth.md
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

@SeppPenner
SeppPenner / ps-download-all-nuget-packages
Created September 12, 2019 13:32 — forked from SteveH3032/ps-download-all-nuget-packages
Nov 2018 - PowerShell script to download all NuGet packages
$indexClient = new-object system.net.webclient
$jsonIndex=$indexClient.DownloadString("https://api.nuget.org/v3/catalog0/index.json") | ConvertFrom-Json
for ($h=0; $h -lt $jsonIndex.items.Length; $h++) {
$web_client = new-object system.net.webclient
$jsonObj=$web_client.DownloadString($jsonIndex.items[$h].'@id') | ConvertFrom-Json
for ($i=0; $i -lt $jsonObj.items.Length; $i++) {
$package = $jsonObj.items[$i]."nuget:id" + "/" + $jsonObj.items[$i]."nuget:version"
$web_client.DownloadFile("https://www.nuget.org/api/v2/package/" + $package, ("C:\Nuget\" + $jsonObj.items[$i]."nuget:id" + "." + $jsonObj.items[$i]."nuget:version" + ".nupkg"))
"Processing: " + ($h + 1) + " of " + $jsonIndex.count + " ---- " + ($i + 1) + " of " + $jsonObj.count + " - " + $jsonObj.items[$i]."nuget:id" + "." + $jsonObj.items[$i]."nuget:version"
}