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 / ParamAndReturn.md
Last active June 29, 2018 08:12
Suggestion for Arduino parameters and return types

I would like to make a suggestion here, too.

image

I would organize the whole section from parameters to returns (See image) like the example shown below:

Parameters

Parameter name Parameter type Description Optional
@SeppPenner
SeppPenner / Installing Python 3.7.4 on Raspbian.rst
Last active January 8, 2024 12:33
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 / Dockerfile
Last active July 2, 2018 19:44
Run MongoDB 4.0 on a Raspberry
FROM armv7/armhf-ubuntu:latest
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
jq \
numactl \
# 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.
@SeppPenner
SeppPenner / gist:d3ee97bc785d091d51efe49ab5fe0684
Created September 26, 2018 11:25
Install Grafana on a Raspberry Pi 3
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
@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 / setup.sh
Last active November 11, 2018 17:28
Setting up .NET Core on a Raspberry Pi
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 January 11, 2019 08:05
Using CodePages in C# (e.g. .netCore/ NetCore) to provide special Windows encodings (e.g. 1252)
  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 / CustomCellRenderer.cs
Created January 25, 2019 15:41
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?
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 / 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