Skip to content

Instantly share code, notes, and snippets.

View Canx's full-sized avatar

Ruben Cancho Canx

View GitHub Profile
@Canx
Canx / polygon_client.py
Created May 24, 2024 07:22
thread safe PolygonClient
class PolygonClient(RESTClient):
''' Rate Limited RESTClient with factory method '''
WAIT_SECONDS = 12
_class_lock = threading.Lock()
@classmethod
def create(cls, *args, **kwargs) -> RESTClient:
if 'api_key' not in kwargs:
kwargs['api_key'] = os.environ.get("POLYGON_API_KEY")
class RLRESTClient(RESTClient):
''' Rate Limited RESTClient '''
def __init__(self, *args, **kwargs):
self.paid = kwargs.pop('paid', True)
self.seconds = 60
super().__init__(*args, **kwargs)
def _get(self, *args, **kwargs):
if not self.paid:
print(
import time
from polygon import RESTClient
def apply_sleep_to_polygon_api_calls(sleep=60):
from polygon.rest import BaseClient
# Save a reference to the original method
original_get = BaseClient._get
# Define a new version of the _get method
#!/bin/bash
sudo apt-get install autoconf automake libtool
git clone https://github.com/TA-Lib/ta-lib.git
cd ta-lib
chmod +x autogen.sh
./autogen.sh
./configure
make
sudo make install
@Canx
Canx / header_checks
Created December 1, 2023 12:46
configuracion postfix para envio desde centros
/^From:/ REPLACE From: <correo>
/^Sender:/ REPLACE Sender: <correo>
/^Reply-To:/ REPLACE Reply-To: <correo>
/^Subject:/ REPLACE Subject: Escaner
#!/bin/bash
# Verifica si el script se ejecuta como superusuario
if [ "$EUID" -ne 0 ]; then
echo "Por favor, ejecuta este script como superusuario."
exit 1
fi
# Recorre todos los directorios de inicio de sesión en /home
for user_home in /home/*; do

DIGITALIZACIÓN

1. Presentación

La sociedad digital y de la información plantea la necesidad de conocer de una forma más profunda los elementos que permiten desarrollar en ella nuestras vidas de una forma crítica y segura. En este sentido, los sistemas informáticos ofrecen todo su potencial para conseguir una sociedad más justa, plural e igualitaria, en la que tenga cabida toda la ciudadanía sin condicionantes ni barreras, favoreciendo a su vez el aprendizaje permanente y el desarrollo personal. La materia Digitalización da respuesta a la necesidad de adaptación al entorno tan

@Canx
Canx / InRelease_centro
Last active March 6, 2023 12:59
InRelease con cabeceras desde el centro y desde fuera. Comando: wget --save-headers http://lliurex.net/bionic/dists/bionic-updates/InRelease
HTTP/1.1 200 OK
Date: Mon, 06 Mar 2023 12:55:03 GMT
Server: Apache
Last-Modified: Mon, 06 Mar 2023 06:22:12 GMT
ETag: "23e6-5f63550c86908"
Accept-Ranges: bytes
Che: 665366
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.