Coderja 2 weeks ago
Coderja #coding

Logs Cleaner

Membersihkan Logs dan menyimpan yang di butuhkan saja

import re
import glob

# Define the patterns to search for and exclude
patterns = [
    {"pattern": r'wp-login\.php', "exclude_pattern": r'127\.0\.0|localhost|\.local|needrom|addon|UNKNOWN|null|000webhost|wordpress\.com|192\.168', "result_file": "wordpress.text"},
    {"pattern": r'\/wp-admin\/', "exclude_pattern": r'127\.0\.0|localhost|\.local|needrom|addon|UNKNOWN|null|000webhost|wordpress\.com|192\.168', "result_file": "wp-admin.text"},
    {"pattern": r'hostinger|weblink\.com\.br|hosting24\.com', "exclude_pattern": r'mail\.hostinger|webmail\.hostinger|webmail1|titan\.email|NOT_SAVED|UNKNOWN|joomla|needrom|null|telnet|fakepassword', "result_file": "hostinger.text"}
]

# Find all.txt files in the current directory
txt_files = glob.glob('*.txt')

# Iterate over the patterns
for pattern_dict in patterns:
    pattern = pattern_dict["pattern"]
    exclude_pattern = pattern_dict["exclude_pattern"]
    result_file = pattern_dict["result_file"]

    # Open the result file in append mode
    with open(result_file, 'a', encoding='utf-8') as result_file:
        for file in txt_files:
            with open(file, 'r', encoding='utf-8', errors='ignore') as f:
                for num, line in enumerate(f, 1):
                    if re.search(pattern, line) and not re.search(exclude_pattern, line, re.IGNORECASE):
                        result_file.write(f"{line.strip()}\n")



PHP script SRT to VTT Converter

PHP script SRT to VTT Converter

defaultuser.png
Coderja
3 days ago
Menghilangkan Spasi Di depan Baris

Menghilangkan Spasi Di depan Baris

defaultuser.png
Coderja
2 weeks ago

AWS DATA

defaultuser.png
Coderja
18 hours ago
Kumpulan Perintah PHP dari Internet

Kumpulan Perintah PHP dari Internet

defaultuser.png
Coderja
3 weeks ago
Text Line Replacer

Text Line Replacer

defaultuser.png
Coderja
2 weeks ago