Skip to content

Instantly share code, notes, and snippets.

View jovemfelix's full-sized avatar

RENATO ALVES FELIX jovemfelix

View GitHub Profile
#!/bin/sh
sudo rm -rf work
if [ ! -d "work" ]; then
echo -n "• Creating database volume: "
mkdir -p work/init work/data
cp db.sql work/init
podman unshare chown -R 27:27 work
else
sudo rm -fr work/init
@jovemfelix
jovemfelix / RedHat-Certifications-Tips-and-Tricks.md
Last active February 7, 2022 15:36
Tips and tricks for linux configuration at exams

I like to create aliases to speed up and maintain my quirks, follow:

cls - is the most used, to CLEAR the screen and history I put the alias in the ~/.bashrc file

alias cls='printf "\033c"'
alias l='ls -lahr'
alias g='gedit'

Now with regard to editing files (despite having some knowledge in VIM), I have preferred to use gedit!

@jovemfelix
jovemfelix / Nginx-JFrog-Redhat-Registry.md
Created February 10, 2022 20:23
Instalation and configurations Tips of Artifactory (JFROG 7.33) using the Red Hat Registry (https://registry.redhat.io/) - at RHEL 8.x

JFROG

Instalation

curl -L --output jfrog-rpm-installer.tar.gz "https://releases.jfrog.io/artifactory/jfrog-prox/org/artifactory/pro/rpm/jfrog-platform-trial-prox/[RELEASE]/jfrog-platform-trial-prox-[RELEASE]-rpm.tar.gz"

tar -xvzf jfrog-rpm-installer.tar.gz

Apache Setup

Create Project

$ oc new-project test-same-hostname-01

View existing Images

@jovemfelix
jovemfelix / Copy-sosrerport-from-Node-using-oc-debug.md
Created July 5, 2022 12:56
How to Copy sosrerport from Node using oc debug? Not ssh!

How to Copy Files from NODE using oc cp?

At Openshift 4.x that recomends using oc debug instead of ssh bellow I'll explain how to do it.

At Terminal 01

Start Node DEBUGING

$ oc debug node/k8sdemo-hxvrp-master-2
# remember to change chroot /host

Variables

export NS=benchmark-operator
export ES_SERVER=${ES_SERVER:-https://search-perfscale-dev-chmf5l4sh66lvxbnadi4bznl3a.us-west-2.es.amazonaws.com:443}

Grafana

Requirements

# version used
$ yq -V
yq version 4.9.6
$ cp original-file.yaml original-file.orig.yaml
# this for single file
$ yq eval '.metadata.annotations."kubectl.kubernetes.io/last-applied-configuration"' -i original-file.yaml
$ yq eval 'del(.metadata.creationTimestamp)' -i original-file.yaml
$ yq eval 'del(.metadata.generation)' -i original-file.yaml
ORIGINAL_FILE=$1
echo cleaning $1
yq eval 'del(.metadata.annotations."kubectl.kubernetes.io/last-applied-configuration")' -i $ORIGINAL_FILE
yq eval 'del(.metadata.creationTimestamp)' -i $ORIGINAL_FILE
yq eval 'del(.metadata.generation)' -i $ORIGINAL_FILE
yq eval 'del(.metadata.managedFields)' -i $ORIGINAL_FILE
yq eval 'del(.metadata.ownerReferences)' -i $ORIGINAL_FILE
yq eval 'del(.metadata.resourceVersion)' -i $ORIGINAL_FILE
apiVersion: integreatly.org/v1alpha1
kind: GrafanaDashboard
metadata:
name: dashboard-ingress
labels:
app: 3scale-monitoring. # adequar para o cenário
spec:
json:
""
configMapRef:

Steps

$ oc project openshift-ingress
$ statsPassword=$(oc extract secret/router-stats-default --keys=statsPassword --to=-)
$ statsUsername=$(oc extract secret/router-stats-default --keys=statsUsername --to=-)

$ oc get pods
$ oc exec -it pod/router-default-577b87cd94-jv5s7 -- curl -s -u ${statsUsername}:${statsPassword} 127.0.0.1:1936/metrics | grep haproxy

Reference