Skip to content

Instantly share code, notes, and snippets.

View chak10's full-sized avatar
🏠
Working from home

chak10 chak10

🏠
Working from home
View GitHub Profile
@chak10
chak10 / main.py
Last active November 10, 2024 13:04
This Python script attempts a brute-force attack on a password-protected RAR file by generating all possible password combinations up to a specified length and testing each one using 7-Zip, leveraging multiprocessing for improved performance.
import subprocess
import itertools
import string
import time
import os
import logging
from multiprocessing import Pool, cpu_count, Manager
# Configurazione dei logger
logger = logging.getLogger()
@chak10
chak10 / combine_hashes.py
Last active October 27, 2024 10:59
La funzione `combine_hashes_mode` è progettata per combinare hash di immagini utilizzando la modalità per ciascun bit. Questa funzione consente di gestire diversi hash generati da immagini simili, identificando anche immagini completamente nere o bianche.
import imagehash
from PIL import Image
import numpy as np
def combine_hashes_mode(*hashes):
"""
Combina più hash di immagini utilizzando la modalità per ciascun bit.
Controlla anche se un'immagine è completamente nera o bianca.
Parameters:
@chak10
chak10 / led.txt
Created September 5, 2020 10:19
LED RESISTOR
GIALLO -> 2.2K
VERDE -> 20K
ROSSO -> 3.3K
from decimal import *
n = 1e4
def factorial(n):
fact = 1
for i in range(1, int(n) + 1):
fact = fact * i
return fact
@chak10
chak10 / sodium_encrypt.php
Created June 13, 2019 17:41
Encrypt-decrypt string with Sodium
<?php
function encrypt($message, $pass)
{
$alg = SODIUM_CRYPTO_PWHASH_ALG_DEFAULT;
$opslimit = SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE;
$memlimit = SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE;
$final = $salt = openssl_random_pseudo_bytes(SODIUM_CRYPTO_PWHASH_SALTBYTES);
$secret_key = sodium_crypto_pwhash(SODIUM_CRYPTO_SECRETBOX_KEYBYTES, $pass, $salt, $opslimit, $memlimit, $alg);
$final .= hash_hmac('sha3-256', $message, $secret_key, true);
@chak10
chak10 / openweatherapi.php
Last active August 17, 2018 13:37
Current condition
<?php
class OpenWeatherMap
{
var $api;
/**
* OpenWeatherMap constructor.
* @param $a
*/
@chak10
chak10 / altitude.py
Last active June 27, 2018 13:55
BMP280 + example
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import requests
from bmp280 import *
geo = "" #coordin sea
d_api = "" #api darksky
@chak10
chak10 / rapidgator_api.php
Last active October 26, 2023 11:39
Class based on Rapidgator Api
<?php
class Rg {
/*
Based on Rapidgator Api
https://support.rapidgator.net/index.php?/Knowledgebase/Article/View/89/9/do-you-have-api
*/
@chak10
chak10 / bme280.py
Last active June 21, 2017 07:49
Weather Python
#!/usr/bin/python
#--------------------------------------
# ___ ___ _ ____
# / _ \/ _ \(_) __/__ __ __
# / , _/ ___/ /\ \/ _ \/ // /
# /_/|_/_/ /_/___/ .__/\_, /
# /_/ /___/
#
# bme280.py
#
@chak10
chak10 / curl.php
Last active June 9, 2017 21:04
CURL MEGA CLASS PHP
<?php
namespace Curl;
class Curl {
const VERSION = '7.3.0';
const DEFAULT_TIMEOUT = 30;
public $curl;
public $id = null;