What are PATs? Personal access tokens are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line. Personal access tokens are intended to access GitHub resources on your behalf. To access resources on behalf of an organization,…
What is a Codespace? A codespace is a development environment that's hosted in the cloud. You can customize your project for GitHub Codespaces by committing configuration files to your repository (also known as configuration-as-code), which creates a repeatable codespace configuration for all users of your…
awk and sed are text manipulation programs. You can use them for example to replace strings: echo image.jpg | sed 's/\.jpg/.png/' image.png or change order of strings: echo "hello world" | awk '{print $2, $1}' world hello awk and sed are harder to learn than…
This Blog post is my personal summary of Googles code review process Make sure to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do. Look at…
You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date. But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden…
What are PATs? Personal access tokens are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line. Personal access tokens are intended to access GitHub resources on your behalf. To access resources on behalf of an organization,…
What is a Codespace? A codespace is a development environment that's hosted in the cloud. You can customize your project for GitHub Codespaces by committing configuration files to your repository (also known as configuration-as-code), which creates a repeatable codespace configuration for all users of your…
awk and sed are text manipulation programs. You can use them for example to replace strings: echo image.jpg | sed 's/\.jpg/.png/' image.png or change order of strings: echo "hello world" | awk '{print $2, $1}' world hello awk and sed are harder to learn than…
Obwohl Proxmox selbst ja sehr gute Monitoring Informationen direkt auf dem eigenen WebUI anzeigt werde ich um Grafana und Prometheus besser kennen zu lernen diese Tools nutzen um meinen Proxmox Host zu überwachen. Mit der Open-Source-Software von Grafana kann man Metriken, Protokolle und Ablaufverfolgungen, visualisieren,…
Capture Groups Im letzten Post haben wir einen kleinen Einstieg in Regex mit Java gemacht. Nun sehen wir uns an, wie man Regex Pattern in Java mittels Capture Groups anwenden kann: String regex = "(1[-.\\s])?(\\d{3}[-.\\s]?)(\\d{3}[-.\\s]?)\\d{4}"; String phoneNumber = "12.523.231.4234"; Pattern pat = Pattern.compile(regex); Matcher mat =…
Was ist Regex? Regex steht für Regular expressions und ist eine Technik, Technologie und Sprache an und für sich, die verwendet werden kann zum Ausdrücken von Textmustern mit Symbolen. Und diese Symbole sind selbst Text. Damit lassen wir verschiedene Textteile und Zeichen andere Textfolgen darstellen. In…
Sobald ein Feld sichtbar ist, bedeutet das auch, das es gelesen und beschrieben werden kann. Die Access-Modifier steuern, von wo auf Felder und Methoden eines Objekts zugegriffen werden kann: Modifier Wer darf zugreifen? public Auf public-Objekte/Felder und Methoden darf ohne Einschränkungen von überall aus zugegriffen…
In diesem Blog fasse ich die Java Namenskonventionen kurz zusammen: Typ Namenskonvention Beispiele Class Sollte mit Grossbuchstaben beginnen und sollte ein Substantiv wie Farbe, Knopf, System, Faden usw. sein. Verwenden Sie geeignete Wörter anstelle von Akronymen. public class Employee { //code snippet } Interface Sollte…
Dieser Beitrag ist meine Zusammenfassung (in meinem eigenen Interesse) des ursprünglichen Beitrags in voller Länge: https://leebriggs.co.uk/blog/2022/07/20/nobody-knows-what-declarative-is Immer wieder stösst man im Bereich Infrastructure as Code (IaC) auf die Begriffe imperativ und deklarativ. Doch was bedeuten diese Begriffe? Ist Terraform wirklich deklarativ und Ansible nicht? Diese…
Obwohl Proxmox selbst ja sehr gute Monitoring Informationen direkt auf dem eigenen WebUI anzeigt werde ich um Grafana und Prometheus besser kennen zu lernen diese Tools nutzen um meinen Proxmox Host zu überwachen. Mit der Open-Source-Software von Grafana kann man Metriken, Protokolle und Ablaufverfolgungen, visualisieren,…
Capture Groups Im letzten Post haben wir einen kleinen Einstieg in Regex mit Java gemacht. Nun sehen wir uns an, wie man Regex Pattern in Java mittels Capture Groups anwenden kann: String regex = "(1[-.\\s])?(\\d{3}[-.\\s]?)(\\d{3}[-.\\s]?)\\d{4}"; String phoneNumber = "12.523.231.4234"; Pattern pat = Pattern.compile(regex); Matcher mat =…
Was ist Regex? Regex steht für Regular expressions und ist eine Technik, Technologie und Sprache an und für sich, die verwendet werden kann zum Ausdrücken von Textmustern mit Symbolen. Und diese Symbole sind selbst Text. Damit lassen wir verschiedene Textteile und Zeichen andere Textfolgen darstellen. In…
Sobald ein Feld sichtbar ist, bedeutet das auch, das es gelesen und beschrieben werden kann. Die Access-Modifier steuern, von wo auf Felder und Methoden eines Objekts zugegriffen werden kann: Modifier Wer darf zugreifen? public Auf public-Objekte/Felder und Methoden darf ohne Einschränkungen von überall aus zugegriffen…
LXC LXC ist ein Userspace Interface zur Eindämmung des Linux-Kernels und kann verwendet werden für Systemvirtualisierung. Durch eine mächtige API und einfache Tools ermöglicht es Linux Benutzern einfache Erstellung und Verwaltung von System Container. LXC ermöglicht ein komplettes OS in einem Container zu betreiben. LXD…
Beschreibung Citrix ADC, bis vor einer Weile noch als Citrix NetScaler bekannt ist eine Netzwerk Appliance welche als Access Gateway und Proxy verwendet werden kann. In diesem Artikel werden wir ein kleines Ansible Playbook schreiben, mit welchem man einen Citrix ADC sichern kann. Als erster…
Woher lädt Java eigentlich seine JDK Klassen? Beim Start einer Applikation kann mit -cp ein Klassenpfad angegeben werden, in welchem sich Klassen befinden, die man verwenden möchte. Das ist das normale Vorgehen, wie man Klassen integriert. Doch woher hat das JDK seine eigenen Klassen? Um…
Einführung JavaFX ist das modernste in der Java SE integrierte GUI-Framework zum Erstellen grafischer Benutzeroberflächen (GUI: Graphical User Interface). JavaFX ist eine reine Java-Bibliothek, die zwar, auch deklarative Definitionen von GUIs über XML ermöglicht, die aber im Kern aus Java-Klassen besteht. Seit Java 8 liegt…
Dieser Post wurde aus dem Original (https://datastrophic.io/kubernetes-homelab-with-proxmox-kubeadm-calico-openebs-and-metallb/)auf Deutsch übersetzt und leicht angepasst. Nachdem wir im ersten Teil mit Terraform die VMs für unseren K8s Cluster deployed haben, werden wir nun mit Ansible die folgenden K8s Komponenten in den worker Nodes und dem Controller installieren: Die…
In diesem Blog fasse ich die Java Namenskonventionen kurz zusammen: Typ Namenskonvention Beispiele Class Sollte mit Grossbuchstaben beginnen und sollte ein Substantiv wie Farbe, Knopf, System, Faden usw. sein. Verwenden Sie geeignete Wörter anstelle von Akronymen. public class Employee { //code snippet } Interface Sollte…
LXC LXC ist ein Userspace Interface zur Eindämmung des Linux-Kernels und kann verwendet werden für Systemvirtualisierung. Durch eine mächtige API und einfache Tools ermöglicht es Linux Benutzern einfache Erstellung und Verwaltung von System Container. LXC ermöglicht ein komplettes OS in einem Container zu betreiben. LXD…
Beschreibung Citrix ADC, bis vor einer Weile noch als Citrix NetScaler bekannt ist eine Netzwerk Appliance welche als Access Gateway und Proxy verwendet werden kann. In diesem Artikel werden wir ein kleines Ansible Playbook schreiben, mit welchem man einen Citrix ADC sichern kann. Als erster…
Woher lädt Java eigentlich seine JDK Klassen? Beim Start einer Applikation kann mit -cp ein Klassenpfad angegeben werden, in welchem sich Klassen befinden, die man verwenden möchte. Das ist das normale Vorgehen, wie man Klassen integriert. Doch woher hat das JDK seine eigenen Klassen? Um…
Einführung JavaFX ist das modernste in der Java SE integrierte GUI-Framework zum Erstellen grafischer Benutzeroberflächen (GUI: Graphical User Interface). JavaFX ist eine reine Java-Bibliothek, die zwar, auch deklarative Definitionen von GUIs über XML ermöglicht, die aber im Kern aus Java-Klassen besteht. Seit Java 8 liegt…
Einleitung In ersten Teil werden wir ein cloud-init Template erstellen, welches wir dann mit Terraform nutzen um die K8S VMs zu erzeugen. Damit wir mit Terraform unsere Kubernetes Nodes deployen können, brauchen wir ein Template. Das kann man entweder bereits mit Ansible machen, sieh dir…
Java kommt von Haus aus mit einer relationalen Open-Source-Datenbank, der Apache-Derby-Datenbank, welche in reinem Java geschrieben ist und sich dadurch nicht nur als eigener Prozess betreiben lässt, sondern auch als Embeded Bestandteil einer Java Anwendung betrieben werden kann. Das ist jedoch für den produktiven Betrieb…
Die erste Ziffer des Status-Codes definiert die Klasse der Response. Die letzten zwei Ziffern haben keine Bedeutung für die Kategorisierung. Es gibt fünf unterschiedliche Response Klassen: Nachfolgend eine Zusammenstellung der häufigsten HTTP-Codes denen man im Alltag begegnet: HTTP-Statuscode Bedeutung 200 OK Der Request wurde ohne…
Was geschieht eigentlich wenn ich eine Webseite aufrufe? Wir überspringen den Ersten Teil mit DNS und gehen davon aus, dass die URL bereits im DNS Cache ist. Um diese Frage zu beantworten, müssen wir uns mit den Grundlagen des HTTP-Protokolls befassen. Der Aufruf der Webseite…
TOC steht für Table of Contents (aka Inhaltsverzeichnis). Jedes grössere README Markdown File in einem git Repo sollte über ein TOC verfügen. Doch die Pflege eines TOC sowie die initiale Erstellung ist nicht sehr handlich, du musst für jeden einzelnen Titel in der richtigen Einrückung…
Dieser Post wurde aus dem Original (https://datastrophic.io/kubernetes-homelab-with-proxmox-kubeadm-calico-openebs-and-metallb/)auf Deutsch übersetzt und leicht angepasst. Nachdem wir im ersten Teil mit Terraform die VMs für unseren K8s Cluster deployed haben, werden wir nun mit Ansible die folgenden K8s Komponenten in den worker Nodes und dem Controller installieren: Die…
Einleitung In ersten Teil werden wir ein cloud-init Template erstellen, welches wir dann mit Terraform nutzen um die K8S VMs zu erzeugen. Damit wir mit Terraform unsere Kubernetes Nodes deployen können, brauchen wir ein Template. Das kann man entweder bereits mit Ansible machen, sieh dir…
Java kommt von Haus aus mit einer relationalen Open-Source-Datenbank, der Apache-Derby-Datenbank, welche in reinem Java geschrieben ist und sich dadurch nicht nur als eigener Prozess betreiben lässt, sondern auch als Embeded Bestandteil einer Java Anwendung betrieben werden kann. Das ist jedoch für den produktiven Betrieb…
Die erste Ziffer des Status-Codes definiert die Klasse der Response. Die letzten zwei Ziffern haben keine Bedeutung für die Kategorisierung. Es gibt fünf unterschiedliche Response Klassen: Nachfolgend eine Zusammenstellung der häufigsten HTTP-Codes denen man im Alltag begegnet: HTTP-Statuscode Bedeutung 200 OK Der Request wurde ohne…
Was geschieht eigentlich wenn ich eine Webseite aufrufe? Wir überspringen den Ersten Teil mit DNS und gehen davon aus, dass die URL bereits im DNS Cache ist. Um diese Frage zu beantworten, müssen wir uns mit den Grundlagen des HTTP-Protokolls befassen. Der Aufruf der Webseite…
In diesem Artikel ist beschrieben, wie man Apache Tomcat direkt in VSCode nutzen kann. Voraussetzung ist, dass du auf deinem Gerät bereits eine Java JRE und Apache Maven installiert hast. Weiter brauchen wir in VSCode das Extension Pack for Java, du kannst dire in VSCode…
Einleitung Das Serverlet-Framework Jakarta EE ermöglicht die Entwicklung von Anwendungen für eine grosse Anzahl paralleler Benutzer die über einen Web-Browser zugreifen. Dazu ist besonders die Serverlet-API von JEE von Interesse. Diese API-Klasse wartet auf eingehende Netzwerkverbindungen und reagiert mit einer entsprechenden Antwort. Für die übertragenen…
A terminal for the modern age Tabby ist ein anpassbares, Platform-Übergreifendes Terminal App für die Arbeit mit Lokalen Shells sowie Serial, SSH und Telnet Verbindungen. Aus diesen Gründen ist Tabby viel praktischer und moderner als Putty: Link zum App: https://tabby.sh/ Link zum Projekt auf GitHub:…
In Java gibt es keinen nennenswerten Unterschied wischen I/O mit Daten und I/O mit Netzwerkverbindungen. In beiden Fällen basiert die Ein- und Ausgabe auf InputStream und OutputStream, der Unterschied liegt nur darin, wo diese Datenströme herkommen. Bei der Netzwerkkommunikation mit dem TCP-Protokoll kommen sie aus…
Systemanforderungen Proxmox gibt folgende minimale Systemanforderungen an: Für produktive Workloads sind diese Anforderungen aber nicht gedacht. Daher sind die empfohlenen Systemanforderungen wie folgt: Da ich meine Proxmox Infrastruktur zum Start nur als Standalone LAB installieren will und für mein kleines Budget maximal viel Leistung erhalten…
TOC steht für Table of Contents (aka Inhaltsverzeichnis). Jedes grössere README Markdown File in einem git Repo sollte über ein TOC verfügen. Doch die Pflege eines TOC sowie die initiale Erstellung ist nicht sehr handlich, du musst für jeden einzelnen Titel in der richtigen Einrückung…
In diesem Artikel ist beschrieben, wie man Apache Tomcat direkt in VSCode nutzen kann. Voraussetzung ist, dass du auf deinem Gerät bereits eine Java JRE und Apache Maven installiert hast. Weiter brauchen wir in VSCode das Extension Pack for Java, du kannst dire in VSCode…
Einleitung Das Serverlet-Framework Jakarta EE ermöglicht die Entwicklung von Anwendungen für eine grosse Anzahl paralleler Benutzer die über einen Web-Browser zugreifen. Dazu ist besonders die Serverlet-API von JEE von Interesse. Diese API-Klasse wartet auf eingehende Netzwerkverbindungen und reagiert mit einer entsprechenden Antwort. Für die übertragenen…
A terminal for the modern age Tabby ist ein anpassbares, Platform-Übergreifendes Terminal App für die Arbeit mit Lokalen Shells sowie Serial, SSH und Telnet Verbindungen. Aus diesen Gründen ist Tabby viel praktischer und moderner als Putty: Link zum App: https://tabby.sh/ Link zum Projekt auf GitHub:…
In Java gibt es keinen nennenswerten Unterschied wischen I/O mit Daten und I/O mit Netzwerkverbindungen. In beiden Fällen basiert die Ein- und Ausgabe auf InputStream und OutputStream, der Unterschied liegt nur darin, wo diese Datenströme herkommen. Bei der Netzwerkkommunikation mit dem TCP-Protokoll kommen sie aus…
Die Architektur Proxmox VE ist eine Plattform zum Betrieben von virtuellen Maschinen und Container. Dabei ist die gesamte Proxmox VE Plattform open source und baisert auf Debian Linux. die VE Plattform besteht aus zwei virtualisierungs-technologien: Proxmox gibt es als single node, oder als Cluster mit…
Dateioperationen mit java.io werden in Java immer, direkt oder indirekt, durch ein Objekt des Typs java.io.File abgebildet. Dabei kann File aber nicht selbst aus Dateien lesen, oder in sie schreiben, dazu benötigt man einen Reader oder Writer (für Textdateien) resp. einen InputStream oder OutputStream (für…
Eine Methode kann einen typisierten Parameter erzwingen und einen typisierten Wert zurückgeben: public List<Integer> parseAlleInts(List<String> strings){ List<Integer> ergebnis = new ArrayList<>(); for (String s : strings){ ergebnis.add(Integer.parseInt(s)); } return ergebnis; } So ist es möglich eine Liste von Strings als Paramter in eine Liste von…
Diese Collection Methode kann dazu verwendet werden, über alle Werte einer Collection zu iterieren: die Methode iterator, gibt ein Objekt vom Typ Iterator zurück. Mit der Methode hasNext wird geprüft, ob es noch ein weiteres Element in der Collection gibt, next gibt das nächste Element…
Sets eignen sich für die Bearbeitung einer mathematischen Menge. Set kann somit keine identische Elemente enthalten und kann keine interneReihenfolge haben. Deshalb gibt es für Set auch keine Methoden die den direkten Zugriff auf ein Element ermöglichen. Um auf ein Element eines Set zuzugreifen muss…
Systemanforderungen Proxmox gibt folgende minimale Systemanforderungen an: Für produktive Workloads sind diese Anforderungen aber nicht gedacht. Daher sind die empfohlenen Systemanforderungen wie folgt: Da ich meine Proxmox Infrastruktur zum Start nur als Standalone LAB installieren will und für mein kleines Budget maximal viel Leistung erhalten…
Die Architektur Proxmox VE ist eine Plattform zum Betrieben von virtuellen Maschinen und Container. Dabei ist die gesamte Proxmox VE Plattform open source und baisert auf Debian Linux. die VE Plattform besteht aus zwei virtualisierungs-technologien: Proxmox gibt es als single node, oder als Cluster mit…
Dateioperationen mit java.io werden in Java immer, direkt oder indirekt, durch ein Objekt des Typs java.io.File abgebildet. Dabei kann File aber nicht selbst aus Dateien lesen, oder in sie schreiben, dazu benötigt man einen Reader oder Writer (für Textdateien) resp. einen InputStream oder OutputStream (für…
Eine Methode kann einen typisierten Parameter erzwingen und einen typisierten Wert zurückgeben: public List<Integer> parseAlleInts(List<String> strings){ List<Integer> ergebnis = new ArrayList<>(); for (String s : strings){ ergebnis.add(Integer.parseInt(s)); } return ergebnis; } So ist es möglich eine Liste von Strings als Paramter in eine Liste von…
Diese Collection Methode kann dazu verwendet werden, über alle Werte einer Collection zu iterieren: die Methode iterator, gibt ein Objekt vom Typ Iterator zurück. Mit der Methode hasNext wird geprüft, ob es noch ein weiteres Element in der Collection gibt, next gibt das nächste Element…
Listen sind Collections, die am ehesten einem Array entsprechen. Die Elemente bleiben in der Reihenfolge wie sie hinzugefügt werden und sie können auf einzelne Positionen im Index der Liste zugreifen: lesen mit get(index) und schreiben mit set(index, element). Damit ist mit Listen alles möglich, was…
Collections sind ganz alltägliche Java Objekte. Im Gegensatz zu Arrays sind Collections nicht durch native Methoden und einem zusammenhängenden Speicherbereich optimiert, sie haben auch keine eigene Syntax. Die Vorteile von Collections sind der Benutzerkomfort, da sie über eine umfangreichere und komfortablere API verfügen. Zudem können…
Varargs, auch Parameter-Listen genannt können in Java Arrays verwendet werden, um eine dynamische Anzahl von Parametern entgegenzunehmen. public static int max(int… numbers){ int result = Integer.MIN_VALUE; for (int number : numbers){ if (number > result){ result = number; } } return result; } Diese Methode…
Die for-each Schleife ist speziell für Arrays und Collections gedacht, denn diese Schleife enthält keine Zählvariable, enthält aber nacheinander alle Einträge des Arrays oder der Collection. Buch[] buecher = …; for (Buch buch : buecher){ System.out.println(buch.getTitel()); } Dabei wird in den Klammern der Schleife eine…
Vaultwarden ist eine alternative Implementation der Bitwarden Server API entwickelt in Rust, kompatibel mit allen Bitwarden clients. Vaultwarden eignet sich daher perfekt für self-hosted deployments, oder überall dort wo der offizielle Bitwarden Service nicht ideal geeignet ist. Dazu gibt es einmal das Vaultwarden Docker Image…
Sets eignen sich für die Bearbeitung einer mathematischen Menge. Set kann somit keine identische Elemente enthalten und kann keine interneReihenfolge haben. Deshalb gibt es für Set auch keine Methoden die den direkten Zugriff auf ein Element ermöglichen. Um auf ein Element eines Set zuzugreifen muss…
Listen sind Collections, die am ehesten einem Array entsprechen. Die Elemente bleiben in der Reihenfolge wie sie hinzugefügt werden und sie können auf einzelne Positionen im Index der Liste zugreifen: lesen mit get(index) und schreiben mit set(index, element). Damit ist mit Listen alles möglich, was…
Collections sind ganz alltägliche Java Objekte. Im Gegensatz zu Arrays sind Collections nicht durch native Methoden und einem zusammenhängenden Speicherbereich optimiert, sie haben auch keine eigene Syntax. Die Vorteile von Collections sind der Benutzerkomfort, da sie über eine umfangreichere und komfortablere API verfügen. Zudem können…
Varargs, auch Parameter-Listen genannt können in Java Arrays verwendet werden, um eine dynamische Anzahl von Parametern entgegenzunehmen. public static int max(int… numbers){ int result = Integer.MIN_VALUE; for (int number : numbers){ if (number > result){ result = number; } } return result; } Diese Methode…
Die for-each Schleife ist speziell für Arrays und Collections gedacht, denn diese Schleife enthält keine Zählvariable, enthält aber nacheinander alle Einträge des Arrays oder der Collection. Buch[] buecher = …; for (Buch buch : buecher){ System.out.println(buch.getTitel()); } Dabei wird in den Klammern der Schleife eine…
Eindimensionales Array Nebst den eindimensionalen Java Arrays gibt es auch mehrdimensionale Arrays. Hier ein Beispiel eines eindimensionalen Java Arrays: int[] zahlen = new int[]{1, 2, 3, 4}; Ein mehrdimensionales Array könnte beispielsweise ein Schachfeld sein: Schachfigur[][] schachbrett = new Schachfigur[8][8]; Mehrdimensionale Arrays sind nicht auf…
Vaultwarden ist eine alternative Implementation der Bitwarden Server API entwickelt in Rust, kompatibel mit allen Bitwarden clients. Vaultwarden eignet sich daher perfekt für self-hosted deployments, oder überall dort wo der offizielle Bitwarden Service nicht ideal geeignet ist. Dazu gibt es einmal das Vaultwarden Docker Image…
Eindimensionales Array Nebst den eindimensionalen Java Arrays gibt es auch mehrdimensionale Arrays. Hier ein Beispiel eines eindimensionalen Java Arrays: int[] zahlen = new int[]{1, 2, 3, 4}; Ein mehrdimensionales Array könnte beispielsweise ein Schachfeld sein: Schachfigur[][] schachbrett = new Schachfigur[8][8]; Mehrdimensionale Arrays sind nicht auf…
Let's build a GraphQL Spring Application that will accept GraphQL requests at http://localhost:8080/graphql. First let's navigate to https://start.spring.io. This service pulls in all the dependencies you need for an application and does most of the setup for you. GraphQL is a query language to retrieve…
Lets Suppose you need to perform a certain kind of work in all of these directories: You might know about the "cd" command. But isn't it annoying if you need to use and retype a lot of Commands, like for example: $ cd ~/Work/Projects/Web/src $…
This Post is a summary of the famous Article about Microservices: https://martinfowler.com/articles/microservices.html The text discusses the concept of "Microservice Architecture," which is an approach to designing software applications as a suite of independently deployable services. It highlights that there is no precise definition but outlines…
What is it about? We define an API contract as a formal agreement between a software provider and a consumer that abstractly communicates how to interact with each other. This contract defines how API providers and consumers interact, what data exchanges looks like, and how…
module "zland" { source = "git::ssh//git@gitlab.com/zland/module.git" version = "1.0.5" servers = 3 } Module Output Values resource "aws_instance" "appserver" { #... instance = module.servers.instance_ids } Since the resources defined in a module are encapsulated, a calling module cannot access their attributes directly. Instead, the child…
This Blog post is my personal summary of Googles code review process Make sure to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do. Look at…
Let's build a GraphQL Spring Application that will accept GraphQL requests at http://localhost:8080/graphql. First let's navigate to https://start.spring.io. This service pulls in all the dependencies you need for an application and does most of the setup for you. GraphQL is a query language to retrieve…
Lets Suppose you need to perform a certain kind of work in all of these directories: You might know about the "cd" command. But isn't it annoying if you need to use and retype a lot of Commands, like for example: $ cd ~/Work/Projects/Web/src $…
This Post is a summary of the famous Article about Microservices: https://martinfowler.com/articles/microservices.html The text discusses the concept of "Microservice Architecture," which is an approach to designing software applications as a suite of independently deployable services. It highlights that there is no precise definition but outlines…
What is it about? We define an API contract as a formal agreement between a software provider and a consumer that abstractly communicates how to interact with each other. This contract defines how API providers and consumers interact, what data exchanges looks like, and how…
Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…
Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…
What is Validation? Validation is a process of making assertions against data to ensure data integrity Is a value required? How long is a phone number? Is it a good date? What is the maximum length of a string? Some refer to data validation as…
Data Transfer Objects DTOs - Data Transfer Objects DTOs are simple Java POJOs DTOs are data structures, generally should NOT have behavior DTOs are objects used to transfer data between producers and consumers Controller models are typically DTOs Why Not Entities? Database Entities are also…
HTTP Status Codes 100 Series - Informational Responses • 200 Series - Successful Responses 300 Series - Redirection Responses 400 Series - Client Error Responses 500 Series - Server Error Responses Use of HTTP Status Codes 200 Series are used when the request completes as…
module "zland" { source = "git::ssh//git@gitlab.com/zland/module.git" version = "1.0.5" servers = 3 } Module Output Values resource "aws_instance" "appserver" { #... instance = module.servers.instance_ids } Since the resources defined in a module are encapsulated, a calling module cannot access their attributes directly. Instead, the child…
Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…
Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…
What is Validation? Validation is a process of making assertions against data to ensure data integrity Is a value required? How long is a phone number? Is it a good date? What is the maximum length of a string? Some refer to data validation as…
Data Transfer Objects DTOs - Data Transfer Objects DTOs are simple Java POJOs DTOs are data structures, generally should NOT have behavior DTOs are objects used to transfer data between producers and consumers Controller models are typically DTOs Why Not Entities? Database Entities are also…
Why use Spring MockMVC? Spring MockMVC allows you to test the controller interactions in a servlet context without the application running in an application server. Mockito is the most popular mocking framework for testing Java Mocks (aka Test Doubles) are alternate implementations of objects to…
Intro Project Lombok is a Java library that provides a set of annotations and utility classes that help to reduce boilerplate code in Java projects. It offers features such as automatic generation of getters, setters, equals, hashCode, toString, and constructors, as well as support for…
Part 1 Of course, instantiating the class will come first. The class will populate properties after it has been created. It will therefore set up any properties you may have. Then, if they exist, we do have some interfaces that we can implement. These methods…
If you want to develop a Spring Application you need to know when to use which Annotation. Spring’s dependency injection capability includes the following annotations:
What are Conventional commits Conventional Commits is a convention for writing commit messages that provides structure and consistency to a project's version control history. It's based on the idea of defining a standard format for commit messages that makes it easier for developers to understand…
HTTP Status Codes 100 Series - Informational Responses • 200 Series - Successful Responses 300 Series - Redirection Responses 400 Series - Client Error Responses 500 Series - Server Error Responses Use of HTTP Status Codes 200 Series are used when the request completes as…
Why use Spring MockMVC? Spring MockMVC allows you to test the controller interactions in a servlet context without the application running in an application server. Mockito is the most popular mocking framework for testing Java Mocks (aka Test Doubles) are alternate implementations of objects to…
Intro Project Lombok is a Java library that provides a set of annotations and utility classes that help to reduce boilerplate code in Java projects. It offers features such as automatic generation of getters, setters, equals, hashCode, toString, and constructors, as well as support for…
Part 1 Of course, instantiating the class will come first. The class will populate properties after it has been created. It will therefore set up any properties you may have. Then, if they exist, we do have some interfaces that we can implement. These methods…
If you want to develop a Spring Application you need to know when to use which Annotation. Spring’s dependency injection capability includes the following annotations:
Summary of 'Clean code' by Robert C. Martin: https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29 Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility…
New Features New versions of JavaScript, such as ES6, ES2016, 2017, etc., come with many new features, however it is still ECMAScript Many of the new features are syntactic sugar or extend the functionality only marginal Template Literals Template literals are string literals with support…
The DOM Based on the received HTML document the browser builds up a model of the document structure, the Document Object Model (DOM) The DOM has a tree structure and each node of the document is represented by an object The browser renders the page…
Object An object is a collection of properties A property has a name and a value An object can be seen as associative array (map) where the keys in the array are the names of the object’s properties // Create object as literal const bob…
In this Post I try to explain the difference between the heap and the stack. It's just a very high level amateur explanation, there is a lot more to read and learn about this Topics. This Drawing helps me a lot to understand the basic…
What are Conventional commits Conventional Commits is a convention for writing commit messages that provides structure and consistency to a project's version control history. It's based on the idea of defining a standard format for commit messages that makes it easier for developers to understand…
Summary of 'Clean code' by Robert C. Martin: https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29 Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility…
New Features New versions of JavaScript, such as ES6, ES2016, 2017, etc., come with many new features, however it is still ECMAScript Many of the new features are syntactic sugar or extend the functionality only marginal Template Literals Template literals are string literals with support…
The DOM Based on the received HTML document the browser builds up a model of the document structure, the Document Object Model (DOM) The DOM has a tree structure and each node of the document is represented by an object The browser renders the page…
Object An object is a collection of properties A property has a name and a value An object can be seen as associative array (map) where the keys in the array are the names of the object’s properties // Create object as literal const bob…
Array An array combines multiple values in a single variable Arrays are helpful if the number of values is huge or dynamic Each value of an array has a unique numerical index // Normal variables hold exactly one value const colorA = "blue"; const colorB…
Function Expression A function expression starts with the keyword function followed by the function arguments in parentheses and the function body in curly braces: const square = function(x) { return x * x; }; console.log(square(4)); // >> 16 Function Scope Each function defines a scope…
What JavaScript is A scripting language originally designed for web browsers Object-oriented, however prototype-based and not class-based Supporting first-class functions A multi-paradigm language, supports imperative, object-oriented and functional programming style Untyped Moving from an interpreted language to just-in-time compilation Nowadays used for server-side programming too…
Requirements and Preparation Unfortunately Heroku currently only Supports Tomcat version 9.x. As a consequence you're not able to use the Java Jakarta Servlets, since they are only supported with Tomcat version 10.x. As a consequence you need to replace all your Jakarta Servlet imports with…
Did you know that your ssh Client sends the server all your public keys, one by one, until the server accepts one, when you try to authenticate via public key? Don't believe me? Try it out yourself: ssh whoami.filippo.io Someone could use this to find…
In this Post I try to explain the difference between the heap and the stack. It's just a very high level amateur explanation, there is a lot more to read and learn about this Topics. This Drawing helps me a lot to understand the basic…
Array An array combines multiple values in a single variable Arrays are helpful if the number of values is huge or dynamic Each value of an array has a unique numerical index // Normal variables hold exactly one value const colorA = "blue"; const colorB…
Function Expression A function expression starts with the keyword function followed by the function arguments in parentheses and the function body in curly braces: const square = function(x) { return x * x; }; console.log(square(4)); // >> 16 Function Scope Each function defines a scope…
What JavaScript is A scripting language originally designed for web browsers Object-oriented, however prototype-based and not class-based Supporting first-class functions A multi-paradigm language, supports imperative, object-oriented and functional programming style Untyped Moving from an interpreted language to just-in-time compilation Nowadays used for server-side programming too…
Requirements and Preparation Unfortunately Heroku currently only Supports Tomcat version 9.x. As a consequence you're not able to use the Java Jakarta Servlets, since they are only supported with Tomcat version 10.x. As a consequence you need to replace all your Jakarta Servlet imports with…
What is OPNsense? OPNsense® is an open source, easy-to-use and easy-to-build FreeBSD based firewall and routing platform. OPNsense includes most of the features available in expensive commercial firewalls, and more in many cases. It brings the rich feature set of commercial offerings with the benefits…
What is Maven? Declarative build management tool for automated builds Standardized directory structure Declarative dependency management Works with an XML control file (POM - Project Object Model) Open source, written in Java, for Java projects Pure command line tool IDEs offer integration Why Maven? Uniform…
Did you know that Threema allows you, to backup your Threema app to a custom Threema Safe server? You can for example use your Nextcloud to keep your Threema backups safe. I recommend to create a new Nextcloud user account only for the purpose of…
The Issue There is nothing worse than presenting a Java Stacktrace in a WebUI, full of technical Details about your Server environment of the Web App itself: So how can we avoid this? You don't want to share this informations with the users, it would…
What is the Spring Framework Spring is the world's most popular Java framework and makes programming Java quicker, easier, and safer for everybody. Spring’s focus on speed, simplicity, and productivity. You can select and generate your Spring Package online: https://start.spring.io/ Lets make a Gradle Project,…
Did you know that your ssh Client sends the server all your public keys, one by one, until the server accepts one, when you try to authenticate via public key? Don't believe me? Try it out yourself: ssh whoami.filippo.io Someone could use this to find…
What is OPNsense? OPNsense® is an open source, easy-to-use and easy-to-build FreeBSD based firewall and routing platform. OPNsense includes most of the features available in expensive commercial firewalls, and more in many cases. It brings the rich feature set of commercial offerings with the benefits…
What is Maven? Declarative build management tool for automated builds Standardized directory structure Declarative dependency management Works with an XML control file (POM - Project Object Model) Open source, written in Java, for Java projects Pure command line tool IDEs offer integration Why Maven? Uniform…
Did you know that Threema allows you, to backup your Threema app to a custom Threema Safe server? You can for example use your Nextcloud to keep your Threema backups safe. I recommend to create a new Nextcloud user account only for the purpose of…
The Issue There is nothing worse than presenting a Java Stacktrace in a WebUI, full of technical Details about your Server environment of the Web App itself: So how can we avoid this? You don't want to share this informations with the users, it would…
Introduction Let's imagine we have two Tables now, people and addresses. We want to find out how many people live at the same address. This is our current Java and SQL approach: repository/PeopleRepository.java @Override @SQL(value = FIND_BY_ID_SQL, operationType = CrudOperation.FIND_BY_ID) @SQL(value = FIND_ALL_SQL, operationType =…
Introduction In this Post I will describe how you can easily learn, test and play around with Java interacting with SQL Databases. This post is a summary of my Java learning course I'm taking on udemy. The post is not intended to be spread around…
Summary This post is my summary (for my own sake) of the original full length post: https://www.justingarrison.com/blog/2022-06-01-infrastructure-as-software/ Writing your infrastructure in a DSL or any other general purpose coding language like Ansible, Pulumi, Terraform is not Infrastructure as Software. Any managed service to deploy infrastructure…
Local date Now Let's start with the basics, we just want to represent the date today and print that local date now: public class TimeTest { public static void main(String[] args) { LocalDate now = LocalDate.now(); System.out.println(now); } } output: 2022-08-29 Process finished with exit…
What are Optionals? For the the number one use case for them has to do with null values. So whenever we're dealing with objects in Java, we store references to objects in variables. And those variables may or may not actually be pointing back to…
What is the Spring Framework Spring is the world's most popular Java framework and makes programming Java quicker, easier, and safer for everybody. Spring’s focus on speed, simplicity, and productivity. You can select and generate your Spring Package online: https://start.spring.io/ Lets make a Gradle Project,…
Introduction Let's imagine we have two Tables now, people and addresses. We want to find out how many people live at the same address. This is our current Java and SQL approach: repository/PeopleRepository.java @Override @SQL(value = FIND_BY_ID_SQL, operationType = CrudOperation.FIND_BY_ID) @SQL(value = FIND_ALL_SQL, operationType =…
Introduction In this Post I will describe how you can easily learn, test and play around with Java interacting with SQL Databases. This post is a summary of my Java learning course I'm taking on udemy. The post is not intended to be spread around…
Summary This post is my summary (for my own sake) of the original full length post: https://www.justingarrison.com/blog/2022-06-01-infrastructure-as-software/ Writing your infrastructure in a DSL or any other general purpose coding language like Ansible, Pulumi, Terraform is not Infrastructure as Software. Any managed service to deploy infrastructure…
Local date Now Let's start with the basics, we just want to represent the date today and print that local date now: public class TimeTest { public static void main(String[] args) { LocalDate now = LocalDate.now(); System.out.println(now); } } output: 2022-08-29 Process finished with exit…
What are Generics? What if we could write a single sort method that sort the elements in an Integer array, a String array, or an array of any type that supports ordering? Java Generics enable programmers to specify, with a single method declaration, a set…
What are Exceptions? An exception is an event, commonly it is a problem that arises during the execution of a program. When an Exception occurs the normal program is disrupted and the program/Application terminates abnormally, which is not recommended. Unexpected termination of an Application is…
Was ist Strava Strava ist das soziale Netzwerk für Sportler. Du kannst deine Sport Aktivitäten aufzeichnen und diese wird deinem Strava-Feed hinzugefügt - zusammen mit jenen, die deine Freunde und Followers mit dir teilen. Auf diese Weise könnt ihr eure Wettkampf- und Trainingsaktivitäten gegenseitig verfolgen,…
Beschreibung ShellCheck ist ein Tool, das Warnungen und Vorschläge für Bash/Sh-Shell-Skripte liefert. Das Tool kann verwendet werden für statische Code Analyse. Idealerweise wird das Tool in einer CI Pipeline integriert. Hier ein Beispiel einer Github Action Pipeline: name: Shellcheck on: pull_request: push: branches: - main…
Dieser Beitrag ist meine Zusammenfassung (in meinem eigenen Interesse) des ursprünglichen Beitrags in voller Länge: https://leebriggs.co.uk/blog/2022/07/20/nobody-knows-what-declarative-is Immer wieder stösst man im Bereich Infrastructure as Code (IaC) auf die Begriffe imperativ und deklarativ. Doch was bedeuten diese Begriffe? Ist Terraform wirklich deklarativ und Ansible nicht? Diese…
What are Optionals? For the the number one use case for them has to do with null values. So whenever we're dealing with objects in Java, we store references to objects in variables. And those variables may or may not actually be pointing back to…
What are Generics? What if we could write a single sort method that sort the elements in an Integer array, a String array, or an array of any type that supports ordering? Java Generics enable programmers to specify, with a single method declaration, a set…
What are Exceptions? An exception is an event, commonly it is a problem that arises during the execution of a program. When an Exception occurs the normal program is disrupted and the program/Application terminates abnormally, which is not recommended. Unexpected termination of an Application is…
Was ist Strava Strava ist das soziale Netzwerk für Sportler. Du kannst deine Sport Aktivitäten aufzeichnen und diese wird deinem Strava-Feed hinzugefügt - zusammen mit jenen, die deine Freunde und Followers mit dir teilen. Auf diese Weise könnt ihr eure Wettkampf- und Trainingsaktivitäten gegenseitig verfolgen,…
Beschreibung ShellCheck ist ein Tool, das Warnungen und Vorschläge für Bash/Sh-Shell-Skripte liefert. Das Tool kann verwendet werden für statische Code Analyse. Idealerweise wird das Tool in einer CI Pipeline integriert. Hier ein Beispiel einer Github Action Pipeline: name: Shellcheck on: pull_request: push: branches: - main…
Automatically update the hidden dependencies in your Dockerfiles
You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date.
But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden dependencies)?
Atlassian provides a Confluence image. If you want to run this with an Oracle database, you have to inject the Oracle JDBC driver yourself. But how can you ensure that you automatically always will have the most recent OJDBC driver in your Confluence image?
FROM atlassian/confluence:8.5.15-ubuntu-jdk17
+
+# Download the ojdbc driver
+RUN curl -fSL "https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc10/19.23.0.0/ojdbc10-19.23.0.0.jar" \
+ -o "${CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/lib/ojdbc10.jar"
+
+
First of all, let's extract the semantic version tag from the URL into a separate ARG so that Renovate only needs to bump the version there:
FROM atlassian/confluence:8.5.15-ubuntu-jdk17
+
+ARG OJDBC_VERSION=19.24.0.0
+
+# Download the ojdbc driver
+RUN curl -fSL "https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc10/${OJDBC_VERSION}/ojdbc10-${OJDBC_VERSION}.jar" \
+ -o "${CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/lib/ojdbc10.jar"
+
Next, we will add a comment directly above the ARG OJDBC version, which we will later use to tell Renovate what dependency type and package this version tag is about. It's a maven package with the package name "com.oracle.database.jdbc:ojdbc10":
You could write a custom regex manager in the Renovate config that updates this version tag. But what if you have multiple ARG or ENV version tags in multiple Dockerfiles within the same repo? You Probably don't want to write a regex config for each case.
Let's imagine you have something like this in your Dockerfile:
Now, you could even set up auto merge for these Renovate updates. Make sure you have some merge checks before you enable this. At least you should ensure that the Docker image can still be built before a new Renovate pull request gets auto-merged.
\ No newline at end of file
diff --git a/feed.json b/feed.json
index 67dc639..220548e 100644
--- a/feed.json
+++ b/feed.json
@@ -9,6 +9,29 @@
"name": "Finecloud"
},
"items": [
+ {
+ "id": "https://www.finecloud.ch/automatically-update-hidden-dependencies-in-your-dockerfiles.html",
+ "url": "https://www.finecloud.ch/automatically-update-hidden-dependencies-in-your-dockerfiles.html",
+ "title": "Automatically update the hidden dependencies in your Dockerfiles",
+ "summary": "You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date. But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden…",
+ "content_html": "\n
\n You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date.\n
\n\n
\n But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden dependencies)?\n
\n\n
\n Atlassian provides a Confluence image. If you want to run this with an Oracle database, you have to inject the Oracle JDBC driver yourself. But how can you ensure that you automatically always will have the most recent OJDBC driver in your Confluence image? \n
\n
FROM atlassian/confluence:8.5.15-ubuntu-jdk17\n\n# Download the ojdbc driver\nRUN curl -fSL \"https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc10/19.23.0.0/ojdbc10-19.23.0.0.jar\" \\\n -o \"${CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/lib/ojdbc10.jar\"\n\n
\n\n
\n First of all, let's extract the semantic version tag from the URL into a separate ARG so that Renovate only needs to bump the version there:\n
\n
FROM atlassian/confluence:8.5.15-ubuntu-jdk17\n\nARG OJDBC_VERSION=19.24.0.0\n\n# Download the ojdbc driver\nRUN curl -fSL \"https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc10/${OJDBC_VERSION}/ojdbc10-${OJDBC_VERSION}.jar\" \\\n -o \"${CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/lib/ojdbc10.jar\"\n
\n\n
\n Next, we will add a comment directly above the ARG OJDBC version, which we will later use to tell Renovate what dependency type and package this version tag is about. It's a maven package with the package name \"com.oracle.database.jdbc:ojdbc10\":\n
\n
FROM atlassian/confluence:8.5.15-ubuntu-jdk17\n\n# renovate: datasource=maven depName=com.oracle.database.jdbc:ojdbc10 packageName=com.oracle.database.jdbc:ojdbc10\nARG OJDBC_VERSION=19.24.0.0\n\n# Download the ojdbc driver\nRUN curl -fSL \"https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc10/${OJDBC_VERSION}/ojdbc10-${OJDBC_VERSION}.jar\" \\\n -o \"${CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/lib/ojdbc10.jar\"
\n\n
\n You could write a custom regex manager in the Renovate config that updates this version tag. But what if you have multiple ARG or ENV version tags in multiple Dockerfiles within the same repo? You Probably don't want to write a regex config for each case.\n
\n\n
\n Let's imagine you have something like this in your Dockerfile:\n
\n Now, you could even set up auto merge for these Renovate updates. Make sure you have some merge checks before you enable this. At least you should ensure that the Docker image can still be built before a new Renovate pull request gets auto-merged.\n
Remote state is not the default; you must specify which backend to use and configure it to be used.
Remote state can be used by multiple team members. Terraform will write state data to a remote data store that users with access can use so there aren’t multiple state files.
Remote state uses a backend, which is configured in your configuration’s root module.
Remote state allows you to share output values with other configurations. Those configurations can then consume the exposed outputs in additional configurations.
\n
\n\n
\n Remote State Storage support\n
\n\n
\n
Terraform Cloud
HashiCorp Consul
Amazon S3
Azure Blob Storage
Google Cloud Storage
Alibaba Cloud OSS
...and more
\n
\n\n
\n Separate Environments\n
\n\n \n
It is good practice to separate your Terraform configurations per environment.
Separate environments help with code organization, as well as allowing for better and easier CI and automation integration.
Implementing a one-folder-per-environment pattern lets you copy and paste Terraform code from one folder to another. This, used with variables, allows you to quickly change only what is needed per environment.
\n \n\n \n \n \n \n\n
\n Use Modules\n
\n\n \n
Modules are containers for multiple resources that are used together.
Every Terraform configuration contains at least one module.
Modules can call other modules. This lets you include a module’s resources in a configuration in a concise way.
Modules can be called multiple times, either in the same Terraform configuration or in separate ones. This allows for resource configurations to be packaged and reused.
\n \n\n
\n Arguments to use with Modules\n
\n\n
\n
source: This argument is mandatory for all modules.
version: This argument is recommended for modules from a registry.
meta-arguments: Arguments like for_each and count.
input variables: Most other arguments correspond to input variables.
\n Since the resources defined in a module are encapsulated, a calling module cannot access their attributes directly. Instead, the child module can declare output values.\n
\n\n
\n Create a custom Module (Example)\n
\n\n
\n Create those files in the folder modules/ec2:
main.tf\n
\n
resource \"aws_instance\" \"app_server\" {\n ami = \"DUMMY_VALUE_AMI\"\n instance_type = \"t3.micro\"\n subnet_id = \"DUMMY_VALUE_SUBNET_ID\"\n tags = {\n Name = \"WayneCorp\"\n }\n}\n
\n\n
\n outputs.tf\n
\n
output \"instance_id\" {\n description = \"ID of the EC2 instance\"\n value = aws_instance.app_server.id\n}\n\noutput \"instance_public_ip\" {\n description = \"Public IP address of the EC2 instance\"\n value = aws_instance.app_server.public_ip\n}
\n\n
\n to use your module, add this snippet at the end of you existing ec2.tf file:
\n —> test-bucket terraform plan -var=‘create_bucket=false’ Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be Persisted to local or remote state storage.\n
\n\n
\n No changes. Infrastructure is up-to-date.
This means that Terraform did not detect any differences between your configuration and real physical resources that exist. As a result, no actions need to be performed.\n
\n\n
\n The create_bucket=true Conditional\n
\n\n
\n output:\n
\n\n
\n —> test-bucket terraform plan -var=‘create_bucket=true’ Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be Persisted to local or remote state storage.
An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols:
+ create Terraform will perform the following actions:
+ google_storage_bucket.twinkiebucket ...\n
\n\n
\n Use null_resource\n
\n\n
\n
The null_resource is useful when you need to do something that is not directly associated with the lifecycle of an actual resource.
Within a null_resource, you can configure provisioners to run scripts to do pretty much whatever you want.
Just like with provisioners, it is a good idea to use null_resource sparingly since it adds to the complexity of your Terraform usage.
Make sure, when you do use it, that you vet the scripts being called thoroughly.
\n Actions that are done inside a null_resource are not managed by Terraform. If you decide to call a command to create resources in your null_resource, Terraform will not know about the resource creation, and therefore can’t manage its lifecycle and state.\n
\n\n
\n you could for example add those lines to your main.tf:\n
\n this Terraform code defines a local variable named hostname using the locals block. This variable is computed using the `format` function and a string template. Let's break down the components of this function:
1. `${format(...)}:` This part of the code is using Terraform's interpolation syntax `${...}` to execute the `format` function. The `format` function is used to create formatted strings by substituting values into placeholders within a template string.
2. `\"${format(\"%s-%s-%s-%s-%04d-%s\", var.region, var.env, var.app, var.type, var.cluster_id, var.id)}\"`: This is the template string used in the `format` function. It consists of several placeholders, each represented by `%s` or `%04d`, which are replaced by the values provided after the template string.\n
\n\n
\n
`%s`: This is a placeholder for a string value.
`%04d`: This is a placeholder for a decimal integer value, formatted with leading zeros to ensure a total width of 4 characters.
\n
\n\n
\n The values to be substituted into these placeholders come from various Terraform variables:\n
\n\n
\n
`var.region`: This variable is expected to contain a string representing a region.
`var.env`: This variable is expected to contain a string representing an environment.
`var.app`: This variable is expected to contain a string representing an application name.
`var.type`: This variable is expected to contain a string representing a type.
`var.cluster_id`: This variable is expected to contain a numeric cluster identifier.
`var.id`: This variable is expected to contain a string or value that is used in the formatted hostname.
\n
\n\n
\n The `format` function combines these values using the specified template to generate a formatted hostname. The resulting hostname will be a string that includes the region, environment, application, type, cluster identifier (with leading zeros if necessary), and the additional identifier provided by `var.id`.
For example, if you have the following values for your variables:\n
\n\n
\n
`var.region` = \"us-west\"
`var.env` = \"prod\"
`var.app` = \"web\"
`var.type` = \"frontend\"
`var.cluster_id` = 42
`var.id` = \"abc123\"
\n
\n\n
\n The `hostname` variable will be computed as follows: \n
\n
us-west-prod-web-frontend-0042-abc123
\n\n
\n This computed hostname can then be used in your Terraform configuration as needed, such as for provisioning cloud resources with this specific hostname format.\n
\n\n
\n The matchkeys Function\n
\n\n
\n matchkeys constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list.
matchkeys identifies the indexes in keyslist that are equal to elements of searchset, and then constructs a new list by taking those same indexes from valueslist. Both valueslist and keyslist must be the same length.
The ordering of the values in valueslist is preserved in the result.\n
\n The `element` function in Terraform is primarily used for accessing elements within a list or an array. It's a versatile function that can be used for various purposes, including:\n
\n\n \n
Retrieving Values: You can use `element` to retrieve specific values from a list or array. For example, you might use it to access the nth element of a list.
Looping and Iteration: When combined with other Terraform constructs like `count` or `for_each`, `element` can be used to iterate over a list or array, applying the same resource configuration or operation to each element.
Dynamic Resource Creation: In Terraform, you can use `element` to dynamically create multiple instances of a resource by specifying different configurations for each instance based on the elements of a list or array.
Conditional Behavior: It can be used to conditionally set values or attributes in resources or variables based on the index of an element in a list.
\n \n\n
\n Here's an example of how you might use the `element` function in a Terraform configuration:\n
\n In this example, the `element` function is used to assign a unique name tag to each AWS EC2 instance being created based on the elements of the \"server_names\" list. It demonstrates how `element` can be used for dynamic resource creation and conditional behavior.
Overall, the `element` function is a fundamental tool in Terraform for working with lists and arrays, enabling you to make your configurations more dynamic and flexible.\n
\n\n
\n Test Your Code\n
\n\n
\n
Testing code leads to greater confidence that the code will perform as expected.
Terraform has built-in tools to help test your code before deployment.
Due to Terraform’s usefulness and popularity, there are many tools which expand upon the built-in tools.
\n
\n\n
\n there are a few built-in commands to test your TF code:\n
\n\n \n
terraform fmt
terraform init
terraform validate
terraform plan
\n \n\n
\n Other Testing Tools\n
\n\n
\n
Terratest: A great, comprehensive tool by Gruntwork. This tool does not do unit testing.
Kitchen-Terraform: Spins up, tests, and spins down various Terraform resources.
Terraform-compliance: A simple tool for testing and enforcing Terraform compliance rules.
\n
",
- "author": {
- "name": "Finecloud"
- },
- "tags": [
- "terraform",
- "iac",
- "devops"
- ],
- "date_published": "2023-09-17T14:14:00+02:00",
- "date_modified": "2023-09-18T17:11:41+02:00"
}
]
}
diff --git a/feed.xml b/feed.xml
index 5f262e4..daf6793 100644
--- a/feed.xml
+++ b/feed.xml
@@ -3,12 +3,128 @@
Finecloud
- 2024-08-05T20:11:49+02:00
+ 2024-09-13T22:50:31+02:00Finecloudhttps://www.finecloud.ch
+
+ Automatically update the hidden dependencies in your Dockerfiles
+
+ Finecloud
+
+
+ https://www.finecloud.ch/automatically-update-hidden-dependencies-in-your-dockerfiles.html
+
+
+
+
+
+
+
+
+
+
+ 2024-09-13T17:23:46+02:00
+
+
+
+
+
+ You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date.
+
+
+
+ But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden dependencies)?
+
+
+
+ Atlassian provides a Confluence image. If you want to run this with an Oracle database, you have to inject the Oracle JDBC driver yourself. But how can you ensure that you automatically always will have the most recent OJDBC driver in your Confluence image?
+
+
FROM atlassian/confluence:8.5.15-ubuntu-jdk17
+
+# Download the ojdbc driver
+RUN curl -fSL "https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc10/19.23.0.0/ojdbc10-19.23.0.0.jar" \
+ -o "${CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/lib/ojdbc10.jar"
+
+
+
+
+ First of all, let's extract the semantic version tag from the URL into a separate ARG so that Renovate only needs to bump the version there:
+
+
FROM atlassian/confluence:8.5.15-ubuntu-jdk17
+
+ARG OJDBC_VERSION=19.24.0.0
+
+# Download the ojdbc driver
+RUN curl -fSL "https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc10/${OJDBC_VERSION}/ojdbc10-${OJDBC_VERSION}.jar" \
+ -o "${CONFLUENCE_INSTALL_DIR}/confluence/WEB-INF/lib/ojdbc10.jar"
+
+
+
+ Next, we will add a comment directly above the ARG OJDBC version, which we will later use to tell Renovate what dependency type and package this version tag is about. It's a maven package with the package name "com.oracle.database.jdbc:ojdbc10":
+
+ You could write a custom regex manager in the Renovate config that updates this version tag. But what if you have multiple ARG or ENV version tags in multiple Dockerfiles within the same repo? You Probably don't want to write a regex config for each case.
+
+
+
+ Let's imagine you have something like this in your Dockerfile:
+
+ Now, you could even set up auto merge for these Renovate updates. Make sure you have some merge checks before you enable this. At least you should ensure that the Docker image can still be built before a new Renovate pull request gets auto-merged.
+
Remote state is not the default; you must specify which backend to use and configure it to be used.
Remote state can be used by multiple team members. Terraform will write state data to a remote data store that users with access can use so there aren’t multiple state files.
Remote state uses a backend, which is configured in your configuration’s root module.
Remote state allows you to share output values with other configurations. Those configurations can then consume the exposed outputs in additional configurations.
-
-
-
- Remote State Storage support
-
-
-
-
Terraform Cloud
HashiCorp Consul
Amazon S3
Azure Blob Storage
Google Cloud Storage
Alibaba Cloud OSS
...and more
-
-
-
- Separate Environments
-
-
-
-
It is good practice to separate your Terraform configurations per environment.
Separate environments help with code organization, as well as allowing for better and easier CI and automation integration.
Implementing a one-folder-per-environment pattern lets you copy and paste Terraform code from one folder to another. This, used with variables, allows you to quickly change only what is needed per environment.
-
-
-
-
-
-
-
-
- Use Modules
-
-
-
-
Modules are containers for multiple resources that are used together.
Every Terraform configuration contains at least one module.
Modules can call other modules. This lets you include a module’s resources in a configuration in a concise way.
Modules can be called multiple times, either in the same Terraform configuration or in separate ones. This allows for resource configurations to be packaged and reused.
-
-
-
- Arguments to use with Modules
-
-
-
-
source: This argument is mandatory for all modules.
version: This argument is recommended for modules from a registry.
meta-arguments: Arguments like for_each and count.
input variables: Most other arguments correspond to input variables.
- Since the resources defined in a module are encapsulated, a calling module cannot access their attributes directly. Instead, the child module can declare output values.
-
output "instance_id" {
- description = "ID of the EC2 instance"
- value = aws_instance.app_server.id
-}
-
-output "instance_public_ip" {
- description = "Public IP address of the EC2 instance"
- value = aws_instance.app_server.public_ip
-}
-
-
- to use your module, add this snippet at the end of you existing ec2.tf file:
- —> test-bucket terraform plan -var=‘create_bucket=false’ Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be Persisted to local or remote state storage.
-
-
-
- No changes. Infrastructure is up-to-date.
This means that Terraform did not detect any differences between your configuration and real physical resources that exist. As a result, no actions need to be performed.
-
-
-
- The create_bucket=true Conditional
-
-
-
- output:
-
-
-
- —> test-bucket terraform plan -var=‘create_bucket=true’ Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be Persisted to local or remote state storage.
An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols:
+ create Terraform will perform the following actions:
+ google_storage_bucket.twinkiebucket ...
-
-
-
- Use null_resource
-
-
-
-
The null_resource is useful when you need to do something that is not directly associated with the lifecycle of an actual resource.
Within a null_resource, you can configure provisioners to run scripts to do pretty much whatever you want.
Just like with provisioners, it is a good idea to use null_resource sparingly since it adds to the complexity of your Terraform usage.
Make sure, when you do use it, that you vet the scripts being called thoroughly.
- Actions that are done inside a null_resource are not managed by Terraform. If you decide to call a command to create resources in your null_resource, Terraform will not know about the resource creation, and therefore can’t manage its lifecycle and state.
-
-
-
- you could for example add those lines to your main.tf:
-
- this Terraform code defines a local variable named hostname using the locals block. This variable is computed using the `format` function and a string template. Let's break down the components of this function:
1. `${format(...)}:` This part of the code is using Terraform's interpolation syntax `${...}` to execute the `format` function. The `format` function is used to create formatted strings by substituting values into placeholders within a template string.
2. `"${format("%s-%s-%s-%s-%04d-%s", var.region, var.env, var.app, var.type, var.cluster_id, var.id)}"`: This is the template string used in the `format` function. It consists of several placeholders, each represented by `%s` or `%04d`, which are replaced by the values provided after the template string.
-
-
-
-
`%s`: This is a placeholder for a string value.
`%04d`: This is a placeholder for a decimal integer value, formatted with leading zeros to ensure a total width of 4 characters.
-
-
-
- The values to be substituted into these placeholders come from various Terraform variables:
-
-
-
-
`var.region`: This variable is expected to contain a string representing a region.
`var.env`: This variable is expected to contain a string representing an environment.
`var.app`: This variable is expected to contain a string representing an application name.
`var.type`: This variable is expected to contain a string representing a type.
`var.cluster_id`: This variable is expected to contain a numeric cluster identifier.
`var.id`: This variable is expected to contain a string or value that is used in the formatted hostname.
-
-
-
- The `format` function combines these values using the specified template to generate a formatted hostname. The resulting hostname will be a string that includes the region, environment, application, type, cluster identifier (with leading zeros if necessary), and the additional identifier provided by `var.id`.
For example, if you have the following values for your variables:
-
-
-
-
`var.region` = "us-west"
`var.env` = "prod"
`var.app` = "web"
`var.type` = "frontend"
`var.cluster_id` = 42
`var.id` = "abc123"
-
-
-
- The `hostname` variable will be computed as follows:
-
-
us-west-prod-web-frontend-0042-abc123
-
-
- This computed hostname can then be used in your Terraform configuration as needed, such as for provisioning cloud resources with this specific hostname format.
-
-
-
- The matchkeys Function
-
-
-
- matchkeys constructs a new list by taking a subset of elements from one list whose indexes match the corresponding indexes of values in another list.
matchkeys identifies the indexes in keyslist that are equal to elements of searchset, and then constructs a new list by taking those same indexes from valueslist. Both valueslist and keyslist must be the same length.
The ordering of the values in valueslist is preserved in the result.
-
- The `element` function in Terraform is primarily used for accessing elements within a list or an array. It's a versatile function that can be used for various purposes, including:
-
-
-
-
Retrieving Values: You can use `element` to retrieve specific values from a list or array. For example, you might use it to access the nth element of a list.
Looping and Iteration: When combined with other Terraform constructs like `count` or `for_each`, `element` can be used to iterate over a list or array, applying the same resource configuration or operation to each element.
Dynamic Resource Creation: In Terraform, you can use `element` to dynamically create multiple instances of a resource by specifying different configurations for each instance based on the elements of a list or array.
Conditional Behavior: It can be used to conditionally set values or attributes in resources or variables based on the index of an element in a list.
-
-
-
- Here's an example of how you might use the `element` function in a Terraform configuration:
-
- In this example, the `element` function is used to assign a unique name tag to each AWS EC2 instance being created based on the elements of the "server_names" list. It demonstrates how `element` can be used for dynamic resource creation and conditional behavior.
Overall, the `element` function is a fundamental tool in Terraform for working with lists and arrays, enabling you to make your configurations more dynamic and flexible.
-
-
-
- Test Your Code
-
-
-
-
Testing code leads to greater confidence that the code will perform as expected.
Terraform has built-in tools to help test your code before deployment.
Due to Terraform’s usefulness and popularity, there are many tools which expand upon the built-in tools.
-
-
-
- there are a few built-in commands to test your TF code:
-
-
-
-
terraform fmt
terraform init
terraform validate
terraform plan
-
-
-
- Other Testing Tools
-
-
-
-
Terratest: A great, comprehensive tool by Gruntwork. This tool does not do unit testing.
Kitchen-Terraform: Spins up, tests, and spins down various Terraform resources.
Terraform-compliance: A simple tool for testing and enforcing Terraform compliance rules.
write access for public repositories that are not owned by you or an organization that you are not a member of
✅
❌
Outside collaborators can access organization repositories that they are a collaborator on.
✅
❌
Can be used with all REST API endpoints
✅
❌
Feature release status
stable
beta
Tokens must have an expiration date
❌
✅
Token can inherit all permissions of the User, incl. all repositories within the organizations that the user has access to without any approval/reivew
✅
❌
Token permissions can be defined set on repository level (fine-grained)
❌
✅
Organization owners can prevent token from accessing resources owned by the organization
✅
✅
Organization owners can require approval for each token that can access the organization (e.g. internal Repo) from externally without any other auth requirement
What are PATs? Personal access tokens are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line. Personal access tokens are intended to access GitHub resources on your behalf. To access resources on behalf of an organization,…
What is a Codespace? A codespace is a development environment that's hosted in the cloud. You can customize your project for GitHub Codespaces by committing configuration files to your repository (also known as configuration-as-code), which creates a repeatable codespace configuration for all users of your…
awk and sed are text manipulation programs. You can use them for example to replace strings: echo image.jpg | sed 's/\.jpg/.png/' image.png or change order of strings: echo "hello world" | awk '{print $2, $1}' world hello awk and sed are harder to learn than…
This Blog post is my personal summary of Googles code review process Make sure to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do. Look at…
You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date. But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden…
What are PATs? Personal access tokens are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line. Personal access tokens are intended to access GitHub resources on your behalf. To access resources on behalf of an organization,…
What is a Codespace? A codespace is a development environment that's hosted in the cloud. You can customize your project for GitHub Codespaces by committing configuration files to your repository (also known as configuration-as-code), which creates a repeatable codespace configuration for all users of your…
awk and sed are text manipulation programs. You can use them for example to replace strings: echo image.jpg | sed 's/\.jpg/.png/' image.png or change order of strings: echo "hello world" | awk '{print $2, $1}' world hello awk and sed are harder to learn than…
Obwohl Proxmox selbst ja sehr gute Monitoring Informationen direkt auf dem eigenen WebUI anzeigt werde ich um Grafana und Prometheus besser kennen zu lernen diese Tools nutzen um meinen Proxmox Host zu überwachen. Mit der Open-Source-Software von Grafana kann man Metriken, Protokolle und Ablaufverfolgungen, visualisieren,…
Capture Groups Im letzten Post haben wir einen kleinen Einstieg in Regex mit Java gemacht. Nun sehen wir uns an, wie man Regex Pattern in Java mittels Capture Groups anwenden kann: String regex = "(1[-.\\s])?(\\d{3}[-.\\s]?)(\\d{3}[-.\\s]?)\\d{4}"; String phoneNumber = "12.523.231.4234"; Pattern pat = Pattern.compile(regex); Matcher mat =…
Was ist Regex? Regex steht für Regular expressions und ist eine Technik, Technologie und Sprache an und für sich, die verwendet werden kann zum Ausdrücken von Textmustern mit Symbolen. Und diese Symbole sind selbst Text. Damit lassen wir verschiedene Textteile und Zeichen andere Textfolgen darstellen. In…
Sobald ein Feld sichtbar ist, bedeutet das auch, das es gelesen und beschrieben werden kann. Die Access-Modifier steuern, von wo auf Felder und Methoden eines Objekts zugegriffen werden kann: Modifier Wer darf zugreifen? public Auf public-Objekte/Felder und Methoden darf ohne Einschränkungen von überall aus zugegriffen…
In diesem Blog fasse ich die Java Namenskonventionen kurz zusammen: Typ Namenskonvention Beispiele Class Sollte mit Grossbuchstaben beginnen und sollte ein Substantiv wie Farbe, Knopf, System, Faden usw. sein. Verwenden Sie geeignete Wörter anstelle von Akronymen. public class Employee { //code snippet } Interface Sollte…
Dieser Beitrag ist meine Zusammenfassung (in meinem eigenen Interesse) des ursprünglichen Beitrags in voller Länge: https://leebriggs.co.uk/blog/2022/07/20/nobody-knows-what-declarative-is Immer wieder stösst man im Bereich Infrastructure as Code (IaC) auf die Begriffe imperativ und deklarativ. Doch was bedeuten diese Begriffe? Ist Terraform wirklich deklarativ und Ansible nicht? Diese…
Obwohl Proxmox selbst ja sehr gute Monitoring Informationen direkt auf dem eigenen WebUI anzeigt werde ich um Grafana und Prometheus besser kennen zu lernen diese Tools nutzen um meinen Proxmox Host zu überwachen. Mit der Open-Source-Software von Grafana kann man Metriken, Protokolle und Ablaufverfolgungen, visualisieren,…
Capture Groups Im letzten Post haben wir einen kleinen Einstieg in Regex mit Java gemacht. Nun sehen wir uns an, wie man Regex Pattern in Java mittels Capture Groups anwenden kann: String regex = "(1[-.\\s])?(\\d{3}[-.\\s]?)(\\d{3}[-.\\s]?)\\d{4}"; String phoneNumber = "12.523.231.4234"; Pattern pat = Pattern.compile(regex); Matcher mat =…
Was ist Regex? Regex steht für Regular expressions und ist eine Technik, Technologie und Sprache an und für sich, die verwendet werden kann zum Ausdrücken von Textmustern mit Symbolen. Und diese Symbole sind selbst Text. Damit lassen wir verschiedene Textteile und Zeichen andere Textfolgen darstellen. In…
Sobald ein Feld sichtbar ist, bedeutet das auch, das es gelesen und beschrieben werden kann. Die Access-Modifier steuern, von wo auf Felder und Methoden eines Objekts zugegriffen werden kann: Modifier Wer darf zugreifen? public Auf public-Objekte/Felder und Methoden darf ohne Einschränkungen von überall aus zugegriffen…
LXC LXC ist ein Userspace Interface zur Eindämmung des Linux-Kernels und kann verwendet werden für Systemvirtualisierung. Durch eine mächtige API und einfache Tools ermöglicht es Linux Benutzern einfache Erstellung und Verwaltung von System Container. LXC ermöglicht ein komplettes OS in einem Container zu betreiben. LXD…
Beschreibung Citrix ADC, bis vor einer Weile noch als Citrix NetScaler bekannt ist eine Netzwerk Appliance welche als Access Gateway und Proxy verwendet werden kann. In diesem Artikel werden wir ein kleines Ansible Playbook schreiben, mit welchem man einen Citrix ADC sichern kann. Als erster…
Woher lädt Java eigentlich seine JDK Klassen? Beim Start einer Applikation kann mit -cp ein Klassenpfad angegeben werden, in welchem sich Klassen befinden, die man verwenden möchte. Das ist das normale Vorgehen, wie man Klassen integriert. Doch woher hat das JDK seine eigenen Klassen? Um…
Einführung JavaFX ist das modernste in der Java SE integrierte GUI-Framework zum Erstellen grafischer Benutzeroberflächen (GUI: Graphical User Interface). JavaFX ist eine reine Java-Bibliothek, die zwar, auch deklarative Definitionen von GUIs über XML ermöglicht, die aber im Kern aus Java-Klassen besteht. Seit Java 8 liegt…
Dieser Post wurde aus dem Original (https://datastrophic.io/kubernetes-homelab-with-proxmox-kubeadm-calico-openebs-and-metallb/)auf Deutsch übersetzt und leicht angepasst. Nachdem wir im ersten Teil mit Terraform die VMs für unseren K8s Cluster deployed haben, werden wir nun mit Ansible die folgenden K8s Komponenten in den worker Nodes und dem Controller installieren: Die…
In diesem Blog fasse ich die Java Namenskonventionen kurz zusammen: Typ Namenskonvention Beispiele Class Sollte mit Grossbuchstaben beginnen und sollte ein Substantiv wie Farbe, Knopf, System, Faden usw. sein. Verwenden Sie geeignete Wörter anstelle von Akronymen. public class Employee { //code snippet } Interface Sollte…
LXC LXC ist ein Userspace Interface zur Eindämmung des Linux-Kernels und kann verwendet werden für Systemvirtualisierung. Durch eine mächtige API und einfache Tools ermöglicht es Linux Benutzern einfache Erstellung und Verwaltung von System Container. LXC ermöglicht ein komplettes OS in einem Container zu betreiben. LXD…
Beschreibung Citrix ADC, bis vor einer Weile noch als Citrix NetScaler bekannt ist eine Netzwerk Appliance welche als Access Gateway und Proxy verwendet werden kann. In diesem Artikel werden wir ein kleines Ansible Playbook schreiben, mit welchem man einen Citrix ADC sichern kann. Als erster…
Woher lädt Java eigentlich seine JDK Klassen? Beim Start einer Applikation kann mit -cp ein Klassenpfad angegeben werden, in welchem sich Klassen befinden, die man verwenden möchte. Das ist das normale Vorgehen, wie man Klassen integriert. Doch woher hat das JDK seine eigenen Klassen? Um…
Einführung JavaFX ist das modernste in der Java SE integrierte GUI-Framework zum Erstellen grafischer Benutzeroberflächen (GUI: Graphical User Interface). JavaFX ist eine reine Java-Bibliothek, die zwar, auch deklarative Definitionen von GUIs über XML ermöglicht, die aber im Kern aus Java-Klassen besteht. Seit Java 8 liegt…
Einleitung In ersten Teil werden wir ein cloud-init Template erstellen, welches wir dann mit Terraform nutzen um die K8S VMs zu erzeugen. Damit wir mit Terraform unsere Kubernetes Nodes deployen können, brauchen wir ein Template. Das kann man entweder bereits mit Ansible machen, sieh dir…
Java kommt von Haus aus mit einer relationalen Open-Source-Datenbank, der Apache-Derby-Datenbank, welche in reinem Java geschrieben ist und sich dadurch nicht nur als eigener Prozess betreiben lässt, sondern auch als Embeded Bestandteil einer Java Anwendung betrieben werden kann. Das ist jedoch für den produktiven Betrieb…
Die erste Ziffer des Status-Codes definiert die Klasse der Response. Die letzten zwei Ziffern haben keine Bedeutung für die Kategorisierung. Es gibt fünf unterschiedliche Response Klassen: Nachfolgend eine Zusammenstellung der häufigsten HTTP-Codes denen man im Alltag begegnet: HTTP-Statuscode Bedeutung 200 OK Der Request wurde ohne…
Was geschieht eigentlich wenn ich eine Webseite aufrufe? Wir überspringen den Ersten Teil mit DNS und gehen davon aus, dass die URL bereits im DNS Cache ist. Um diese Frage zu beantworten, müssen wir uns mit den Grundlagen des HTTP-Protokolls befassen. Der Aufruf der Webseite…
TOC steht für Table of Contents (aka Inhaltsverzeichnis). Jedes grössere README Markdown File in einem git Repo sollte über ein TOC verfügen. Doch die Pflege eines TOC sowie die initiale Erstellung ist nicht sehr handlich, du musst für jeden einzelnen Titel in der richtigen Einrückung…
Dieser Post wurde aus dem Original (https://datastrophic.io/kubernetes-homelab-with-proxmox-kubeadm-calico-openebs-and-metallb/)auf Deutsch übersetzt und leicht angepasst. Nachdem wir im ersten Teil mit Terraform die VMs für unseren K8s Cluster deployed haben, werden wir nun mit Ansible die folgenden K8s Komponenten in den worker Nodes und dem Controller installieren: Die…
Einleitung In ersten Teil werden wir ein cloud-init Template erstellen, welches wir dann mit Terraform nutzen um die K8S VMs zu erzeugen. Damit wir mit Terraform unsere Kubernetes Nodes deployen können, brauchen wir ein Template. Das kann man entweder bereits mit Ansible machen, sieh dir…
Java kommt von Haus aus mit einer relationalen Open-Source-Datenbank, der Apache-Derby-Datenbank, welche in reinem Java geschrieben ist und sich dadurch nicht nur als eigener Prozess betreiben lässt, sondern auch als Embeded Bestandteil einer Java Anwendung betrieben werden kann. Das ist jedoch für den produktiven Betrieb…
Die erste Ziffer des Status-Codes definiert die Klasse der Response. Die letzten zwei Ziffern haben keine Bedeutung für die Kategorisierung. Es gibt fünf unterschiedliche Response Klassen: Nachfolgend eine Zusammenstellung der häufigsten HTTP-Codes denen man im Alltag begegnet: HTTP-Statuscode Bedeutung 200 OK Der Request wurde ohne…
Was geschieht eigentlich wenn ich eine Webseite aufrufe? Wir überspringen den Ersten Teil mit DNS und gehen davon aus, dass die URL bereits im DNS Cache ist. Um diese Frage zu beantworten, müssen wir uns mit den Grundlagen des HTTP-Protokolls befassen. Der Aufruf der Webseite…
In diesem Artikel ist beschrieben, wie man Apache Tomcat direkt in VSCode nutzen kann. Voraussetzung ist, dass du auf deinem Gerät bereits eine Java JRE und Apache Maven installiert hast. Weiter brauchen wir in VSCode das Extension Pack for Java, du kannst dire in VSCode…
Einleitung Das Serverlet-Framework Jakarta EE ermöglicht die Entwicklung von Anwendungen für eine grosse Anzahl paralleler Benutzer die über einen Web-Browser zugreifen. Dazu ist besonders die Serverlet-API von JEE von Interesse. Diese API-Klasse wartet auf eingehende Netzwerkverbindungen und reagiert mit einer entsprechenden Antwort. Für die übertragenen…
A terminal for the modern age Tabby ist ein anpassbares, Platform-Übergreifendes Terminal App für die Arbeit mit Lokalen Shells sowie Serial, SSH und Telnet Verbindungen. Aus diesen Gründen ist Tabby viel praktischer und moderner als Putty: Link zum App: https://tabby.sh/ Link zum Projekt auf GitHub:…
In Java gibt es keinen nennenswerten Unterschied wischen I/O mit Daten und I/O mit Netzwerkverbindungen. In beiden Fällen basiert die Ein- und Ausgabe auf InputStream und OutputStream, der Unterschied liegt nur darin, wo diese Datenströme herkommen. Bei der Netzwerkkommunikation mit dem TCP-Protokoll kommen sie aus…
Systemanforderungen Proxmox gibt folgende minimale Systemanforderungen an: Für produktive Workloads sind diese Anforderungen aber nicht gedacht. Daher sind die empfohlenen Systemanforderungen wie folgt: Da ich meine Proxmox Infrastruktur zum Start nur als Standalone LAB installieren will und für mein kleines Budget maximal viel Leistung erhalten…
TOC steht für Table of Contents (aka Inhaltsverzeichnis). Jedes grössere README Markdown File in einem git Repo sollte über ein TOC verfügen. Doch die Pflege eines TOC sowie die initiale Erstellung ist nicht sehr handlich, du musst für jeden einzelnen Titel in der richtigen Einrückung…
In diesem Artikel ist beschrieben, wie man Apache Tomcat direkt in VSCode nutzen kann. Voraussetzung ist, dass du auf deinem Gerät bereits eine Java JRE und Apache Maven installiert hast. Weiter brauchen wir in VSCode das Extension Pack for Java, du kannst dire in VSCode…
Einleitung Das Serverlet-Framework Jakarta EE ermöglicht die Entwicklung von Anwendungen für eine grosse Anzahl paralleler Benutzer die über einen Web-Browser zugreifen. Dazu ist besonders die Serverlet-API von JEE von Interesse. Diese API-Klasse wartet auf eingehende Netzwerkverbindungen und reagiert mit einer entsprechenden Antwort. Für die übertragenen…
A terminal for the modern age Tabby ist ein anpassbares, Platform-Übergreifendes Terminal App für die Arbeit mit Lokalen Shells sowie Serial, SSH und Telnet Verbindungen. Aus diesen Gründen ist Tabby viel praktischer und moderner als Putty: Link zum App: https://tabby.sh/ Link zum Projekt auf GitHub:…
In Java gibt es keinen nennenswerten Unterschied wischen I/O mit Daten und I/O mit Netzwerkverbindungen. In beiden Fällen basiert die Ein- und Ausgabe auf InputStream und OutputStream, der Unterschied liegt nur darin, wo diese Datenströme herkommen. Bei der Netzwerkkommunikation mit dem TCP-Protokoll kommen sie aus…
Die Architektur Proxmox VE ist eine Plattform zum Betrieben von virtuellen Maschinen und Container. Dabei ist die gesamte Proxmox VE Plattform open source und baisert auf Debian Linux. die VE Plattform besteht aus zwei virtualisierungs-technologien: Proxmox gibt es als single node, oder als Cluster mit…
Dateioperationen mit java.io werden in Java immer, direkt oder indirekt, durch ein Objekt des Typs java.io.File abgebildet. Dabei kann File aber nicht selbst aus Dateien lesen, oder in sie schreiben, dazu benötigt man einen Reader oder Writer (für Textdateien) resp. einen InputStream oder OutputStream (für…
Eine Methode kann einen typisierten Parameter erzwingen und einen typisierten Wert zurückgeben: public List<Integer> parseAlleInts(List<String> strings){ List<Integer> ergebnis = new ArrayList<>(); for (String s : strings){ ergebnis.add(Integer.parseInt(s)); } return ergebnis; } So ist es möglich eine Liste von Strings als Paramter in eine Liste von…
Diese Collection Methode kann dazu verwendet werden, über alle Werte einer Collection zu iterieren: die Methode iterator, gibt ein Objekt vom Typ Iterator zurück. Mit der Methode hasNext wird geprüft, ob es noch ein weiteres Element in der Collection gibt, next gibt das nächste Element…
Sets eignen sich für die Bearbeitung einer mathematischen Menge. Set kann somit keine identische Elemente enthalten und kann keine interneReihenfolge haben. Deshalb gibt es für Set auch keine Methoden die den direkten Zugriff auf ein Element ermöglichen. Um auf ein Element eines Set zuzugreifen muss…
Systemanforderungen Proxmox gibt folgende minimale Systemanforderungen an: Für produktive Workloads sind diese Anforderungen aber nicht gedacht. Daher sind die empfohlenen Systemanforderungen wie folgt: Da ich meine Proxmox Infrastruktur zum Start nur als Standalone LAB installieren will und für mein kleines Budget maximal viel Leistung erhalten…
Die Architektur Proxmox VE ist eine Plattform zum Betrieben von virtuellen Maschinen und Container. Dabei ist die gesamte Proxmox VE Plattform open source und baisert auf Debian Linux. die VE Plattform besteht aus zwei virtualisierungs-technologien: Proxmox gibt es als single node, oder als Cluster mit…
Dateioperationen mit java.io werden in Java immer, direkt oder indirekt, durch ein Objekt des Typs java.io.File abgebildet. Dabei kann File aber nicht selbst aus Dateien lesen, oder in sie schreiben, dazu benötigt man einen Reader oder Writer (für Textdateien) resp. einen InputStream oder OutputStream (für…
Eine Methode kann einen typisierten Parameter erzwingen und einen typisierten Wert zurückgeben: public List<Integer> parseAlleInts(List<String> strings){ List<Integer> ergebnis = new ArrayList<>(); for (String s : strings){ ergebnis.add(Integer.parseInt(s)); } return ergebnis; } So ist es möglich eine Liste von Strings als Paramter in eine Liste von…
Diese Collection Methode kann dazu verwendet werden, über alle Werte einer Collection zu iterieren: die Methode iterator, gibt ein Objekt vom Typ Iterator zurück. Mit der Methode hasNext wird geprüft, ob es noch ein weiteres Element in der Collection gibt, next gibt das nächste Element…
Listen sind Collections, die am ehesten einem Array entsprechen. Die Elemente bleiben in der Reihenfolge wie sie hinzugefügt werden und sie können auf einzelne Positionen im Index der Liste zugreifen: lesen mit get(index) und schreiben mit set(index, element). Damit ist mit Listen alles möglich, was…
Collections sind ganz alltägliche Java Objekte. Im Gegensatz zu Arrays sind Collections nicht durch native Methoden und einem zusammenhängenden Speicherbereich optimiert, sie haben auch keine eigene Syntax. Die Vorteile von Collections sind der Benutzerkomfort, da sie über eine umfangreichere und komfortablere API verfügen. Zudem können…
Varargs, auch Parameter-Listen genannt können in Java Arrays verwendet werden, um eine dynamische Anzahl von Parametern entgegenzunehmen. public static int max(int… numbers){ int result = Integer.MIN_VALUE; for (int number : numbers){ if (number > result){ result = number; } } return result; } Diese Methode…
Die for-each Schleife ist speziell für Arrays und Collections gedacht, denn diese Schleife enthält keine Zählvariable, enthält aber nacheinander alle Einträge des Arrays oder der Collection. Buch[] buecher = …; for (Buch buch : buecher){ System.out.println(buch.getTitel()); } Dabei wird in den Klammern der Schleife eine…
Vaultwarden ist eine alternative Implementation der Bitwarden Server API entwickelt in Rust, kompatibel mit allen Bitwarden clients. Vaultwarden eignet sich daher perfekt für self-hosted deployments, oder überall dort wo der offizielle Bitwarden Service nicht ideal geeignet ist. Dazu gibt es einmal das Vaultwarden Docker Image…
Sets eignen sich für die Bearbeitung einer mathematischen Menge. Set kann somit keine identische Elemente enthalten und kann keine interneReihenfolge haben. Deshalb gibt es für Set auch keine Methoden die den direkten Zugriff auf ein Element ermöglichen. Um auf ein Element eines Set zuzugreifen muss…
Listen sind Collections, die am ehesten einem Array entsprechen. Die Elemente bleiben in der Reihenfolge wie sie hinzugefügt werden und sie können auf einzelne Positionen im Index der Liste zugreifen: lesen mit get(index) und schreiben mit set(index, element). Damit ist mit Listen alles möglich, was…
Collections sind ganz alltägliche Java Objekte. Im Gegensatz zu Arrays sind Collections nicht durch native Methoden und einem zusammenhängenden Speicherbereich optimiert, sie haben auch keine eigene Syntax. Die Vorteile von Collections sind der Benutzerkomfort, da sie über eine umfangreichere und komfortablere API verfügen. Zudem können…
Varargs, auch Parameter-Listen genannt können in Java Arrays verwendet werden, um eine dynamische Anzahl von Parametern entgegenzunehmen. public static int max(int… numbers){ int result = Integer.MIN_VALUE; for (int number : numbers){ if (number > result){ result = number; } } return result; } Diese Methode…
Die for-each Schleife ist speziell für Arrays und Collections gedacht, denn diese Schleife enthält keine Zählvariable, enthält aber nacheinander alle Einträge des Arrays oder der Collection. Buch[] buecher = …; for (Buch buch : buecher){ System.out.println(buch.getTitel()); } Dabei wird in den Klammern der Schleife eine…
Eindimensionales Array Nebst den eindimensionalen Java Arrays gibt es auch mehrdimensionale Arrays. Hier ein Beispiel eines eindimensionalen Java Arrays: int[] zahlen = new int[]{1, 2, 3, 4}; Ein mehrdimensionales Array könnte beispielsweise ein Schachfeld sein: Schachfigur[][] schachbrett = new Schachfigur[8][8]; Mehrdimensionale Arrays sind nicht auf…
Vaultwarden ist eine alternative Implementation der Bitwarden Server API entwickelt in Rust, kompatibel mit allen Bitwarden clients. Vaultwarden eignet sich daher perfekt für self-hosted deployments, oder überall dort wo der offizielle Bitwarden Service nicht ideal geeignet ist. Dazu gibt es einmal das Vaultwarden Docker Image…
Eindimensionales Array Nebst den eindimensionalen Java Arrays gibt es auch mehrdimensionale Arrays. Hier ein Beispiel eines eindimensionalen Java Arrays: int[] zahlen = new int[]{1, 2, 3, 4}; Ein mehrdimensionales Array könnte beispielsweise ein Schachfeld sein: Schachfigur[][] schachbrett = new Schachfigur[8][8]; Mehrdimensionale Arrays sind nicht auf…
Let's build a GraphQL Spring Application that will accept GraphQL requests at http://localhost:8080/graphql. First let's navigate to https://start.spring.io. This service pulls in all the dependencies you need for an application and does most of the setup for you. GraphQL is a query language to retrieve…
Lets Suppose you need to perform a certain kind of work in all of these directories: You might know about the "cd" command. But isn't it annoying if you need to use and retype a lot of Commands, like for example: $ cd ~/Work/Projects/Web/src $…
This Post is a summary of the famous Article about Microservices: https://martinfowler.com/articles/microservices.html The text discusses the concept of "Microservice Architecture," which is an approach to designing software applications as a suite of independently deployable services. It highlights that there is no precise definition but outlines…
What is it about? We define an API contract as a formal agreement between a software provider and a consumer that abstractly communicates how to interact with each other. This contract defines how API providers and consumers interact, what data exchanges looks like, and how…
module "zland" { source = "git::ssh//git@gitlab.com/zland/module.git" version = "1.0.5" servers = 3 } Module Output Values resource "aws_instance" "appserver" { #... instance = module.servers.instance_ids } Since the resources defined in a module are encapsulated, a calling module cannot access their attributes directly. Instead, the child…
This Blog post is my personal summary of Googles code review process Make sure to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do. Look at…
Let's build a GraphQL Spring Application that will accept GraphQL requests at http://localhost:8080/graphql. First let's navigate to https://start.spring.io. This service pulls in all the dependencies you need for an application and does most of the setup for you. GraphQL is a query language to retrieve…
Lets Suppose you need to perform a certain kind of work in all of these directories: You might know about the "cd" command. But isn't it annoying if you need to use and retype a lot of Commands, like for example: $ cd ~/Work/Projects/Web/src $…
This Post is a summary of the famous Article about Microservices: https://martinfowler.com/articles/microservices.html The text discusses the concept of "Microservice Architecture," which is an approach to designing software applications as a suite of independently deployable services. It highlights that there is no precise definition but outlines…
What is it about? We define an API contract as a formal agreement between a software provider and a consumer that abstractly communicates how to interact with each other. This contract defines how API providers and consumers interact, what data exchanges looks like, and how…
Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…
Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…
What is Validation? Validation is a process of making assertions against data to ensure data integrity Is a value required? How long is a phone number? Is it a good date? What is the maximum length of a string? Some refer to data validation as…
Data Transfer Objects DTOs - Data Transfer Objects DTOs are simple Java POJOs DTOs are data structures, generally should NOT have behavior DTOs are objects used to transfer data between producers and consumers Controller models are typically DTOs Why Not Entities? Database Entities are also…
HTTP Status Codes 100 Series - Informational Responses • 200 Series - Successful Responses 300 Series - Redirection Responses 400 Series - Client Error Responses 500 Series - Server Error Responses Use of HTTP Status Codes 200 Series are used when the request completes as…
module "zland" { source = "git::ssh//git@gitlab.com/zland/module.git" version = "1.0.5" servers = 3 } Module Output Values resource "aws_instance" "appserver" { #... instance = module.servers.instance_ids } Since the resources defined in a module are encapsulated, a calling module cannot access their attributes directly. Instead, the child…
Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…
Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…
What is Validation? Validation is a process of making assertions against data to ensure data integrity Is a value required? How long is a phone number? Is it a good date? What is the maximum length of a string? Some refer to data validation as…
Data Transfer Objects DTOs - Data Transfer Objects DTOs are simple Java POJOs DTOs are data structures, generally should NOT have behavior DTOs are objects used to transfer data between producers and consumers Controller models are typically DTOs Why Not Entities? Database Entities are also…
Why use Spring MockMVC? Spring MockMVC allows you to test the controller interactions in a servlet context without the application running in an application server. Mockito is the most popular mocking framework for testing Java Mocks (aka Test Doubles) are alternate implementations of objects to…
Intro Project Lombok is a Java library that provides a set of annotations and utility classes that help to reduce boilerplate code in Java projects. It offers features such as automatic generation of getters, setters, equals, hashCode, toString, and constructors, as well as support for…
Part 1 Of course, instantiating the class will come first. The class will populate properties after it has been created. It will therefore set up any properties you may have. Then, if they exist, we do have some interfaces that we can implement. These methods…
If you want to develop a Spring Application you need to know when to use which Annotation. Spring’s dependency injection capability includes the following annotations:
What are Conventional commits Conventional Commits is a convention for writing commit messages that provides structure and consistency to a project's version control history. It's based on the idea of defining a standard format for commit messages that makes it easier for developers to understand…
HTTP Status Codes 100 Series - Informational Responses • 200 Series - Successful Responses 300 Series - Redirection Responses 400 Series - Client Error Responses 500 Series - Server Error Responses Use of HTTP Status Codes 200 Series are used when the request completes as…
Why use Spring MockMVC? Spring MockMVC allows you to test the controller interactions in a servlet context without the application running in an application server. Mockito is the most popular mocking framework for testing Java Mocks (aka Test Doubles) are alternate implementations of objects to…
Intro Project Lombok is a Java library that provides a set of annotations and utility classes that help to reduce boilerplate code in Java projects. It offers features such as automatic generation of getters, setters, equals, hashCode, toString, and constructors, as well as support for…
Part 1 Of course, instantiating the class will come first. The class will populate properties after it has been created. It will therefore set up any properties you may have. Then, if they exist, we do have some interfaces that we can implement. These methods…
If you want to develop a Spring Application you need to know when to use which Annotation. Spring’s dependency injection capability includes the following annotations:
Summary of 'Clean code' by Robert C. Martin: https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29 Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility…
New Features New versions of JavaScript, such as ES6, ES2016, 2017, etc., come with many new features, however it is still ECMAScript Many of the new features are syntactic sugar or extend the functionality only marginal Template Literals Template literals are string literals with support…
The DOM Based on the received HTML document the browser builds up a model of the document structure, the Document Object Model (DOM) The DOM has a tree structure and each node of the document is represented by an object The browser renders the page…
Object An object is a collection of properties A property has a name and a value An object can be seen as associative array (map) where the keys in the array are the names of the object’s properties // Create object as literal const bob…
In this Post I try to explain the difference between the heap and the stack. It's just a very high level amateur explanation, there is a lot more to read and learn about this Topics. This Drawing helps me a lot to understand the basic…
What are Conventional commits Conventional Commits is a convention for writing commit messages that provides structure and consistency to a project's version control history. It's based on the idea of defining a standard format for commit messages that makes it easier for developers to understand…
Summary of 'Clean code' by Robert C. Martin: https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29 Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility…
New Features New versions of JavaScript, such as ES6, ES2016, 2017, etc., come with many new features, however it is still ECMAScript Many of the new features are syntactic sugar or extend the functionality only marginal Template Literals Template literals are string literals with support…
The DOM Based on the received HTML document the browser builds up a model of the document structure, the Document Object Model (DOM) The DOM has a tree structure and each node of the document is represented by an object The browser renders the page…
Object An object is a collection of properties A property has a name and a value An object can be seen as associative array (map) where the keys in the array are the names of the object’s properties // Create object as literal const bob…
Array An array combines multiple values in a single variable Arrays are helpful if the number of values is huge or dynamic Each value of an array has a unique numerical index // Normal variables hold exactly one value const colorA = "blue"; const colorB…
Function Expression A function expression starts with the keyword function followed by the function arguments in parentheses and the function body in curly braces: const square = function(x) { return x * x; }; console.log(square(4)); // >> 16 Function Scope Each function defines a scope…
What JavaScript is A scripting language originally designed for web browsers Object-oriented, however prototype-based and not class-based Supporting first-class functions A multi-paradigm language, supports imperative, object-oriented and functional programming style Untyped Moving from an interpreted language to just-in-time compilation Nowadays used for server-side programming too…
Requirements and Preparation Unfortunately Heroku currently only Supports Tomcat version 9.x. As a consequence you're not able to use the Java Jakarta Servlets, since they are only supported with Tomcat version 10.x. As a consequence you need to replace all your Jakarta Servlet imports with…
Did you know that your ssh Client sends the server all your public keys, one by one, until the server accepts one, when you try to authenticate via public key? Don't believe me? Try it out yourself: ssh whoami.filippo.io Someone could use this to find…
In this Post I try to explain the difference between the heap and the stack. It's just a very high level amateur explanation, there is a lot more to read and learn about this Topics. This Drawing helps me a lot to understand the basic…
Array An array combines multiple values in a single variable Arrays are helpful if the number of values is huge or dynamic Each value of an array has a unique numerical index // Normal variables hold exactly one value const colorA = "blue"; const colorB…
Function Expression A function expression starts with the keyword function followed by the function arguments in parentheses and the function body in curly braces: const square = function(x) { return x * x; }; console.log(square(4)); // >> 16 Function Scope Each function defines a scope…
What JavaScript is A scripting language originally designed for web browsers Object-oriented, however prototype-based and not class-based Supporting first-class functions A multi-paradigm language, supports imperative, object-oriented and functional programming style Untyped Moving from an interpreted language to just-in-time compilation Nowadays used for server-side programming too…
Requirements and Preparation Unfortunately Heroku currently only Supports Tomcat version 9.x. As a consequence you're not able to use the Java Jakarta Servlets, since they are only supported with Tomcat version 10.x. As a consequence you need to replace all your Jakarta Servlet imports with…
What is OPNsense? OPNsense® is an open source, easy-to-use and easy-to-build FreeBSD based firewall and routing platform. OPNsense includes most of the features available in expensive commercial firewalls, and more in many cases. It brings the rich feature set of commercial offerings with the benefits…
What is Maven? Declarative build management tool for automated builds Standardized directory structure Declarative dependency management Works with an XML control file (POM - Project Object Model) Open source, written in Java, for Java projects Pure command line tool IDEs offer integration Why Maven? Uniform…
Did you know that Threema allows you, to backup your Threema app to a custom Threema Safe server? You can for example use your Nextcloud to keep your Threema backups safe. I recommend to create a new Nextcloud user account only for the purpose of…
The Issue There is nothing worse than presenting a Java Stacktrace in a WebUI, full of technical Details about your Server environment of the Web App itself: So how can we avoid this? You don't want to share this informations with the users, it would…
What is the Spring Framework Spring is the world's most popular Java framework and makes programming Java quicker, easier, and safer for everybody. Spring’s focus on speed, simplicity, and productivity. You can select and generate your Spring Package online: https://start.spring.io/ Lets make a Gradle Project,…
Did you know that your ssh Client sends the server all your public keys, one by one, until the server accepts one, when you try to authenticate via public key? Don't believe me? Try it out yourself: ssh whoami.filippo.io Someone could use this to find…
What is OPNsense? OPNsense® is an open source, easy-to-use and easy-to-build FreeBSD based firewall and routing platform. OPNsense includes most of the features available in expensive commercial firewalls, and more in many cases. It brings the rich feature set of commercial offerings with the benefits…
What is Maven? Declarative build management tool for automated builds Standardized directory structure Declarative dependency management Works with an XML control file (POM - Project Object Model) Open source, written in Java, for Java projects Pure command line tool IDEs offer integration Why Maven? Uniform…
Did you know that Threema allows you, to backup your Threema app to a custom Threema Safe server? You can for example use your Nextcloud to keep your Threema backups safe. I recommend to create a new Nextcloud user account only for the purpose of…
The Issue There is nothing worse than presenting a Java Stacktrace in a WebUI, full of technical Details about your Server environment of the Web App itself: So how can we avoid this? You don't want to share this informations with the users, it would…
Introduction Let's imagine we have two Tables now, people and addresses. We want to find out how many people live at the same address. This is our current Java and SQL approach: repository/PeopleRepository.java @Override @SQL(value = FIND_BY_ID_SQL, operationType = CrudOperation.FIND_BY_ID) @SQL(value = FIND_ALL_SQL, operationType =…
Introduction In this Post I will describe how you can easily learn, test and play around with Java interacting with SQL Databases. This post is a summary of my Java learning course I'm taking on udemy. The post is not intended to be spread around…
Summary This post is my summary (for my own sake) of the original full length post: https://www.justingarrison.com/blog/2022-06-01-infrastructure-as-software/ Writing your infrastructure in a DSL or any other general purpose coding language like Ansible, Pulumi, Terraform is not Infrastructure as Software. Any managed service to deploy infrastructure…
Local date Now Let's start with the basics, we just want to represent the date today and print that local date now: public class TimeTest { public static void main(String[] args) { LocalDate now = LocalDate.now(); System.out.println(now); } } output: 2022-08-29 Process finished with exit…
What are Optionals? For the the number one use case for them has to do with null values. So whenever we're dealing with objects in Java, we store references to objects in variables. And those variables may or may not actually be pointing back to…
What is the Spring Framework Spring is the world's most popular Java framework and makes programming Java quicker, easier, and safer for everybody. Spring’s focus on speed, simplicity, and productivity. You can select and generate your Spring Package online: https://start.spring.io/ Lets make a Gradle Project,…
Introduction Let's imagine we have two Tables now, people and addresses. We want to find out how many people live at the same address. This is our current Java and SQL approach: repository/PeopleRepository.java @Override @SQL(value = FIND_BY_ID_SQL, operationType = CrudOperation.FIND_BY_ID) @SQL(value = FIND_ALL_SQL, operationType =…
Introduction In this Post I will describe how you can easily learn, test and play around with Java interacting with SQL Databases. This post is a summary of my Java learning course I'm taking on udemy. The post is not intended to be spread around…
Summary This post is my summary (for my own sake) of the original full length post: https://www.justingarrison.com/blog/2022-06-01-infrastructure-as-software/ Writing your infrastructure in a DSL or any other general purpose coding language like Ansible, Pulumi, Terraform is not Infrastructure as Software. Any managed service to deploy infrastructure…
Local date Now Let's start with the basics, we just want to represent the date today and print that local date now: public class TimeTest { public static void main(String[] args) { LocalDate now = LocalDate.now(); System.out.println(now); } } output: 2022-08-29 Process finished with exit…
What are Generics? What if we could write a single sort method that sort the elements in an Integer array, a String array, or an array of any type that supports ordering? Java Generics enable programmers to specify, with a single method declaration, a set…
What are Exceptions? An exception is an event, commonly it is a problem that arises during the execution of a program. When an Exception occurs the normal program is disrupted and the program/Application terminates abnormally, which is not recommended. Unexpected termination of an Application is…
Was ist Strava Strava ist das soziale Netzwerk für Sportler. Du kannst deine Sport Aktivitäten aufzeichnen und diese wird deinem Strava-Feed hinzugefügt - zusammen mit jenen, die deine Freunde und Followers mit dir teilen. Auf diese Weise könnt ihr eure Wettkampf- und Trainingsaktivitäten gegenseitig verfolgen,…
Beschreibung ShellCheck ist ein Tool, das Warnungen und Vorschläge für Bash/Sh-Shell-Skripte liefert. Das Tool kann verwendet werden für statische Code Analyse. Idealerweise wird das Tool in einer CI Pipeline integriert. Hier ein Beispiel einer Github Action Pipeline: name: Shellcheck on: pull_request: push: branches: - main…
Dieser Beitrag ist meine Zusammenfassung (in meinem eigenen Interesse) des ursprünglichen Beitrags in voller Länge: https://leebriggs.co.uk/blog/2022/07/20/nobody-knows-what-declarative-is Immer wieder stösst man im Bereich Infrastructure as Code (IaC) auf die Begriffe imperativ und deklarativ. Doch was bedeuten diese Begriffe? Ist Terraform wirklich deklarativ und Ansible nicht? Diese…
What are Optionals? For the the number one use case for them has to do with null values. So whenever we're dealing with objects in Java, we store references to objects in variables. And those variables may or may not actually be pointing back to…
What are Generics? What if we could write a single sort method that sort the elements in an Integer array, a String array, or an array of any type that supports ordering? Java Generics enable programmers to specify, with a single method declaration, a set…
What are Exceptions? An exception is an event, commonly it is a problem that arises during the execution of a program. When an Exception occurs the normal program is disrupted and the program/Application terminates abnormally, which is not recommended. Unexpected termination of an Application is…
Was ist Strava Strava ist das soziale Netzwerk für Sportler. Du kannst deine Sport Aktivitäten aufzeichnen und diese wird deinem Strava-Feed hinzugefügt - zusammen mit jenen, die deine Freunde und Followers mit dir teilen. Auf diese Weise könnt ihr eure Wettkampf- und Trainingsaktivitäten gegenseitig verfolgen,…
Beschreibung ShellCheck ist ein Tool, das Warnungen und Vorschläge für Bash/Sh-Shell-Skripte liefert. Das Tool kann verwendet werden für statische Code Analyse. Idealerweise wird das Tool in einer CI Pipeline integriert. Hier ein Beispiel einer Github Action Pipeline: name: Shellcheck on: pull_request: push: branches: - main…
awk and sed are text manipulation programs. You can use them for example to replace strings: echo image.jpg | sed 's/\.jpg/.png/' image.png or change order of strings: echo "hello world" | awk '{print $2, $1}' world hello awk and sed are harder to learn than…
Lets Suppose you need to perform a certain kind of work in all of these directories: You might know about the "cd" command. But isn't it annoying if you need to use and retype a lot of Commands, like for example: $ cd ~/Work/Projects/Web/src $…
Did you know that your ssh Client sends the server all your public keys, one by one, until the server accepts one, when you try to authenticate via public key? Don't believe me? Try it out yourself: ssh whoami.filippo.io Someone could use this to find…
Beschreibung ShellCheck ist ein Tool, das Warnungen und Vorschläge für Bash/Sh-Shell-Skripte liefert. Das Tool kann verwendet werden für statische Code Analyse. Idealerweise wird das Tool in einer CI Pipeline integriert. Hier ein Beispiel einer Github Action Pipeline: name: Shellcheck on: pull_request: push: branches: - main…
You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date. But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden…
awk and sed are text manipulation programs. You can use them for example to replace strings: echo image.jpg | sed 's/\.jpg/.png/' image.png or change order of strings: echo "hello world" | awk '{print $2, $1}' world hello awk and sed are harder to learn than…
Lets Suppose you need to perform a certain kind of work in all of these directories: You might know about the "cd" command. But isn't it annoying if you need to use and retype a lot of Commands, like for example: $ cd ~/Work/Projects/Web/src $…
Did you know that your ssh Client sends the server all your public keys, one by one, until the server accepts one, when you try to authenticate via public key? Don't believe me? Try it out yourself: ssh whoami.filippo.io Someone could use this to find…
Beschreibung ShellCheck ist ein Tool, das Warnungen und Vorschläge für Bash/Sh-Shell-Skripte liefert. Das Tool kann verwendet werden für statische Code Analyse. Idealerweise wird das Tool in einer CI Pipeline integriert. Hier ein Beispiel einer Github Action Pipeline: name: Shellcheck on: pull_request: push: branches: - main…
Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…
Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…
Obwohl Proxmox selbst ja sehr gute Monitoring Informationen direkt auf dem eigenen WebUI anzeigt werde ich um Grafana und Prometheus besser kennen zu lernen diese Tools nutzen um meinen Proxmox Host zu überwachen. Mit der Open-Source-Software von Grafana kann man Metriken, Protokolle und Ablaufverfolgungen, visualisieren,…
LXC LXC ist ein Userspace Interface zur Eindämmung des Linux-Kernels und kann verwendet werden für Systemvirtualisierung. Durch eine mächtige API und einfache Tools ermöglicht es Linux Benutzern einfache Erstellung und Verwaltung von System Container. LXC ermöglicht ein komplettes OS in einem Container zu betreiben. LXD…
Dieser Post wurde aus dem Original (https://datastrophic.io/kubernetes-homelab-with-proxmox-kubeadm-calico-openebs-and-metallb/)auf Deutsch übersetzt und leicht angepasst. Nachdem wir im ersten Teil mit Terraform die VMs für unseren K8s Cluster deployed haben, werden wir nun mit Ansible die folgenden K8s Komponenten in den worker Nodes und dem Controller installieren: Die…
You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date. But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden…
Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…
Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…
Obwohl Proxmox selbst ja sehr gute Monitoring Informationen direkt auf dem eigenen WebUI anzeigt werde ich um Grafana und Prometheus besser kennen zu lernen diese Tools nutzen um meinen Proxmox Host zu überwachen. Mit der Open-Source-Software von Grafana kann man Metriken, Protokolle und Ablaufverfolgungen, visualisieren,…
LXC LXC ist ein Userspace Interface zur Eindämmung des Linux-Kernels und kann verwendet werden für Systemvirtualisierung. Durch eine mächtige API und einfache Tools ermöglicht es Linux Benutzern einfache Erstellung und Verwaltung von System Container. LXC ermöglicht ein komplettes OS in einem Container zu betreiben. LXD…
A terminal for the modern age Tabby ist ein anpassbares, Platform-Übergreifendes Terminal App für die Arbeit mit Lokalen Shells sowie Serial, SSH und Telnet Verbindungen. Aus diesen Gründen ist Tabby viel praktischer und moderner als Putty: Link zum App: https://tabby.sh/ Link zum Projekt auf GitHub:…
Systemanforderungen Proxmox gibt folgende minimale Systemanforderungen an: Für produktive Workloads sind diese Anforderungen aber nicht gedacht. Daher sind die empfohlenen Systemanforderungen wie folgt: Da ich meine Proxmox Infrastruktur zum Start nur als Standalone LAB installieren will und für mein kleines Budget maximal viel Leistung erhalten…
Die Architektur Proxmox VE ist eine Plattform zum Betrieben von virtuellen Maschinen und Container. Dabei ist die gesamte Proxmox VE Plattform open source und baisert auf Debian Linux. die VE Plattform besteht aus zwei virtualisierungs-technologien: Proxmox gibt es als single node, oder als Cluster mit…
Dieser Post wurde aus dem Original (https://datastrophic.io/kubernetes-homelab-with-proxmox-kubeadm-calico-openebs-and-metallb/)auf Deutsch übersetzt und leicht angepasst. Nachdem wir im ersten Teil mit Terraform die VMs für unseren K8s Cluster deployed haben, werden wir nun mit Ansible die folgenden K8s Komponenten in den worker Nodes und dem Controller installieren: Die…
A terminal for the modern age Tabby ist ein anpassbares, Platform-Übergreifendes Terminal App für die Arbeit mit Lokalen Shells sowie Serial, SSH und Telnet Verbindungen. Aus diesen Gründen ist Tabby viel praktischer und moderner als Putty: Link zum App: https://tabby.sh/ Link zum Projekt auf GitHub:…
Systemanforderungen Proxmox gibt folgende minimale Systemanforderungen an: Für produktive Workloads sind diese Anforderungen aber nicht gedacht. Daher sind die empfohlenen Systemanforderungen wie folgt: Da ich meine Proxmox Infrastruktur zum Start nur als Standalone LAB installieren will und für mein kleines Budget maximal viel Leistung erhalten…
Die Architektur Proxmox VE ist eine Plattform zum Betrieben von virtuellen Maschinen und Container. Dabei ist die gesamte Proxmox VE Plattform open source und baisert auf Debian Linux. die VE Plattform besteht aus zwei virtualisierungs-technologien: Proxmox gibt es als single node, oder als Cluster mit…
What are PATs? Personal access tokens are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line. Personal access tokens are intended to access GitHub resources on your behalf. To access resources on behalf of an organization,…
This Blog post is my personal summary of Googles code review process Make sure to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do. Look at…
module "zland" { source = "git::ssh//git@gitlab.com/zland/module.git" version = "1.0.5" servers = 3 } Module Output Values resource "aws_instance" "appserver" { #... instance = module.servers.instance_ids } Since the resources defined in a module are encapsulated, a calling module cannot access their attributes directly. Instead, the child…
You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date. But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden…
What are PATs? Personal access tokens are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line. Personal access tokens are intended to access GitHub resources on your behalf. To access resources on behalf of an organization,…
This Blog post is my personal summary of Googles code review process Make sure to review every line of code you’ve been asked to review, look at the context, make sure you’re improving code health, and compliment developers on good things that they do. Look at…
module "zland" { source = "git::ssh//git@gitlab.com/zland/module.git" version = "1.0.5" servers = 3 } Module Output Values resource "aws_instance" "appserver" { #... instance = module.servers.instance_ids } Since the resources defined in a module are encapsulated, a calling module cannot access their attributes directly. Instead, the child…
Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…
Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…
Summary This post is my summary (for my own sake) of the original full length post: https://www.justingarrison.com/blog/2022-06-01-infrastructure-as-software/ Writing your infrastructure in a DSL or any other general purpose coding language like Ansible, Pulumi, Terraform is not Infrastructure as Software. Any managed service to deploy infrastructure…
LXC LXC ist ein Userspace Interface zur Eindämmung des Linux-Kernels und kann verwendet werden für Systemvirtualisierung. Durch eine mächtige API und einfache Tools ermöglicht es Linux Benutzern einfache Erstellung und Verwaltung von System Container. LXC ermöglicht ein komplettes OS in einem Container zu betreiben. LXD…
Vaultwarden ist eine alternative Implementation der Bitwarden Server API entwickelt in Rust, kompatibel mit allen Bitwarden clients. Vaultwarden eignet sich daher perfekt für self-hosted deployments, oder überall dort wo der offizielle Bitwarden Service nicht ideal geeignet ist. Dazu gibt es einmal das Vaultwarden Docker Image…
You have probably already heard about Renovate - the fantastic tool that helps you to keep your dependencies up to date. But today, we want to look at an edge case: how to keep your dependencies in your dependencies up to date (also called hidden…
Enable Kubernetes in Docker Desktop We will use Docker Desktop to provide us a Test Kubernetes Environment. Open Docker Desktop Settings, go to Tab "Kubernetes". Select "Enable Kubernetes", then "Apply & Restart". Now you should be able to see docker-desktop listed, if you run kubectl…
Pre-Requirements Developer Environment ready with Docker, JDK, IDE A Java Spring Boot Project with a h2 in-memory DB Docker Hub account Create Docker File Create a Dockerfile with the following content: FROM openjdk:11-jre-slim ENV JAVA_OPTS " -Xms512m -Xmx512m -Djava.security.egd=file:///dev/./urandom" WORKDIR application COPY target/myapp-0.0.1-SNAPSHOT.jar ./ ENTRYPOINT…
Summary This post is my summary (for my own sake) of the original full length post: https://www.justingarrison.com/blog/2022-06-01-infrastructure-as-software/ Writing your infrastructure in a DSL or any other general purpose coding language like Ansible, Pulumi, Terraform is not Infrastructure as Software. Any managed service to deploy infrastructure…
LXC LXC ist ein Userspace Interface zur Eindämmung des Linux-Kernels und kann verwendet werden für Systemvirtualisierung. Durch eine mächtige API und einfache Tools ermöglicht es Linux Benutzern einfache Erstellung und Verwaltung von System Container. LXC ermöglicht ein komplettes OS in einem Container zu betreiben. LXD…
Vaultwarden ist eine alternative Implementation der Bitwarden Server API entwickelt in Rust, kompatibel mit allen Bitwarden clients. Vaultwarden eignet sich daher perfekt für self-hosted deployments, oder überall dort wo der offizielle Bitwarden Service nicht ideal geeignet ist. Dazu gibt es einmal das Vaultwarden Docker Image…