Skip to content

Instantly share code, notes, and snippets.

View fulvi0's full-sized avatar
🏠
Working...

Carlos Antonio fulvi0

🏠
Working...
View GitHub Profile

Ciertamente. Aquí tienes el informe detallado en español sobre las oportunidades para mejorar el rendimiento del código fuente Java proporcionado para la aplicación de inicio de sesión:

Informe de Oportunidades de Mejora de Rendimiento

  1. Prioridad 1: Optimizar Conexiones LDAP
    • Explicación: El código crea nuevas conexiones LDAP para cada operación, lo cual es ineficiente y puede llevar a cuellos de botella de rendimiento, especialmente bajo carga alta. Las conexiones LDAP consumen muchos recursos y son lentas de establecer.
    • Cambios Sugeridos:
      • Implementar un pool de conexiones utilizando una biblioteca como Apache Commons Pool.
      • Crear un gestor de conexiones LDAP singleton para reutilizar conexiones entre solicitudes.
      • Ejemplo:
@fulvi0
fulvi0 / buxy.yaml
Last active September 25, 2024 15:30
apiVersion: apps/v1
kind: Deployment
metadata:
name: busybox
spec:
replicas: 1
selector:
matchLabels:
app: busybox
template:
version: '3.7'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.5.1
container_name: elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
import re
from datetime import datetime
import sys
def parse_log_line(line):
pattern = r'(\S+) "POST: (\S+) - - \[(.*?)\] "(POST|GET) "(.*?)" "(.*?)" .*?" (\d+) (\d+)'
match = re.search(pattern, line)
if match:
ip, _, timestamp, method, host, endpoint, status, _ = match.groups()
return {
@fulvi0
fulvi0 / prometheus.yml
Created July 26, 2023 21:00 — forked from weibeld/prometheus.yml
Example Prometheus configuration (scrape config)
global:
scrape_interval: 10s
scrape_configs:
- job_name: node
static_configs:
- targets:
- localhost:9100
- job_name: python-app
static_configs:
- targets:
@fulvi0
fulvi0 / nodejs-cheatsheet.js
Created July 9, 2022 13:20 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
docker run --rm -it \
-v $HOME/.kube:/root/.kube \
-e POPEYE_REPORT_DIR=/tmp/popeye \
-v /tmp:/tmp \
derailed/popeye --context foo -n bar --save --output-file report.log
k get nodes -o wide > nodos-cluster-prod-cenco
kubectl get ns -o wide > list-namespaces
kubectl top nodes > top-node-cluster
kubectl top pods -A > top-pods-wide
kubectl get pods --all-namepaces -o jsonpath='{range .items[*]}{"\n"}{range .spec.containers[*]}{.name}{":\t"}{.spec.containers[*]}{.resources}{", "}{end}{end}' |\
sort > containerResourceDefinition
kubectl get pods --all-namepaces -o jsonpath='{range .items[*]}{"\n"}{range .spec.containers[*]}{.name}{":\t"}{.spec.containers[*]}{.imageresources}{", "}{end}{end}' |\
sort > containerImageBuilder
@fulvi0
fulvi0 / prometheus.yml
Created April 14, 2022 06:32 — forked from reachlin/prometheus.yml
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@fulvi0
fulvi0 / ocp4_all_resources.md
Created March 8, 2022 13:05 — forked from bu3ny/ocp4_all_resources.md
How can I list all resources and custom resources in OpenShift 4

How can I list all resources and custom resources in OpenShift

List all CRDs with CR name and Scope

oc get crd -o=custom-columns=NAME:.metadata.name,CR_NAME:.spec.names.singular,SCOPE:.spec.scope

List every single custom resources in the cluster

oc get $(oc get crd -o=custom-columns=CR_NAME:.spec.names.singular --no-headers | awk '{printf "%s%s",sep,$0; sep=","}') --ignore-not-found --all-namespaces -o=custom-columns=KIND:.kind,NAME:.metadata.name,NAMESPACE:.metadata.namespace

List every single resource in the cluster (custom and non-custom)

oc get $(oc api-resources --verbs=list -o name | awk '{printf "%s%s",sep,$0;sep=","}') --ignore-not-found --all-namespaces -o=custom-columns=KIND:.kind,NAME:.metadata.name,NAMESPACE:.metadata.namespace --sort-by='metadata.namespace'