Skip to content

Instantly share code, notes, and snippets.

View RobiMez's full-sized avatar
:shipit:
I'm not dead , i just haven't git pushed.

Robi RobiMez

:shipit:
I'm not dead , i just haven't git pushed.
View GitHub Profile
@RobiMez
RobiMez / BackupAndNotifyTelegram.sh
Created April 15, 2024 09:02
A simple script to back up a mongo db server and send statuses to a telegram group
#!/bin/bash
# Capture the start time
start_time=$(date +%s)
# Telegram bot token and chat ID
bot_token="<TOKEN HERE>"
chat_id="<CHAT ID HERE>"
# MongoDB base command
mongodump_base_command="mongodump --uri=\"mongodb://< URI HERE >""
@RobiMez
RobiMez / scene.svelte
Created September 30, 2023 20:23
Get a fps counter running with svelte and three
import { GPUStatsPanel } from 'three/addons/utils/GPUStatsPanel.js';
import Stats from 'three/addons/libs/stats.module.js';
import { useThrelte } from '@threlte/core';
const { scene, renderer } = useThrelte();
const stats = new Stats();
document.body.appendChild(stats.dom);
const gpuPanel = new GPUStatsPanel(renderer.getContext());
stats.addPanel(gpuPanel);
@RobiMez
RobiMez / main.py
Last active September 27, 2023 20:30
Take a screenshot of your display every n seconds and remove duplicate with similarity checking ( run with admin mode )
from datetime import datetime
import time , os
import pyautogui
import pygetwindow as gw
from skimage import io, metrics
import os
# Define a function to compare images using SSIM
def padd_str(text, to_chars, push_r: bool = False, push_l: bool = False):
"""Padds the string given with spaces to a certain char count ( like setw() in cpp )"""
if len(text) < to_chars:
excess = to_chars - len(text)
if push_r: # we pad to the left of text
text = ' ' * excess + text
elif push_l: # we pad to the right of text
text = text + ' ' * excess
else: # we dont pad if no direction
@RobiMez
RobiMez / stikas
Created July 1, 2022 07:04
snippet of code that makes a pack outta quotly stickers
await event.delete()
entitty = await ubi.get_entity('<id here>')
quotes = ubi.iter_messages(entity=entitty,from_user="@QuotLyBot")
count = 0
stk = []
async for quote in quotes:
if quote.message == '':
print(quote.stringify())
if isinstance(quote.media, MessageMediaDocument):
# print(quote.media.document.id)
@RobiMez
RobiMez / colors.py
Last active July 14, 2022 11:57
p.o(c.color , text )
"""Add colors to print"""
class C:
black = '\033[30m'
red = '\033[31m'
green = '\033[32m'
yellow = '\033[33m'
orange = '\033[34m'
purple = '\033[35m'
blue = '\033[36m'
white = '\033[37m'
@RobiMez
RobiMez / telethon_palette_plugin.py
Created February 3, 2022 22:23
Telethon userbot plugin for generating color palettes from images AND GIFS !
import cv2
import os
import asyncio
import math
from PIL import Image
from telethon import events
from telethon.tl.types import MessageMediaPhoto , MessageMediaDocument, DocumentAttributeAnimated
from colorthief import ColorThief