Skip to content

Instantly share code, notes, and snippets.

View speedlight's full-sized avatar
🎯
Focusing

Carlos E. speedlight

🎯
Focusing
View GitHub Profile
#!/bin/bash
free_data="$(free)"
mem_data="$(echo "$free_data" | grep 'Mem:')"
free_mem="$(echo "$mem_data" | awk '{print $4}')"
buffers="$(echo "$mem_data" | awk '{print $6}')"
cache="$(echo "$mem_data" | awk '{print $7}')"
total_free=$((free_mem + buffers + cache))
used_swap="$(echo "$free_data" | grep 'Swap:' | awk '{print $3}')"
@speedlight
speedlight / Información del Equipo
Created November 12, 2016 18:28
Información general de un sistema GNU/Linux
NOMBRE DEL EQUIPO
NOMBRE_HOST=$(cat /etc/hostname) ; echo $NOMBRE_HOST
FECHA ACTUAL DEL SISTEMA
FECHA_ACTUAL=$(date +"%d %b %y") ; echo $FECHA_ACTUAL
HORA ACTUAL DEL SISTEMA
HORA_ACTUAL=$(date +"%H:%M") ; echo $HORA_ACTUAL
COMPROBAR NOMBRE DE USUARIO CREADO POR UID/GID (EJM. 1000) - VERSION SIMPLE
# This should be changed to your system's jenkins root JENKINS_ROOT="/var/lib/jenkins"
JENKINS_USERS="$JENKINS_ROOT/users"
JENKINS_JOBS="$JENKINS_ROOT/jobs"
JENKINS_CONFIG="$JENKINS_ROOT/config.xml"
# This variable is used so that we can verify that a user is not found
FAIL_TEST=0
exportUserFolder() {
if [ -d "$JENKINS_USERS/$1" ]; then
@speedlight
speedlight / logstash-config-exim
Created August 15, 2017 20:57 — forked from greem/logstash-config-exim
logstash-config-exim
input {
file {
path => "/path/to/exim/mainlog"
start_position => 'beginning'
sincedb_path => "/dev/null"
}
}
filter {

How to use nginx as a reverse-proxy with letsencrypt

Your infrastructure

generated via plantuml

Imgur

Requirements