Skip to content

Instantly share code, notes, and snippets.

View rmsaitam's full-sized avatar

Reginaldo rmsaitam

View GitHub Profile
@rmsaitam
rmsaitam / main.py
Created June 20, 2024 13:17
Detecção de faces com Python
import cv2
from cvzone.FaceDetectionModule import FaceDetector
# Inicializa a captura de vídeo da webcam
video = cv2.VideoCapture(0)
# Verifica se a webcam foi inicializada corretamente
if not video.isOpened():
print("Erro ao acessar a câmera")
exit()
@rmsaitam
rmsaitam / safe_password.py
Created February 26, 2024 19:02
Script Python de exemplo de como deve ser criar e armazenar senhas de usuários no banco de dados
import bcrypt
import mysql.connector
# Função para conectar ao banco de dados MySQL
def conectar_mysql():
return mysql.connector.connect(
host="localhost",
user="root",
password="secret", # Senha configurada para o MySQL
database="safe_password" # Nome do banco de dados
@rmsaitam
rmsaitam / client_grpc.py
Last active January 30, 2024 11:16
Cliente GRPC
import grpc
import examplo_pb2
import examplo_pb2_grpc
def run_client():
channel = grpc.insecure_channel("localhost:50051")
stub = examplo_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(examplo_pb2.HelloRequest(name="gRPC"))
print("Greeter client received:", response.greeting)
@rmsaitam
rmsaitam / server_grpc.py
Last active January 30, 2024 11:15
Servidor GRPC
import grpc
from concurrent import futures
import examplo_pb2
import examplo_pb2_grpc
class GreeterServicer(examplo_pb2_grpc.GreeterServicer):
def SayHello(self, request, context):
return examplo_pb2.HelloResponse(greeting=f"Hello, {request.name}!")
def run_server():
@rmsaitam
rmsaitam / flashfile.bat
Created February 26, 2022 23:45
Script para flashing do dispositivo Motorola/Lenovo (Windows)
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dsp adspso.bin
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
@rmsaitam
rmsaitam / flashfile.sh
Last active February 26, 2022 23:46
Script para flashing do Motorola/Lenovo (Linux)
#!/bin/bash
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dsp adspso.bin
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
@rmsaitam
rmsaitam / docker-compose-humhub.yml
Created February 15, 2021 01:45
Humhub no ambiente Docker
version: '3.1'
services:
humhub:
image: mriedmann/humhub:1.6.2
links:
- "db:db"
ports:
- "8080:80"
volumes:
- "config:/var/www/localhost/htdocs/protected/config"
@rmsaitam
rmsaitam / .env-example
Created November 29, 2020 20:17
Ambiente Kutt no Docker
# App port to run on
PORT=3000
# The name of the site where Kutt is hosted
SITE_NAME=Kutt
# The domain that this website is on
DEFAULT_DOMAIN=localhost:3000
# Generated link length
@rmsaitam
rmsaitam / VideoStream.md
Created July 3, 2020 02:31 — forked from rpragana/VideoStream.md
Node video streaming

Cria uma stream de vídeo no nodejs plano (sem express ou outros módulos)

@rmsaitam
rmsaitam / compara_hora.php
Last active April 23, 2020 16:27
Comparação de hora em PHP
<?php
$hora_fixa = strtotime("13:18");
$hora = strtotime(date('G:i')); //G 0-23 horas, i minutos
echo $hora .'<br>';
if($hora == $hora_fixa) {
echo "ok";
}
else {
echo "passou da hora";