Skip to content

Instantly share code, notes, and snippets.

View jovemfelix's full-sized avatar

RENATO ALVES FELIX jovemfelix

View GitHub Profile
@jovemfelix
jovemfelix / ocp-3x-dc-to-csv.sh
Created March 25, 2021 18:50
Comando usado para Exportar o DC para CSV
$ oc get dc --all-namespaces -o jsonpath='{range .items[*]}{@.metadata.namespace}{";"}{@.metadata.name}{";"}{@.spec.template.spec.containers[0].env[?(@.name=="XMX")].value}{";"}{@.spec.template.spec.containers[0].env[?(@.name=="XMS")].value}{";"}{@.spec.template.spec.containers[].livenessProbe}{";"}{@.spec.template.spec.containers[].readinessProbe}{";"}{@.spec.template.spec.volumes[0].persistentVolumeClaim.claimName}{";"}{@.spec.template.spec.containers[0].image}{";"}{@.spec.replicas}{";"}{@.spec.template.spec.containers[0].resources.limits.cpu}{";"}{@.spec.template.spec.containers[0].resources.limits.memory}{";"}{@.spec.template.spec.containers[0].resources.requests.cpu}{";"}{@.spec.template.spec.containers[0].resources.requests.memory}{"\n"}{end}' > dc.csv
@jovemfelix
jovemfelix / skopeo-inspect.sh
Created March 25, 2021 19:00
Get image info
export CREDS=$(oc whoami):$(oc whoami -t)
export REGISTRY=docker-registry-default.openshift.XXXX.com.br
IMAGE=docker-registry-default.openshift.XXXX.com.br/ag-CCCC/XXX-dotnet-sdk:latest
skopeo inspect --tls-verify=false --creds=$CREDS docker://$IMAGE > /tmp/IMAGE.json
export CREDS=$(oc whoami):$(oc whoami -t)
export IMAGE_FILE_PATH=image-final
export OUTPUT_CVS_FOUND_PATH=image-url-found.csv
i=0
rm -f $OUTPUT_CVS_FOUND_PATH
cat $IMAGE_FILE_PATH | while read line
do
((i = i + 1))
@jovemfelix
jovemfelix / ansible_local_playbooks.md
Created May 24, 2021 16:11 — forked from alces/ansible_local_playbooks.md
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@jovemfelix
jovemfelix / settings.xml
Created May 26, 2021 14:44
Sample MAVEN SETTINGS
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://NEXUS_URL/nexus/content/groups/my_public_group</url>
</mirror>
alias donly='mvn wildfly:deploy-only -PskipTests'
alias v='vim'
alias meld="/Applications/Meld.app/Contents/MacOS/Meld"
alias m="/Applications/Meld.app/Contents/MacOS/Meld"
alias k="/Applications/kdiff3.app/Contents/MacOS/kdiff3"
alias ty='open -a typora'
alias t="tree -a -I 'node_modules|cache|test_*|target|.git|.idea|.gitkeep|.gitignore|.circleci|.editorconfig|.mvn|.vscode'"
alias i='mvn clean install -Denforcer.skip=true -Dmaven.test.skip=true -Dcheckstyle.skip -f pom.xml'
alias p='mvn clean package -Denforcer.skip=true -Dmaven.test.skip=true -Dcheckstyle.skip -f pom.xml'
alias po='mvn clean package -Dmaven.test.skip=true -Dcheckstyle.skip -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B -f pom.xml'
@jovemfelix
jovemfelix / get-database-version-with-java.md
Last active November 18, 2021 15:49
Example of how to get the database version using java, in the case below as an example using SQL Server

Example of how to get the database version using java, in the case below as an example using SQL Server

Source Code

Change: username , password and driver, jdbc-driver

import java.sql.*;
import java.util.Vector;
@jovemfelix
jovemfelix / RHEL-Commands-For-Health-Check.md
Last active November 10, 2021 01:17
Usefull for JBOSS EAP (wildly) or RHSSO (Keycloak)

SO

What is an sosreport and how to create one in Red Hat Enterprise Linux? https://access.redhat.com/solutions/3592

# get sos-report, save the generated files
sos-report
# this gona be the health file
HOST_HEALTH_CHECK_FILE=$(hostname)_$(date +"%d-%m-%Y")

download

curl https://static.redhat.com/downloads/training-certification/rhrexboot.iso

listar ISO

ls
-rw-r--r--@  1 renato  staff   2.3G Nov 13 18:48 rhrexboot.iso

get-nexus-bundle.sh

#!/bin/bash
if curl -L --progress-bar -O https://download.sonatype.com/nexus/oss/nexus-2.14.3-02-bundle.tar.gz
then
  echo "Nexus bundle download successful"
else
  echo "Download failed"
fi