Skip to content

Instantly share code, notes, and snippets.

View arellano-gustavo's full-sized avatar
💭
I am just happy

Gustavo Adolfo Arellano Sandoval arellano-gustavo

💭
I am just happy
View GitHub Profile
@arellano-gustavo
arellano-gustavo / gist:735060e6787153d0fac0c70bd04ce1c5
Created May 16, 2020 18:30
How to get a Jenkins Job as a local XML file. Then, create a new job.
# Please consider the $1 variable in here: (it is the job name)
curl -k -s \
https://jenkins.url.site/job/$1/config.xml \
-u jenkins-user:111f65b8xxxxxc395df \
-o $1-config.xml
# Now, we will use 2 variables: $1 & $2: (new job name & file with its definition)
CRUMB=$(\
curl -k \
'https://jenkins.url.site/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)' \
@arellano-gustavo
arellano-gustavo / generate-nexus-ssl.sh
Last active May 19, 2020 19:09
Generate nexus ssl certificate from lets encript output
#!/bin/bash
cd /etc/letsencrypt/archive/
echo "Recreando el directorio temporal"
rm -rf temporal
cp -r ci.ultrasist.net temporal
cd temporal
CLAVE=password
@arellano-gustavo
arellano-gustavo / Dockerfile
Created May 23, 2021 16:40
Dockerfile for a VueJS clean environment
FROM ubuntu
RUN apt-get update
RUN apt-get -y install sudo
RUN apt-get -y install curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g @vue/cli
RUN useradd -m ejemplo && echo "ejemplo:ejemplo" | chpasswd && adduser ejemplo sudo
@arellano-gustavo
arellano-gustavo / MiniServicioRest.txt
Created May 23, 2021 16:53
Mini servicio rest con nodeJs
FROM ubuntu
RUN apt-get update
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
RUN mkdir app
RUN cd app
RUN npm install express --save
@arellano-gustavo
arellano-gustavo / EjemploMarkdown.md
Last active May 23, 2021 16:58
Just a simple MD file example

Ejemplo

sub titulo

  • uno
  • dos
@arellano-gustavo
arellano-gustavo / NodeTest.java
Created May 23, 2021 17:01
Ejercicio de nodos en Java
package mx.com.ultrasist.ci.generator;
// Curly brace Enemy ...
// https://javarevisited.blogspot.com/2017/03/how-to-reverse-linked-list-in-java-using-iteration-and-recursion.html
public class SinglyLinkedList<T> {
private Node<T> head;
/**
* Imprime esta lista ligada con un formato
* específico delimitado por símbolos '--->'
@arellano-gustavo
arellano-gustavo / ws.html
Last active December 13, 2021 05:48
Un cliente del websocket de Binance
<!DOCTYPE html>
<html>
<head>
<title>Prueba de un cliente de un websocket</title>
<script type="text/javascript">
var webSocket = new WebSocket('wss://fstream.binance.com/ws/btcusdt@trade');
@arellano-gustavo
arellano-gustavo / docker-compose.yml
Created December 30, 2021 03:31
Archivo docker-compose para levantar un wordpress
version: '3.7'
services:
db:
image: mysql:8.0.19
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- /this/is/the/path/wordpress/data:/var/lib/mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=somewordpress
@arellano-gustavo
arellano-gustavo / balanceador.conf
Created January 24, 2022 14:26
Archivo de configuración de nginx que uso para balancear un servicio
upstream balanceador {
server srv02:9001;
server srv02:9002;
server srv02:9003;
}
server {
server_name balanceador.qbits.mx;
location / {
@arellano-gustavo
arellano-gustavo / redirect-if-mobile.conf
Last active October 18, 2022 14:09
Nginx configuration for redirect to a mobile version if mobile detected
#-----------------------------
# alvinalexander.com (desktop)
#-----------------------------
server {
server_name alvinalexander.com;
listen 80;
#----- redirect to mobile check (starts) -----#
set $mobile_rewrite do_not_perform;