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
import requests | |
import json | |
import time | |
class Office365EmailClient: | |
def __init__(self, client_id: str, client_secret: str, tenant_id: str): | |
self.client_id = client_id | |
self.client_secret = client_secret | |
self.tenant_id = tenant_id | |
self.token = None |
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
import time | |
import jwt | |
from fastapi import Depends, HTTPException, Response, status | |
from fastapi.security import OAuth2PasswordBearer | |
from helpers.config_helper import Config | |
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") | |
class OAuth2TokenValidation: | |
def __init__(self): |
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
FROM accetto/ubuntu-vnc-xfce-g3 | |
USER 0 | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
RUN apt update \ | |
&& apt install -y wget gnupg2 \ | |
&& rm -rf /var/lib/apt/lists/* |
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
sed -i -e 's@Exec=/usr/bin/microsoft-edge-dev %U@Exec=/usr/bin/microsoft-edge-dev %U --no-sandbox@g' /usr/share/applications/microsoft-edge-dev.desktop | |
sed -i -e 's@Exec=/usr/bin/google-chrome-stable %U@Exec=/usr/bin/google-chrome-stable %U --no-sandbox@g' /usr/share/applications/google-chrome.desktop |
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
palavra="teste"; texto_adicional="deu certo"; for arquivo in teste*; do grep -q "$palavra" "$arquivo" && sed -i "/$palavra/ s/$/ $texto_adicional/" "$arquivo" && echo "Texto adicionado em $arquivo"; done |
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
last_execution = datetime.now(tz=pytz.timezone('America/Cuiaba')) | |
def cooldown(): | |
global last_execution | |
now = datetime.now(tz=pytz.timezone('America/Cuiaba')) | |
if last_execution is not None: | |
difference_time = (now - last_execution).seconds | |
remaining_time = 120 - difference_time | |
if difference_time < 120: | |
raise Exception(f'Please wait {remaining_time} seconds before another try!') |
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
#/etc/fail2ban/filter.d/npm-auth.conf | |
[INCLUDES] | |
[Definition] | |
failregex = ^ \[error\] \d+#\d+: \*\d+ user "(?:[^"]+|.*?)":? (?:password mismatch|was not found in "[^\"]*"), client: <HOST>, server: \S*, request: "\S+ \S+ HTTP/\d+\.\d+", host: "\S+"(?:, referrer: "\S+")?\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 | |
#/etc/fail2ban/scripts/fail2ban-telegram.sh | |
# Sends text messages using Telegram | |
# to alert webmaster of banning. | |
# Require one argument, one of the following | |
# start | |
# stop |
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 | |
# Função para enviar uma mensagem ao chat do Minecraft usando rcon-cli | |
send_message() { | |
echo "Sending message to Minecraft chat: $1" | |
docker exec minecraft_server_minecraft-server_1 rcon-cli tellraw @a "{\"text\":\"$1\",\"color\":\"green\"}" | |
} | |
# Função para verificar se o servidor está em autopause |
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
from datetime import datetime | |
class Logger(): | |
def log_time() -> str: | |
return datetime.now().strftime("%d/%m/%Y %H:%M:%S") | |
def log_date() -> str: | |
return datetime.now().strftime("%d_%m_%Y") | |
NewerOlder