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
  • 01:01 (UTC -05:00)
View GitHub Profile
@rafaeltuelho
rafaeltuelho / openshift-cheatsheet.md
Last active April 4, 2024 13:03
My Openshift Cheatsheet

My Openshift Cheatsheet

Project Quotes, Limits and Templates

  • Cluster Quota
oc create clusterquota env-qa \
    --project-label-selector environment=qa \
    --hard pods=10,services=5
    
oc create clusterquota user-qa \
@rafaeltuelho
rafaeltuelho / jpa2-criteria-api-sample.md
Last active March 7, 2024 14:29
Just to remember a simple example of JPA 2 Criteria API usage...
  • to perform a simple SELECT * FROM PLANE;
		CriteriaBuilder cb = em.getCriteriaBuilder();
		CriteriaQuery<Plane> criteria = cb.createQuery(Plane.class);
		Root<Plane> plane = criteria.from(Plane.class);
		criteria.select(plane);
		List<Plane> planes = em.createQuery(criteria).getResultList();
@rafaeltuelho
rafaeltuelho / redhat-pam-dm-notes.md
Last active March 2, 2024 02:39
My Red Hat PAM/DM (jBPM/Drools) random notes

Generating new Projects using maven archetypes

jBPM project

Manually create business application In case you can’t use jBPM online service to generate the application you can manually create individual projects. jBPM provides maven archetypes that can be easily used to generate the application. In fact jBPM online service uses these archetypes behind the scenes to generate business application.

  • Business assets project archetype
org.kie:kie-kjar-archetype:7.46.0.Final
  • Service project archetype
@rafaeltuelho
rafaeltuelho / camel-raw-oauth.java
Created January 18, 2017 12:47
camel snippet using oauth to get an auth token and use it to request a secured rest service
from("timer://scheduler?period=30s")
.log("get access token")
.to("direct:authService");
from("direct:authService").tracing()
.setHeader(Exchange.HTTP_PATH)
.simple("<auth service context>/oauth2/token")
.setHeader("CamelHttpMethod")
.simple("POST")
.setHeader("Content-Type")
@rafaeltuelho
rafaeltuelho / rhdh-eap-setup.md
Last active October 11, 2023 15:06
Red Hat Developer Hub (EAP) Setup

Red Hat Developer Hub (Early Access Program) Setup instructions

Openshift Cluster Checklist

@rafaeltuelho
rafaeltuelho / podman-tips.md
Last active September 21, 2023 07:59
Notes to run podman

When on MacOS

  • add a new alias to your shell (bash or zsh) to create a temporary Unix Domain Socket for podman

you need jq installed confirm the path for podman.sock with podman system connection list --format=json

podman-sock='rm -f /tmp/podman.sock && ssh -i ~/.ssh/podman-machine -p $(podman system connection list --format=json | jq ''.[0].URI'' | sed -E ''s|.+://.+@.+:([[:digit:]]+)/.+|\1|'') -L''/tmp/podman.sock:/run/user/501/podman/podman.sock'' -N core@localhost'
  • set the following env vars to configure Test Containers for podman
@rafaeltuelho
rafaeltuelho / argocd-fundamentals-notes.md
Created December 20, 2022 23:32
Notes from Codefresh ArgoCD Fundamentals

Simple Sample App

argocd app create demo \
--project default \
--sync-policy auto \
--repo https://github.com/codefresh-contrib/gitops-certification-examples \
--path ./blue-green-app \
--dest-namespace default \
--dest-server https://kubernetes.default.svc
@rafaeltuelho
rafaeltuelho / devspaces-github-oauth-setup.sh
Last active August 21, 2023 22:09
Openshift DevSapces with Github OAuth integration Script.
#!/bin/bash
#for DevSpaces
#Go to https://github.com/settings/applications/new
#Enter the 'Red Hat DevSpaces Workshop' as the Application Name
#Enter the Homepage URL as 'https://devspaces.apps.YOUR-cluster-domain/'
#Enter the Authorization callback URL as 'https://devspaces.apps.YOUR-cluster-domain/api/oauth/callback'
#Remember to copy the Client Id and the Client Secret values
DEV_SPACES_NAMESPACE='openshift-devspaces'
@rafaeltuelho
rafaeltuelho / checkpoint-snx-vpn-client-fedora25.txt
Last active June 30, 2023 15:19
setup Checkpoint Firewall VPN with SNX on Linux Fedora 25
First you have to ensure the Java JRE is installed on your system.
Remember the java plugin will only work on Firefox. If you prefer to install from fedora/rhel repos:
sudo dnf (yum) install java-1.8.0-openjdk icedtea-web
download the snx script installer from the Checkpoint VPN page:
https://<your company vpn ip addr>/sslvpn/SNX/INSTALL/snx_install.sh
run int as root to install
- 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