This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -s -X POST http://localhost:8180/realms/quarkus/protocol/openid-connect/token \ | |
| -d "grant_type=password" \ | |
| -d "client_id=backend-service" \ | |
| -d "client_secret=secret" \ | |
| -d "username=testuser" \ | |
| -d "password=test" | jq .access_token -r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Create File: realm-export.json | |
| { | |
| "realm": "quarkus", | |
| "enabled": true, | |
| "clients": [ | |
| { | |
| "clientId": "backend-service", | |
| "enabled": true, | |
| "clientAuthenticatorType": "client-secret", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| podman run -d \ | |
| --name postgres-quarkus \ | |
| -e POSTGRES_USER=quarkus \ | |
| -e POSTGRES_PASSWORD=quarkus \ | |
| -e POSTGRES_DB=quarkusshop \ | |
| -p 5444:5432 \ | |
| -v pgdata:/var/lib/postgresql/data \ | |
| postgres:17-alpine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: friday | |
| annotations: | |
| author: Francesco Donzello | |
| spec: | |
| selector: | |
| matchLabels: | |
| app: friday |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| labels: | |
| k8s-app: metrics-server | |
| name: metrics-server | |
| namespace: kube-system | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1 | |
| kind: ClusterRole |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core'; | |
| import {UserTypes} from '../../../models/models'; | |
| @Component({ | |
| selector: 'app-my-home', | |
| template: ` | |
| This is visible to Admin, User and Guest. | |
| <app-if-granted [allowedRoles]="[userTypes.Admin, userTypes.User]"> | |
| <!-- This is visible only to Admin and User --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {Component, Input, OnInit} from '@angular/core'; | |
| import {UserTypes} from '../../models/models'; | |
| import {UserService} from '../../api/user.service'; | |
| import {map} from 'rxjs/operators'; | |
| @Component({ | |
| selector: 'app-if-granted', | |
| template: ` | |
| <ng-container *ngIf="isGranted() | async"> | |
| <ng-content></ng-content> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| func main() { | |
| i := 0 | |
| i++ | |
| if i > 0 { | |
| fmt.Println("i greater than 0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| sudo apt update | |
| sudo apt install -y curl docker.io | |
| sudo setfacl --modify user:$(whoami):rw /var/run/docker.sock | |
| curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.6.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ | |
| sudo minikube start --vm-driver=none | |
| alias minikube="sudo minikube" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "users": [ | |
| { | |
| "id": 1, | |
| "firstname": "Alan", | |
| "lastname": "Sorrenti", | |
| "email": "alan@email.me" | |
| } | |
| ], | |
| "news": [ |
NewerOlder