This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Aplicación para editar un KV secret version 2 en Vault | |
# | |
path=$1 | |
tmpfile=$(mktemp) | |
# Fetch the secret and write it to a temporary file | |
vault kv get -format=json $path | jq -er .data.data > $tmpfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creamos una CA self-signed para generar los certificados de los clientes VPN | |
resource "tls_private_key" "foo-vpn-ca-key" { | |
algorithm = "RSA" | |
rsa_bits = 4096 | |
} | |
resource "tls_self_signed_cert" "foo-vpn-ca" { | |
private_key_pem = tls_private_key.foo-vpn-ca-key.private_key_pem | |
subject { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/tls" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Script to handle keepalived notifications. | |
This script will be called by keepalived with three arguments: | |
- "GROUP" or "INSTANCE" | |
- name of the group or instance | |
- target state of the transition: "MASTER", "BACKUP", "FAULT" | |
The script should return 1 if the number of parameters is not 3, if the | |
target state is not "MASTER", "BACKUP" or "FAULT", or if the first parameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH macro AS ( | |
SELECT | |
itemid, | |
(regexp_matches(key_, '(\{#[^\}]*\})'))[1] AS m | |
FROM | |
items) | |
UPDATE | |
items | |
SET | |
name = regexp_replace(name, '(\$1)', macro.m) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[source]] | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
cryptography = "==2.8" | |
django = "==2.2.11" | |
[dev-packages] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -* | |
# vim:fenc=utf-8 | |
# | |
# Script to upgrade gitlab from one version to the latest, using a backup and docker. | |
# | |
import os | |
import sys | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Copyright (c) 2022 Adrian Lopez | |
# | |
# Based on https://github.com/PinGwynn/mmonit-mattermost | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"time" | |
) | |
var expectedPort = 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim:fenc=utf-8 | |
# | |
""" | |
A partir de una serie de medidas de presión y el correspondiente volumen, | |
aproximar una función polinómica. | |
""" |
NewerOlder