Skip to content

Instantly share code, notes, and snippets.

@serxoz
serxoz / rancher2ha_selfsigned_layer4lb.md
Created August 24, 2018 12:35 — forked from superseb/rancher2ha_selfsigned_layer4lb.md
Install Rancher 2.0 HA by using self signed certificates (+ intermediate) and Layer 4 Loadbalancer (TCP)

Install Rancher 2.0 HA by using self signed certificates (+ intermediate) and Layer 4 Loadbalancer (TCP)

This gist describes how to setup Rancher 2 HA, by using self signed certificates (with intermediate) and a Layer 4 Loadbalancer (TCP)

Requirements

  • Linux OS
  • OS Binaries
    • wget
  • openssl
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Modifica todos los dominios que devuelven un email cuando no existe la cuenta de correo
y en su lugar deja de procesar ese correo.
Haz backup del directorio antes de ejecutar este script!!!
# cp -a /etc/valiases /etc/valiases-backup
@serxoz
serxoz / wget-snapshotpage.md
Created February 17, 2020 15:08 — forked from dannguyen/wget-snapshotpage.md
Use wget to snapshot a page and its necessary visual dependencies

Use wget to mirror a single page and its visible dependencies (images, styles)

Money graphic via State of Florida CFO Vendor Payment Search

Graphic via State of Florida CFO Vendor Payment Search (flair.myfloridacfo.com)

This is a quick command I use to snapshot webpages that have a fun image I want to keep for my own collection of WTFViz. Why not just right-click and save the image? Oftentimes, the webpage in which the image is embedded contains necessary context, such as captions and links to important documentation just incase you forget what exactly that fun graphic was trying to explain.

#!/bin/sh
# Flush MySQL tables to the disk before the filesystem is frozen.
# At the same time, this keeps a read lock in order to avoid write accesses
# from the other clients until the filesystem is thawed.
MYSQL="/usr/bin/mysql"
MYSQL_OPTS="-uroot" #"-prootpassword"
FIFO=/var/run/mysql-flush.fifo
@serxoz
serxoz / ssl.rules
Created July 22, 2020 07:43 — forked from konklone/ssl.rules
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@serxoz
serxoz / gin-miniapi.go
Created February 10, 2021 08:39 — forked from AaronGhent/gin-miniapi.go
golang gin - mini rest api jwt + proxy
package main
## Install
# sudo apt install golang-go
# echo GOPATH=`pwd`
# export GOPATH=`pwd`
# go get -u -v github.com/appleboy/gin-jwt
# go get -u -v github.com/gin-contrib/cors
# go get -u -v github.com/gin-gonic/gin
# go get -u -v github.com/derekparker/delve/cmd/dlv
@serxoz
serxoz / apt_wait.sh
Created February 17, 2021 10:49 — forked from tedivm/apt_wait.sh
A BASH function to wait for `apt` to finish and release all locks.
#!/usr/bin/env bash
apt_wait () {
while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
sleep 1
done
while sudo fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do
sleep 1
done
if [ -f /var/log/unattended-upgrades/unattended-upgrades.log ]; then
@serxoz
serxoz / weechat-tor-sasl.md
Last active May 26, 2021 14:17
Configure weechat with tor+SASL & secure password

Original author: Szorfein here.

Once weechat is install, launch it.

$ weechat

Add a Freenode server

Add a freenode server without SSL, we enable it later.

@serxoz
serxoz / postura.py
Created June 30, 2021 07:33
Aviso para mellorar a postura sentado
#!/usr/bin/env python
"""
Aviso para que me recorde que me sente ben.
crontab:
0,20,40 * * * * DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus XDG_RUNTIME_DIR="/run/user/1000" ~/bin/postura.py
NOTA: axustar as variables de sesión co UID do teu usuario.
"""
@serxoz
serxoz / self-signed-certificate-with-custom-ca.md
Created October 14, 2021 08:44 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096