Skip to content

Instantly share code, notes, and snippets.

View luszczynski's full-sized avatar

Gustavo Luszczynski luszczynski

  • Red Hat
  • Brazil
View GitHub Profile
@luszczynski
luszczynski / openshift-install-minimum.adoc
Last active July 23, 2020 19:27
Openshift 4 installation using minimum resource

Openshift Installation using minimum resource

Fix etcd

oc patch \
   etcd \
   cluster \
   -p='{"spec": {"unsupportedConfigOverrides": {"useUnsupportedUnsafeNonHANonProductionUnstableEtcd": true}}}' \
@luszczynski
luszczynski / stacktrace.md
Last active May 7, 2020 00:37
Get Stacktrace from log

Get Stacktrace from log

cat teste.log | sed -n -e '/ERROR \[/,/\.\.\. [0-9]* more$/ p'
cat teste.log | sed -n -e '/ERROR \[/,/\.\.\. [0-9]* more$/ p' | while read x ; do echo $x ; done
metadata:
name: workspace1
projects:
- name: quarkus-workshop-labs
source:
location: 'https://github.com/RedHatWorkshops/quarkus-workshop-labs'
type: git
branch: master
components:
- id: redhat/java/latest
@luszczynski
luszczynski / keycloak_get_idp_token.md
Last active December 19, 2023 10:32
Keycloak - Get IDP Token using Curl

Keycloak - Get IDP Token

Get Access Token

export TKN=$(curl -X POST 'http://127.0.0.1:8080/auth/realms/your-realm/protocol/openid-connect/token' \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d "username=your-user" \
 -d 'password=your-pass' \
 -d 'grant_type=password' \
@luszczynski
luszczynski / tcp-dump.md
Created August 9, 2019 13:47
TCP Dump Examples

TCP Dump Example

Check TCP Packet Content on Port 80

tcpdump -i eth0 -nn -s 1800 -XXX port 80

Check TCP Syn Packet on Port 80

Config Map

oc create configmap app-config-file --from-file=app-config-file.php=/root/projects/app-config-file.php -n myapp
oc set volumes dc/myapp --add --mount-path=/tmp/configfile --configmap-name=app-config-file --type=configmap -n myapp
@luszczynski
luszczynski / git-cheat-sheet.md
Last active May 11, 2019 17:38
Git Cheat Sheet - Basic Commands for daily use

Git Cheat Sheet

Basics

Working ------ git add -----> Stage Index ------ git commit -----> Repository

  • Git generates a checksum for every change set (commit)
    • Example: 987e06a6d47b724223b40c2ccda229c58fa0b63f

HEAD

SSH Tunnel

ssh -L 12345:127.0.0.1:3306 root@my-remote-server -N

my-remote-server is running mysql on localhost and you can access it in your machine even though we have'nt expose port 3306.

mysql -h 127.0.0.1 -P 12345 -u myuser -p
@luszczynski
luszczynski / incremental-builds-openshift.md
Created March 20, 2019 13:38
Set Incremental Build on Openshift

Set Incremental Build on Openshift

oc patch bc/my-bc --patch='{"spec": {"strategy": {"sourceStrategy": {"incremental": true}}}}'

@luszczynski
luszczynski / create-user-pass-git-secret.md
Last active March 20, 2019 13:30
Create Git Secret with User and Pass on Openshift

Create Openshift secret with username and password

oc create secret generic gogs-secret --from-literal=username=gogsadmin --from-literal=password=redhat123
oc set build-secret --source bc/tasks gogs-secret
oc start-build tasks