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 | |
export GITHUB_TOKEN=****************************** | |
export OWNER=******** | |
export REPO=****** | |
EE=$(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/$OWNER/$REPO/releases/latest | grep https://api.github.com/repos/$OWNER/$REPO/releases/assets/. | cut -d : -f 2,3 | tr -d \" | tr -d ,) | |
for URL in $EE | |
do | |
echo $URL | |
name=$(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" $URL | grep '"name":.' | cut -d : -f 2,3 | tr -d \" | tr -d ,) |
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
def clean_idle_redis_keys(redis_host='192.168.0.4', redis_port=6379, db=0, startswithkey='rq', idletime=604800): | |
import redis | |
from tqdm import tqdm | |
r = redis.StrictRedis(host=redis_host, port=redis_port, db=db) | |
for key in tqdm(r.scan_iter("*")): | |
idle = r.object("idletime", key) | |
# idle time is in seconds. | |
if idle > idletime and key.startswith(startswithkey): | |
print("Deleting {}".format(key)) | |
r.delete(key) |
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 | |
#./check_restapi_log_calls.sh /home/erp/var/log/restapi.log 'Apr 18 12:11:00 2024' 'Apr 18 12:25:00 2024' | |
# Input variables | |
file_path=$1 | |
start_date="$2" | |
end_date="$3" | |
# Convertir las fechas de inicio y fin a formato 'date' para comparar | |
start_timestamp=$(date -d "$start_date" '+%s') | |
end_timestamp=$(date -d "$end_date" '+%s') |
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 | |
# Conexión a MongoDB | |
DATABASE="tuBaseDeDatos" | |
COLLECTION="tg_profile" | |
MONGO_HOST="localhost" | |
MONGO_PORT="27017" | |
# Obtener el mínimo y máximo _id | |
MIN_ID=$(mongo --quiet --host $MONGO_HOST --port $MONGO_PORT $DATABASE --eval "printjson(db.$COLLECTION.find().sort({_id: 1}).limit(1).toArray()[0]._id)") |
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 | |
# Create necessary directories if they do not exist | |
mkdir -p /opt/node_exporter/metrics_folder/ | |
mkdir -p /opt/node_exporter/ram_consumption/ | |
# Create the script file with the given content | |
cat << 'EOF' > /opt/node_exporter/ram_consumption/ram_p.sh | |
#!/bin/bash |
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 | |
# Configuración del repositorio | |
OWNER="gisce" | |
REPO="erp" | |
GITHUB_API_URL="https://api.github.com" | |
GITHUB_TOKEN=${GITHUB_TOKEN} | |
MAX_PRS=150 # Definir el máximo de PRs a procesar | |
# Almacenar las PRs que cumplen el requisito |