Skip to content

Instantly share code, notes, and snippets.

View rafaeltuelho's full-sized avatar
🎯
Focusing

Rafael T. C. Soares (A.K.A Tuelho) rafaeltuelho

🎯
Focusing
  • Red Hat Inc.
  • Frisco, TX, USA
  • 16:10 (UTC -05:00)
View GitHub Profile
- name: Tests playbook
hosts: localhost
gather_facts: no
vars:
num_users: 10
infra_template_object:
- name: infra
autoscale: false
total_replicas: 3
total_replicas_min: 3
@rafaeltuelho
rafaeltuelho / openid_access_token-decode.md
Last active June 12, 2023 23:45
Decoding an encoded oAuth JSON Web Token (JWT): access_token

Given an encoded (base64) JWT (access_token).

For example, see this sample OAuth2 response generated by JBoss APIMan/Keycloak

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: application/json
Date: Tue, 25 Aug 2015 19:25:12 GMT
@rafaeltuelho
rafaeltuelho / hyperfoil-openshift-deployment.yaml
Last active May 2, 2023 19:32
Hyperfoil Openshift deployment Manifests
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Secret
metadata:
name: hyperfoil-auth
data:
password: b3BlbnNoaWZ0
type: Opaque
@rafaeltuelho
rafaeltuelho / ocp-htpasswd-new-users.yml
Created April 19, 2023 23:40
Simple play to add new users to an exisiting htpasswd based provider on Openshift
- name: Add new users playbook
hosts: localhost
gather_facts: false
vars:
users:
- user1
- user2
- user3
- user4
- user5
@rafaeltuelho
rafaeltuelho / rhpam78-authoring-with-cors.yaml
Last active April 19, 2023 15:42
RHPAM 7.8 Operator KieApp Authoring Environment sample with CORS enabled, Postgres, ControllerBasedStartupStrategy
apiVersion: app.kiegroup.org/v2
kind: KieApp
metadata:
name: pam
spec:
# Use this snippet to deploy a prior product version
# version: 7.11.1
# Use this snippet to setup the openshift CA bundle as a truststore
# truststore:
# openshiftCaBundle: true
@rafaeltuelho
rafaeltuelho / oselab_dns_installer.sh
Last active March 22, 2023 13:41
Bash script to configure a DNS Server (Bind) to be used in a OSEv3 environment (RHEL 7.1 >)
#!/bin/bash
guid=`hostname|cut -f2 -d-|cut -f1 -d.`
yum -y install bind bind-utils
systemctl enable named
systemctl stop named
### firewalld was being a bit problematic
### Since we turn it off later anyway, I've skipped this step.
#firewall-cmd --permanent --zone=public --add-service=dns
@rafaeltuelho
rafaeltuelho / rhel7-subs-manager.md
Last active March 20, 2023 16:29
Red Hat Enterprise Linux Subscription Manager util commands
  1. Display a list of all subscriptions that are available for your system
subscription-manager list --available

For each available subscription, this command displays its name, unique identifier, expiration date, and other details related to it. The pool ID is listed on a line beginning with Pool Id

  1. Attach the appropriate subscription to your system by running the following command as root:
subscription-manager subscribe --pool=pool_id
@rafaeltuelho
rafaeltuelho / useful-jboss-cli-cmds.md
Last active March 11, 2023 07:26
Useful JBoss EAP CLI commands and configuration...
  • To restart a specif Managed Server in a Domain
./jboss-cli.sh --connect --controller=10.25.236.195:9999 --user <admin user> --password <admin pwd>

/host=136-slave/server-config=srv-163:start(blocking=true)
/host=136-slave/server-config=srv-163:stop(blocking=true)

./jboss-cli.sh --connect --controller=10.25.236.195:9999 --command='/host=136-slave/server-config=srv-163:stop(blocking=true)'
{
@rafaeltuelho
rafaeltuelho / sample-pipeline.groovy
Last active February 27, 2023 00:56
Sample Jenkins Pipeline for Openshift CI/CD demos
def version, mvnCmd = "mvn -s configuration/cicd-settings-nexus3.xml"
pipeline {
agent {
label 'maven'
}
stages {
stage('Build App') {
steps {
// if your Git server uses an TLS self signed cetificate ...
@rafaeltuelho
rafaeltuelho / artemis-broker-amqp.yaml
Created February 17, 2023 20:33
Artemis Broker for AMQP Custom Resource using artemiscloud.io operator
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: artemis-broker-amqp
spec:
adminUser: admin
adminPassword: $secret$
acceptors:
- name: amqp
expose: true