Skip to content

Instantly share code, notes, and snippets.

View jesuino's full-sized avatar

William Antônio Siqueira jesuino

View GitHub Profile
@jesuino
jesuino / GroupsCreate.java
Created July 12, 2024 18:07
Generating roles with Keycloak Java client
import static java.lang.System.out;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.representations.idm.GroupRepresentation;
public class GroupsCreate {
private static final String KEYCLOAK_HOST = "http://localhost:8080";
private static final String USERNAME = "wsiqueir";
private static final String PASSWORD = "test";
cat n[wsiqueir@localhost orchestrator]$ cat npms_ls_react
root@3.2.0 /home/wsiqueir/projects/janus/backstage-plugins
├─┬ @janus-idp/backstage-plugin-orchestrator@1.11.0 -> ./plugins/orchestrator
│ ├─┬ @backstage/core-components@0.14.6
│ │ ├─┬ @backstage/theme@0.5.3
│ │ │ ├─┬ @emotion/react@11.11.4
│ │ │ │ ├─┬ @emotion/use-insertion-effect-with-fallbacks@1.0.1
│ │ │ │ │ └── react@18.3.1 deduped invalid: "^16.8.0 || ^17.0.0" from node_modules/@material-ui/core, "^16.8.0 || ^17.0.0" from node_modules/@material-ui/icons, "^16.8.0 || ^17.0.0" from node_modules/@material-ui/lab, "^16.8.0 || ^17.0.0" from node_modules/@material-ui/styles, "^16.8.0 || ^17.0.0" from node_modules/@material-ui/system, "^16.8.0 || ^17.0.0" from node_modules/@material-ui/utils, "^16.8.0 || ^17.0.0" from node_modules/@material-ui/pickers, "^15.0.0 || ^16.0.0 || ^17.0.0" from node_modules/material-ui-popup-state
│ │ │ │ └── react@18.3.1 deduped invalid: "^16.8.0 || ^17.0.0" from node_modules/@material-ui/core, "^16.8.0 || ^17.0.0" from nod
@janus-idp/backstage-plugin-rbac:test: 66 | const deleteButton = screen.getByRole('button', { name: /Delete/i });
@janus-idp/backstage-plugin-rbac:test: 67 | await waitFor(() => {
@janus-idp/backstage-plugin-rbac:test: > 68 | expect(deleteButton).not.toBeDisabled();
@janus-idp/backstage-plugin-rbac:test: | ^
@janus-idp/backstage-plugin-rbac:test: 69 | });
@janus-idp/backstage-plugin-rbac:test: 70 | });
@janus-idp/backstage-plugin-rbac:test: 71 |
@janus-idp/backstage-plugin-rbac:test:
@janus-idp/backstage-plugin-rbac:test: at toBeDisabled (components/RolesList/DeleteRoleDialog.test.tsx:68:32)
@janus-idp/backstage-plugin-rbac:test: at runWithExpensiveErrorDiagnosticsDisabled (../../../node_modules/@testing-library/dom/dist/config.js:47:12)
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: azure-repo-demo
title: Azure Repository Test
description: Clone and push to an Azure repository example.
spec:
owner: parfuemerie-douglas
type: service
catalog:
locations:
- type: url
target: https://gist.githubusercontent.com/jesuino/7241e9dc185997d7fb5ac46a4a4b0faf/raw/09706353b453195ac6a4785fe40d946e0645170c/test-component.yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: test
description: A test
annotations:
'jfrog-artifactory/image-name': 'test-image'
spec:
type: service
lifecycle: experimental
@jesuino
jesuino / metrics
Created February 9, 2024 19:57
Backstage Metrics
# HELP process_cpu_user_seconds_total Total user CPU time spent in seconds.
# TYPE process_cpu_user_seconds_total counter
process_cpu_user_seconds_total 1.102894
# HELP process_cpu_system_seconds_total Total system CPU time spent in seconds.
# TYPE process_cpu_system_seconds_total counter
process_cpu_system_seconds_total 0.401365
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
2023-11-13T20:45:35.590Z backstage info loaded dynamic backend plugin 'roadiehq-scaffolder-backend-module-utils-dynamic' from 'file:///opt/app-root/src/dynamic-plugins-root/roadiehq-scaffolder-backend-module-utils-dynamic'
Backend failed to start up Error: You must configure at least one key in backend.auth.keys for production.
at ServerTokenManager.fromConfig (/opt/app-root/src/node_modules/@backstage/backend-common/dist/index.cjs.js:4038:13)
at makeCreateEnv (/opt/app-root/src/packages/backend/dist/index.cjs.js:536:57)
at main (/opt/app-root/src/packages/backend/dist/index.cjs.js:613:21)
{
"$id": "https://dashbuilder.org/schemas/0.1/dashbuilder.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Schema for Dashboards",
"type": "object",
"properties": {
"pages": {
"description": "A page can contain rows, columns and components.",
"type": "array",
"items": { "$ref": "#/definitions/Page" }
$ oc login --token={TOKEN} --server={SERVER}
Logged into "{SERVER}" as "IAM#wsiqueir@redhat.com" using the token provided.
You have access to 80 projects, the list has been suppressed. You can list all projects with 'oc projects'
Using project "default".
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x41493c]
goroutine 1 [running]: