Skip to content

Instantly share code, notes, and snippets.

View vacax's full-sized avatar

Carlos Camacho vacax

View GitHub Profile
@vacax
vacax / a.md
Last active October 30, 2025 20:46
Proceso de Systemd conectando un socket con un servicio

Script ejecutado por Socket

Nuestro ejemplo permité ejecutar un script cada cierto tiempo utilizando un servicio de una única ejecución en combinación con la unidad de timer.

Estaremos creando los siguientes archivos:

@vacax
vacax / a.md
Last active November 4, 2025 19:56
Proceso simple de uso de Systemd en Linux

Script ejecutado por tiempo

Nuestro ejemplo permité ejecutar un script cada cierto tiempo utilizando un servicio de una única ejecución en combinación con la unidad de timer.

Estaremos creando los siguientes archivos:

  • mi-script.sh
  • ejecucion-por-tiempo.service
  • ejecucion-por-tiempo.timer
@vacax
vacax / comandos.md
Created September 25, 2025 00:07
Comandos Esenciales en Linux

Comandos Esenciales en Linux

Listado de comandos que debemos utilizar y comprender para dominar el uso de Linux.

Navegación y exploración del sistema

  • pwd → muestra el directorio actual.
  • ls, ls -l, ls -la → lista archivos y directorios.
  • cd → cambiar de directorio.
  • tree → muestra la estructura de directorios en forma de árbol.
@vacax
vacax / conf
Created June 22, 2022 20:20
Configuración virtualhost sin SSL
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName <<MiIP>>
ProxyPreserveHost On
ProxyRequests On
@vacax
vacax / ssh-generation.sh
Last active March 14, 2022 05:31
Script para crear llave rsa de ssh para conexión
#!/bin/sh
FILE=/root/.ssh/id_rsa_nuevo.pub
if [ ! -f "$FILE" ]; then
yes yes | ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa_nuevo
cp $FILE /home/ucjc/
fi
if [ ! -f /home/ucjc/sshd_config ]; then
cat /etc/ssh/sshd_config > /home/ucjc/sshd_config
chmod 777 /home/ucjc/sshd_config
fi
@vacax
vacax / main.c
Created March 8, 2022 16:03
Clase de ICC-103 - 8/03/2022
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct {
char clave[4];
char nombre[100];
} Carrera;
typedef struct {
@vacax
vacax / filtro-rutas-javalin.txt
Last active February 23, 2021 15:59
Ruta con filtro activado para todo un contexto en Javalin
Javalin app = getInstanciaJavalin();
app.routes(()->{
path("/path/", () -> {
before(ctx -> {
System.out.println("Entrando a la ruta path...");
});
get("/", ctx -> {
ctx.result("Ruta path /");
});
@vacax
vacax / gist:006353d26dd137071a4a54ab0fad0ed9
Created October 16, 2020 20:52
Configuración HAProxy sobre escribiendo la sesiones.
listen aplicacion_web
bind *:80
mode http
stats enable
stats uri /stats
stats realm HAProxy\ Statistics
stats auth cda:cda
balance roundrobin
cookie JSESSIONID prefix nocache
server app-01 localhost:7000 check
@vacax
vacax / gist:b3df793613373fb1f3be7b35aa138b67
Created October 16, 2020 20:29
Configuración de HAProxy para uso de Sesiones
listen aplicacion_web
bind *:80
mode http
stats enable
stats uri /stats
stats realm HAProxy\ Statistics
stats auth cda:cda
balance roundrobin
cookie SERVERID insert indirect nocache
server app-01 localhost:7000 check cookie s1
@vacax
vacax / gist:c92bb3826561be55b78b64aed0fdcd8f
Created October 16, 2020 19:36
Configuración HAProxy Basico
listen aplicacion_web
bind *:80
mode http
stats enable
stats uri /stats
stats realm HAProxy\ Statistics
stats auth cda:cda
balance roundrobin
server app-01 localhost:7000 check
server app-02 localhost:7001 check