Skip to content

Instantly share code, notes, and snippets.

@motebaya
motebaya / yolo_img_crop.py
Last active April 7, 2025 07:01
crop images from all results face detection from: https://github.com/zymk9/yolov5_anime
#!/usr/bin/python
# crop image area with cv2
# @github.com/motebaya - 7/10/2024
import cv2
import os
import logging
logging.basicConfig(level=logging.INFO)
from argparse import ArgumentParser, RawTextHelpFormatter
from colorama.ansi import Fore
@motebaya
motebaya / merging.js
Created March 23, 2025 02:33
merge image using sharp JS : https://github.com/lovell/sharp
#!/usr/bin/node
/**
* @github.com/motebaya
* 2024-02-16 03:28:08.599531900 +0700
*/
import sharp from "sharp";
async function mergePanel(imageslist, output) {
return new Promise(async (resolve) => {
try {
#!/usr/bin/python
# 2/24/2025 - @github.com/motebaya
from PIL import Image
from io import StringIO
import pilgram
import os
ext_list = list(Image.registered_extensions().keys())
list_filters = [
-- https://github.com/yasugami/yasugami.github.io
-- 23/03/2025 - @github.com/motebaya
if arg[1] then
local code = assert(io.open(arg[1])):read("*a")
local f = io.open('.tmp.lua', "w")
if f then
local modcode = code:gsub('_ENV%[%"\\108\\111\\97\\100%"%]', "print"):gsub('%(%)', '')
f:write(modcode)
f:close()
end
@motebaya
motebaya / formatter.php
Created January 21, 2025 15:24
php-parser 4.x to format/beautify php code without any installed composer.
<?php
/**
* no need composer
* @github.com/motebaya - 2025-01-19 19:36:32.659806400 +0700
* @reff: https://github.com/pk-fr/yakpro-po/blob/master/include/classes/parser_extensions/my_autoloader.php
*/
namespace PhpParser;
@motebaya
motebaya / be_productive.py
Last active January 22, 2025 07:09
nee nee, my graden is gray de karappo njir...
#!/usr/bin/env python3
# do you wanna be a productive human?
# sugar grass with shining sunrise in your garden?
# @github.com/motebaya - 2024-06-16 23:16:23.729592300 +0700
import calendar, subprocess, time, random, sys, string
from datetime import datetime
from concurrent.futures import ThreadPoolExecutor, as_completed
import threading
@motebaya
motebaya / module_updater.py
Created January 8, 2025 01:57
simple way for check or update python library to latest version based pypi.org api
#!/usr/bin/env python3
# 10.10.2024 - python module version check
# © @github.com/motebaya
from typing import Any, Dict
import importlib.metadata
import requests, subprocess, sys
class ModuleManager:
@motebaya
motebaya / batch_decompile.py
Last active March 29, 2025 02:05
python ghidra scripts for batch decompiling
from ghidra.app.decompiler import DecompInterface
from ghidra.util.task import ConsoleTaskMonitor
import os
output_folder = "E:/reversing/output" # set output decompiled
if not os.path.exists(output_folder):
os.makedirs(output_folder)
decomp_interface = DecompInterface()
decomp_interface.openProgram(currentProgram)
@motebaya
motebaya / logging_test.rb
Created August 10, 2024 13:06
remove all unnecessary characters that are displayed in the console during debug mode for net/http or HTTParty. Related: https://github.com/jnunemaker/httparty/issues/806
#!/usr/bin/ruby
require 'logger'
class Logging
def initialize(progname:, level: Logger::INFO)
@logger = Logger.new($stdout, progname: progname)
@logger.level = level
end
@motebaya
motebaya / logger.py
Created August 8, 2024 05:47
a customization python logger for console log using logging module
#!/usr/bin/python3
# @github.com/motebaya - 2023.06.3 08:42:53 AM
# file: __logger__
import logging
from colorama.ansi import Fore
from typing import Union, Type
logging.addLevelName(logging.WARNING, f"{Fore.YELLOW}warning{Fore.RESET}")
logging.addLevelName(logging.DEBUG, f"{Fore.GREEN}debug{Fore.RESET}")