Skip to content

Instantly share code, notes, and snippets.

View bennof's full-sized avatar
😍
I'm still in love with make

Benjamin Benno Falkner bennof

😍
I'm still in love with make
View GitHub Profile
@bennof
bennof / deb_install_docker.sh
Last active July 27, 2022 12:07
Initialize Debian/Ubuntu Server Script for Docker
#!/bin/sh
# Install docker on Ubuntu/Debian
# (c) 2020-2022 Benjamin 'Benno' Falkner
set -e # halt on error
cat <<EOF
Init deb server
(c) 2019-2022 Benjamin 'Benno' Falkner (MIT-License)
www.falkner.xyz
@bennof
bennof / DisableRoot.sh
Created January 1, 2022 17:11
Disable root account on Ubuntu (should be default) and Debian
#!/bin/sh
# Disable root on Ubuntu/Debian
# (c) 2020-2021 Benjamin 'Benno' Falkner
##### NOT TESTET YET #####
set -e # halt on error, (debug add '-x')
cat <<EOF
Disable Root on Debian and Ubuntu
(c) 2020 Benjamin 'Benno' Falkner (MIT-License)
@bennof
bennof / NginxSetup.md
Last active April 19, 2021 16:26
Setup Nginx on Debian/Ubuntu - all the lines I ever forget

Nginx Setup

Idea

The idea is to create a nginx shell script to simplyfy setup, because most of the config is always the same. The script will be developed for Debian/Ubuntu with sodo installed.

Check if nginx installed

@bennof
bennof / InstallWordPressNginxMariaDBonUbuntu.sh
Last active August 30, 2022 01:03
Install WordPress, Nginx, MariaDB on Ubuntu or Debian
#!/bin/sh
# Install Wordpress, Nginx and MariaDB on Debian/Ubuntu
# (c) 2020 Benjamin 'Benno' Falkner
set -e # halt on error
cat <<EOF
Install WordPress with Nginx and MariaDB
(c) 2020 Benjamin 'Benno' Falkner (MIT-License)
EOF
@bennof
bennof / InstallMoodleNginxMariaDBonUbuntu.sh
Last active June 8, 2021 07:35
Install Moodle, Nginx and MariaDB on Ubuntu
#!/bin/sh
# Install Moodle, Nginx and MariaDB on Debian/Ubuntu
# (c) 2020 Benjamin 'Benno' Falkner
set -e # halt on error, debug
cat <<EOF
Install Moodle with Nginx and MariaDB
(c) 2020 Benjamin 'Benno' Falkner (MIT-License)
EOF
@bennof
bennof / GhostWithWebpackAndBulma.md
Last active August 14, 2020 19:36
Developing Ghost Themes with Webpack and Bulma

Developing Ghost Themes with Webpack and Bulma

Setup Ghost

npm -g instll ghost-cli@latest
cd /project/folder
ghost install local
@bennof
bennof / emailserversetup.md
Last active January 5, 2020 14:43
Privaten Emailserver Erstellen

Erstellen eines Emailservers mit Debian Postfix und Dovecot

Vorbereitung

Testen der Linuxversion: (Debian 10)

lsb_release -a

Firewall

@bennof
bennof / django_preact.md
Last active March 9, 2023 14:29
Django with preact and bulma

Create a Project using Django, preact and bulma

Python setup

Init folders:

mkdir project_name
cd project_name
pipenv --shell
pipenv install django djangorestframework django_rest_knox
@bennof
bennof / KurvendiskussionMitMaxima.md
Last active November 30, 2023 16:32
Kurvendiskussion Mit Maxima

Kurvendiskussion für das Abi NRW mit Maxima

under development

Dies richtet sich an deutschsprachige Lehrerinnen und Lehrer und Schülerinnen und Schüler, die eine automatische Kurvendiskussion für Übungsaufgaben haben wollen. Dabei wird das freie Algebrasystem Maxima (wxMaxima) verwendet.

Funktionen/Routinen zur Kurvendiskussion

Eingabe einer Funktion

pyC++

Calling C++ Functions from Python

1. C++ Classes

Classes are on of the basic constructs of C++ and are used widely in object oriented programming. More and more libraries are written in C++ using this technique to hide complexity and to keep programs readable. All this is very efficient as long as you will not try to call class function from C. Of course this is daffy, because you can easily write the entire Program in C++ and will avoid a lot of trouble.

If you started working with python it is different - OK you can use wrappers like "swig" or "boost", which will handle almost everything for you. All this will become complicated if you like to use callbacks, which are very simple to handle with ctypes[2]. Ctypes can be used to interface any C library directly from python and is the native way, if you do not want to integrate the interface in the C library by including "python.h" etc. Especially if you use a very strict model like Design Patterns, you will like to keep it simple and use ctyp