Instalando Docker em um WSL 2 com Ubuntu 22.04
Before start the installation process, make sure you meet the following prerequisites:
- A Windows 10 operating system with WSL 2 support.
- WSL 2 enabled.
- Ubuntu 22.04 installed on WSL 2.
| Questa sotto é una Regex che permette di validare la corretta formattazione dei codici fiscali italiani. | |
| Tiene conto delle omocodie e di tutto il resto conosciuto finora. | |
| La base di partenza é stata presa qui: http://blog.marketto.it/2016/01/regex-validazione-codice-fiscale-con-omocodia/ | |
| quindi tutti i credits vanno all'autore di questo post ma é stata modificata un minimo perché non copriva tutti i casi | |
| ^(?:[A-Z][AEIOUX][AEIOUX]|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}(?:[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[15MR][\dLMNP-V]|[26NS][0-8LMNP-U])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM]|[AC-EHLMPR-T][26NS][9V])|(?:[02468LNQSU][048LQU]|[13579MPRTV][26NS])B[26NS][9V])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[1-9MNP-V][\dLMNP-V]|[0L][1-9MNP-V]))[A-Z]$ |
| /** | |
| * Utility class to read encrypted PEM files and generate a SSL Socket Factory based on the provided certificates. | |
| * This utility also support an option to enable and disable server hostname verification. | |
| * | |
| * Note: Java use jks (Java KeyStore) format, but openssl usual use pem format. We can convert it by keytool (jdk build-in tool), or use | |
| * BouncyCastle library to handle pem. | |
| * | |
| * The original code is by Sharon Asher (link below). I have modified it to use a newer version of the BouncyCastle Library (v1.68) | |
| * Add below dependencies to work with this util. | |
| * org.bouncycastle:bcpkix-jdk15on:1.68 |
| import javafx.scene.paint.Color; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; | |
| import java.io.StringWriter; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.Map; |
| import React, { useState } from "react"; | |
| import axios from 'axios'; | |
| import "./App.css"; | |
| export default function App() { | |
| const [process, setProcess] = useState({}); | |
| const [message, setMessage] = useState({}); | |
| const [listening, setListening] = useState(false); | |
| const statusMessage = { |
| # Install Python 3 | |
| $ sudo apt-get install python3 | |
| # Install python3-virtualenv | |
| $ sudo apt-get install python3-virtualenv | |
| # You can checkout you virtualenv version | |
| $ virtualenv --version | |
| # Create you virtualenv in the folder you that want to |
Generate keys:
KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC");
kpg.initialize(new ECGenParameterSpec("secp521r1"), new SecureRandom());
KeyPair keyPair = kpg.generateKeyPair();
ECPrivateKey privateKey = (ECPrivateKey) keyPair.getPrivate();
ECPublicKey publicKey = (ECPublicKey) keyPair.getPublic();
byte[] privateKeyS = privateKey.getS().toByteArray();
byte[] publicKeyX = publicKey.getW().getAffineX().toByteArray();
byte[] publicKeyY = publicKey.getW().getAffineY().toByteArray();
| package demo.plain; | |
| import org.keycloak.OAuth2Constants; | |
| import org.keycloak.admin.client.CreatedResponseUtil; | |
| import org.keycloak.admin.client.Keycloak; | |
| import org.keycloak.admin.client.KeycloakBuilder; | |
| import org.keycloak.admin.client.resource.RealmResource; | |
| import org.keycloak.admin.client.resource.UserResource; | |
| import org.keycloak.admin.client.resource.UsersResource; | |
| import org.keycloak.representations.idm.ClientRepresentation; |
| # To regenerate the test key and certificates | |
| # Generate an RSA private key and convert it to PKCS8 wraped in PEM | |
| openssl genrsa 2048 | openssl pkcs8 -topk8 -inform pem -outform pem -nocrypt -out rsa.key | |
| # Generate a certificate signing request with the private key | |
| openssl req -new -key rsa.key -out rsa.csr | |
| # Sign request with private key | |
| openssl x509 -req -days 10000 -in rsa.csr -signkey rsa.key -out rsa.crt | |
| // Filename: HttpServer.cs | |
| // Author: Benjamin N. Summerton <define-private-public> | |
| // License: Unlicense (http://unlicense.org/) | |
| using System; | |
| using System.IO; | |
| using System.Text; | |
| using System.Net; | |
| using System.Threading.Tasks; |