Skip to content

Instantly share code, notes, and snippets.

View pixelead0's full-sized avatar
👨‍💻
Programando.... ando...

AdanGQ pixelead0

👨‍💻
Programando.... ando...
View GitHub Profile
@pixelead0
pixelead0 / .env.example
Created January 29, 2025 14:42
EasyBroker API
EASYBROKER_API_KEY=EASYBROKER_API_KEY
EASYBROKER_BASE_URL=https://api.stagingeb.com/v1
EASYBROKER_TIMEOUT=10
EASYBROKER_ITEMS_PER_PAGE=5
@pixelead0
pixelead0 / logging_config.py
Last active August 17, 2024 18:51
logging for fastAPI with custom level (logger.trace)
import logging
import os
import sys
from typing import Callable, Any
LOG_FORMAT: str = "[%(levelname)s][%(filename)s:%(lineno)d][%(funcName)s]%(message)s"
TRACE_LOG_LEVEL: int = logging.INFO + 1
logging.addLevelName(TRACE_LOG_LEVEL, "TRACE")
@pixelead0
pixelead0 / .env
Created July 25, 2024 18:41
This script connects to a Redis server, retrieves keys matching a specified pattern, and checks their expiration times. It converts the TTL (Time-To-Live) values to a human-readable format and prints the expiration times for the keys.
REDIS_SERVER="127.0.0.1"
REDIS_PORT="6379"
REDIS_USERNAME="myRedisUser"
REDIS_PASSWORD="mYP@ssw0rd"
REDIS_SSL="True"
REDIS_SSL_CERT_REQS="none"
@pixelead0
pixelead0 / code2text.sh
Created July 25, 2024 18:16
This script searches for and processes code files in specified directories, excluding certain types of files and directories. For each found file, the script determines its encoding and saves its content into an output directory, organizing the results in a structured manner
#!/bin/bash
# This script converts code files to text files and saves them in a specified output directory.
# It excludes certain directories and file extensions from the conversion process.
# The script searches for and processes code files in specified directories,
# determines their encoding, and saves their content into an output directory,
# organizing the results in a structured manner.
# Directory for the converted code files
output_dir="code_txt"
@pixelead0
pixelead0 / transcribe_audio_to_text.py
Created May 21, 2024 01:15
transcribe_audio_to_text
import os
from pydub import AudioSegment
import speech_recognition as sr
print("# Define las rutas")
path = '/app/audio/a00'
audio_file_path = f"{path}.m4a"
output_directory = '/app/audio/segments'
@pixelead0
pixelead0 / list_all_pads.sh
Created July 11, 2022 17:49
List all pads - etherpad
# List all pads - etherpad
# https://github-wiki-see.page/m/ether/etherpad-lite/wiki/How-to-list-all-pads
# https://etherpad.org/doc/latest/#index_http_api
ETHERPAD_HOST='http://127.0.0.1:9001'
# can be found in APIKEY.txt file in the Etherpad installation directory
ETHERPAD_API_KEY='...'
#Get api version
@pixelead0
pixelead0 / settings.json
Created March 19, 2022 01:39
vscode config
{
"window.zoomLevel": 2,
"editor.columnSelection": false,
"workbench.colorTheme": "Arkademy",
"files.associations": {
"*.bash": "shellscript",
"*.jinja": "html"
},
"explorer.confirmDelete": false,
"[jinja]": {
@pixelead0
pixelead0 / .openconnect
Created October 27, 2021 01:49
Para conectarse a la vpn de globalProtect desde la terminal de linux
ContraseñaUltraSegura
@pixelead0
pixelead0 / dates_helper.py
Created October 22, 2021 14:48
Funciones utiles para trabajar con fechas
import datetime
import logging
logger = logging.getLogger(__name__)
class DatesHelper(object):
def convert_string_to_datetime(self, date=datetime.datetime.now()):
if type(date) == str or type(date) == unicode:
@pixelead0
pixelead0 / docker_tricks.sh
Created June 17, 2021 13:35
Comandos docker
# Ver logs del ultimo contenedor creado
docker ps -lq | xargs -L 1 docker logs -f
# Crea un alias para mostrar los logs del ultimo contenedor dev_web creado
alias 'dev_web'='docker container ls | grep '"'"'dev_web'"'"' | awk '"'"'{ print $1 }'"'"' '
alias 'log_dev'='docker logs -f $(dev_web)'
#-----
CONTAINER_NAME=dev_web
docker container ls | grep "$CONTAINER_NAME" | awk "{ print $1 }"