Skip to content

Instantly share code, notes, and snippets.

😜
I like cookies 🍪🍪🍪🍪

HansM SeppPenner

View GitHub Profile
@SeppPenner
SeppPenner / Configuration.md
Created Apr 17, 2019
OpenCover beeing stuck in infinite loop?
View Configuration.md
C:\Jenkins\workspace\someproject>OpenCover.Console.Exe -target:"C:\program files\dotnet\dotnet.exe" -targetargs:"test \"src\SomeProject.Tests\SomeProject.Tests.csproj\" --configuration Debug --no-build" -output:"src\TestResults\SomeProject.Tests.coveragexml" -oldstyle -register:user 
@SeppPenner
SeppPenner / Example.cs
Last active Mar 27, 2019
IEnumerable gives error exception handeling can't read list
View Example.cs
namespace ListExample
{
using System.Collections.Generic;
public class Program
{
private static readonly List<Animal> AnimalsToCheck = new List<Animal>
{
new Animal { Eater = Eater.Carnivore, Format = 1 },
new Animal { Eater = Eater.Herbivore, Format = 3 }
@SeppPenner
SeppPenner / License.txt
Created Mar 19, 2019
OpenSSL-Create certificate with brainpoolP512r1 and a certificate revocation list (CRL) for it
View License.txt
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 / License.txt
Last active Mar 7, 2019
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, ...
View License.txt
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 / CustomCellRenderer.cs
Created Jan 25, 2019
How can I disable the splitting of rows (not tables!) in Itext7 for C# when one row is to big to fit on the first page?
View CustomCellRenderer.cs
namespace PrueDi.Export.Pdf
{
using iText.Layout.Element;
using iText.Layout.Layout;
using iText.Layout.Renderer;
public class CustomCellRenderer : CellRenderer
{
public CustomCellRenderer(Cell modelElement) : base(modelElement)
{
@SeppPenner
SeppPenner / README.md
Last active Jan 11, 2019
Using CodePages in C# (e.g. .netCore/ NetCore) to provide special Windows encodings (e.g. 1252)
View README.md
  1. Add the nuget package System.Text.Encoding.CodePages to your project
  2. Use it like this example:
public class Test
{
	public Test()
	{
		Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
	}
@SeppPenner
SeppPenner / setup.sh
Last active Nov 11, 2018
Setting up .NET Core on a Raspberry Pi
View setup.sh
sudo apt-get install curl libunwind8 gettext
curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-arm.tar.gz
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/local/bin
dotnet --help
rm -rf dotnet.tar.gz
@SeppPenner
SeppPenner / Readme.md
Last active Dec 28, 2018
Python upgrade Pip packages
View Readme.md

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 / gist:d3ee97bc785d091d51efe49ab5fe0684
Created Sep 26, 2018
Install Grafana on a Raspberry Pi 3
View gist:d3ee97bc785d091d51efe49ab5fe0684
https://grafana.com/grafana/download/5.3.0-beta1?platform=arm
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.3.0-beta1_armhf.deb
sudo dpkg -i grafana_5.3.0-beta1_armhf.deb
View Grafana install on Raspberry PI 2 or 3
# to remove old version:
sudo dpkg -r grafana grafana-data
sudo apt-get -y autoremove
sudo rm -rf /etc/grafana /var/lib/grafana /var/log/grafana /etc/rc5.d/S02grafana /etc/rc6.d/K01grafana /etc/rc3.d/S02grafana /etc/rc2.d/S02grafana /etc/rc4.d/S02grafana /etc/rc1.d/K01grafana /etc/default/grafana /etc/init.d/grafana /etc/rc0.d/K01grafana /usr/lib/systemd/system/grafana-server.service /etc/systemd/system/grafana-server.service /etc/systemd/system/grafana.service /etc/systemd/system/multi-user.target.wants/grafana.service /etc/apt/sources.list.d/grafana.list /etc/default/grafana-server /etc/init.d/grafana-server /var/lib/systemd/deb-systemd-helper-enabled/grafana-server.service /var/lib/systemd/deb-systemd-helper-enabled/grafana.service.dsh-also /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/grafana.service /var/lib/systemd/deb-systemd-helper-masked/grafana.service /home/pi/grafana_2.6.0+dfsg-3_armhf.deb /home/pi/grafana-data_2.6.0+dfsg-3_all.deb
# to install latest:
curl https://bintray.
You can’t perform that action at this time.