Dataiku Docker install JDBC MySQL

August 21, 2021

Download Driver Jar from maven

https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.26/mysql-connector-java-8.0.26.jar

wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.26/mysql-connector-java-8.0.26.jar

Copy jdbc.jar in Container

docker cp mysql-connector-java-8.0.26.jar <Container Name>:/home/dataiku/dss/lib/jdbc

Restart Service in Container

docker exec -it <Container Name> /home/dataiku/dss/bin/dss restart


Docker Nextcloud 22.0 Error solved: Docker-Compose for Nextcloud 22.0

Juli 26, 2021

Don't use latest MariaDB version 

Just use > MariaDB 10.6

version: '2' 

services:

db: image: mariadb:10.5 command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW restart: always volumes:
- ./db:/var/lib/mysql environment:
- MYSQL_ROOT_PASSWORD=test123
- MYSQL_PASSWORD=test123
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
app: image: nextcloud ports:
- 1234:80 links: - db volumes: - ./nextcloud:/var/www/html - ./nextcloud/php.ini:/usr/local/etc/php/php.ini"
restart: always

pull images

sudo docker-compose pull

Disable maintenance mode

docker-compose exec --user www-data app php occ maintenance:mode --off

Nginx proxy for your home network

Mai 18, 2021

How can you make your home network secure, easy accessible and host your own services?

How do you implement this structure in your own network?


Deploy Office 365 AddIns on Linux

Mai 18, 2021

How to deploy your own JavaScript Office 365 AddInn Instance on Linux:

Development enviroment: 

  • Visual Studio Code: https://code.visualstudio.com/
  • Addons: ESLint, TSLint, HTML CSS Support
  • curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
    sudo apt install nodejs
  • npm install -g yo generator-office
  • yo office

Adjust ports for hosting (bash script)

#!/bin/bash

# Assign the filename
filename_port="./package.json"
filename_ip="./manifest.xml"
search_ip="localhost:3000"
search_port="3000"

# Take the search string
read -p "Port eingeben: " replace_port

# Take the replace string
read -p "<IP:Port> eingeben " replace_ip

echo "Gibt es Port schon?"
netstat -ano | grep :$replace_port

if [[ $search_ip != "" && $replace_ip != "" ]]; then
sed -i "s/$search_ip/$replace_ip/" $filename_ip
fi

if [[ $search_port != "" && $replace_port != "" ]]; then
sed -i "s/$search_port/$replace_port/" $filename_port
fi

Deployment on Linux (Node)

IMPORTANT: the declared ports in package.json should be available

netstat -ano | grep :<port in package.json:12>

  • npm install office-addin-dev-certs
  • npm install
  • npm start

Port forwarding (get public access)

socat tcp-listen: "$port_extern"",reuseaddr,fork tcp:localhost:"$port_intern" 

port_intern: Port that you specified with the bash script (Port in package.json)

port_extern: Port over which public access should take place

View all node instances
ps -fC node
Kill all instances
killall node

Nginx reverse proxy: subdomain and SSL

April 28, 2021

Seven easy steps to configure a full nginx reverse proxy with ssl:

  • 1: go to your nginx folder
    cd /etc/nginx/sites-available
  • 2: create a new config file with your domain or subdomain name
    nano {subdomain.domain.de.conf}
  • 3: copy this and replace the right values
    map $http_upgrade $connection_upgrade {
      default upgrade;
      ''      close;
    }
    server {
      listen 80;
      server_name {subdomain.domain.de};
      return 301 https://$host$request_uri;
    }
    
    # SSL configuration
    server {
      listen 443 ssl;
      server_name {subdomain.domain.de};
      ssl_certificate      /etc/letsencrypt/live/{subdomain.domain.de}/fullchain.pem;
      ssl_certificate_key  /etc/letsencrypt/live/{subdomain.domain.de}/privkey.pem;
    
      # Improve HTTPS performance with session resumption
      ssl_session_cache shared:SSL:10m;
      ssl_session_timeout 5m;
    
      # Enable server-side protection against BEAST attacks
      ssl_prefer_server_ciphers on;
      ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
    
      # Disable SSLv3
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    
      # Diffie-Hellman parameter for DHE ciphersuites
      ssl_dhparam /etc/ssl/certs/dhparam.pem;
    
      # Enable HSTS (https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security)
      add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
    
      # Enable OCSP stapling (http://blog.mozilla.org/security/2013/07/29/ocsp-stapling-in-firefox)
      ssl_stapling on;
      ssl_stapling_verify on;
      ssl_trusted_certificate /etc/letsencrypt/live/{subdomain.domain.de}/fullchain.pem;
      resolver 8.8.8.8 8.8.4.4 valid=300s;
      resolver_timeout 5s;
    
      location / {
        proxy_pass http://{ip}:{port};
        proxy_set_header Host $host;
        proxy_redirect http:// https://;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
      }
    }
  • 4: if you have never certified a domain with certbot please execute openssl as follows:
    sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096
  • 5: register the domain on domain provider {subdomain.domain.de} has to point with an A-Record to your public IP adress

  • 6: certificate request
    • sudo systemctl stop nginx
    • sudo certbot certonly -d {subdomain.domain.de}
    • select: Spin up a temporary webserver (standalone) 
    • sudo systemctl start nginx
  • 7: last step symlink
    sudo ln -s /etc/nginx/sites-available/{subdomain.domain.de.conf} /etc/nginx/sites-enabled/

Bludit persistent install: docker-compose

April 27, 2021

The prebuilt official Docker image can be ran easily, but if you want  to make the content persistent, the plugins available and the themes customizable the shot documentation isn´t helpful enough.

I´ve created a easy to use docker-compose file, for a ready to use installation. Only prerequisite: docker and docker-compose. Installation: https://docs.docker.com/engine/install/ and https://docs.docker.com/compose/install/

version: "3.9"
services:
  bludit:
    image: "bludit/docker:latest"
    ports:
      - 8123:80
    volumes:
      - ./content:/usr/share/nginx/html/bl-content
      - ./plugins:/usr/share/nginx/html/bl-plugins
      - ./kernel:/usr/share/nginx/html/bl-kernel
      - ./themes:/usr/share/nginx/html/bl-themes
      - ./languages:/usr/share/nginx/html/bl-languages

RK3328 als Server für einfache Webapplikationen nutzen

April 27, 2021

Der Rockship Rk3328 mit dem Quad-core Cortex-A53 (Datasheet: https://www.rock-chips.com/a/en/products/RK33_Series/2017/0118/829.html) bietet eine kostengünstige Variante, um einfache Applikationen ressourcenschonend, dank Arm-Architektur, zu hosten. Dieser lässt sich oftmals in Android TV Boxen erhalten und nutzen. Die vorhandene Android Version wird gejailbreaked und die auf dem Board vorhandene EMMC mit einer für Arm optimierten Debian Version (Armbian) überspielt.

Was kann man darauf laufen lassen?

  • Emulatoren
  • Docker (Docker Container, welche ARM geeignet sind)
  • Nextcloud
  • Webserver
  • etc.

Warum ist diese Version von Vorteil?

  • Kostengünstig in der Anschaffung
  • sehr geringer Stromverbrauch
  • viele Möglichkeiten

Benötigte Hardware

Installation von Armbian

  • Eine Armbian Version wählen: https://disk.yandex.ru/d/DSO6euzB3ahemo/ARMBIAN/20.07/20200714-933  runterladen und entpacken
  • Mithilfe von Balena Etcher: https://www.balena.io/etcher/ Image auf SD Card flashen
  • TV-Box mit eingelegter SD-Card starten und die Einrichtung starten
  • Bevor die eMMC geflasht wird, sollte ein Backup erstellt werden. Dies erfolgt mithilfe von ddbr
  • mv /boot/mvr9-uboot.img /boot/uboot.img  #Umbennenen von mvr8-uboot.img in uboot.img
  • sudo bash /boot/create-mbr-linux.sh
  • sudo bash /root/install.sh

Das installierte Image und teile der Einleitung beziehen sich auf "Balbes 150" (18. August 2018) Zusätzliche Hilfe auf: https://forum.armbian.com/topic/8082-armbian-for-tv-box-rk3328/

Installation von Webservice: Bludit

sudo apt install apache2 php libapache2-mod-php php-mbstring php-gd php-xml php-json
sudo apt-get install git
git clone https://github.com/mhancoc7/Bludit-Pi.git
cd Bludit-Pi
bash build.sh