Skip to content

Instantly share code, notes, and snippets.

View mertcangokgoz's full-sized avatar
👋
Hi

Mertcan GÖKGÖZ mertcangokgoz

👋
Hi
View GitHub Profile
import string
import time
import warnings
from pathlib import Path
from random import SystemRandom
import requests # pip install requests
import requests_random_user_agent # noqa: F401 # pip install requests-random-user-agent
from urllib3.exceptions import InsecureRequestWarning
@mertcangokgoz
mertcangokgoz / spf_check.py
Created August 31, 2022 03:12
Simple SPF Checker via dnspython
import dns.resolver # pip install dnspython
class SpfCheck:
def __init__(self, domain: str) -> None:
self.domain = domain
self.spf_record = self.get_spf_record(domain)
self.parsed_spf = self.get_assets(self.spf_record)
self.ip_address = self.enumerate_ips(self.spf_record)
@mertcangokgoz
mertcangokgoz / taxpayer_check.py
Last active November 12, 2022 09:37
Taxpayer checker via tesseract-ocr
import os
import shutil
import uuid
import pytesseract # pip install pytesseract and https://tesseract-ocr.github.io/tessdoc/Home.html
import requests # pip install requests
from PIL import Image # pip install pillow
from bs4 import BeautifulSoup # pip install beautifulsoup4
# Create a requests session
@mertcangokgoz
mertcangokgoz / detect_encodings.py
Created August 31, 2022 03:00
character encoding detection via chardet
import logging
from collections import namedtuple
from chardet import UniversalDetector # pip install chardet
logger = logging.getLogger(__name__)
Guess = namedtuple("Guess", ["encoding", "confidence"])
@mertcangokgoz
mertcangokgoz / benchmark
Created August 30, 2022 23:09
Ilkbyte Cloud [4 Core / 8 GB / 80 GB Disk] Benchmark Result
root@debian:~# curl -sL yabs.sh | bash
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2022-08-20 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Wed 31 Aug 2022 01:50:51 AM +03
Basic System Information:
@mertcangokgoz
mertcangokgoz / docker_cli.md
Created February 13, 2022 11:22
Docker CLI ve Docker Compose Notlarım

Docker CLI

docker build -t name .
docker run -p 8080:80 name 
docker run -d -p 8080:80 name 
docker exec -it [id] bash
docker ps 
docker stop <id>
docker ps -a
@mertcangokgoz
mertcangokgoz / aws_cli.md
Created February 12, 2022 18:48
Amazon AWS CLI Notlarım

EC2

aws ec2 describe-instances
aws ec2 describe-instances --instance-ids <instance1> <instance2>
aws ec2 describe-instances --filters Name=<instance_name>

aws ec2 start-instances --instance-ids <instance1> <instance2>
aws ec2 stop-instances --instance-ids <instance1> <instance2>
aws ec2 terminate-instances --instance-ids  
import requests
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
from random_useragent import random_useragent
class RequestsHelper(object):
"""HTTP Request helper"""
def __init__(self):
Get-EventLog -LogName Security -after (Get-date -hour 0 -minute 0 -second 0) | Where-Object { (4624, 4778) -contains $_.EventID -and $_.Message -match 'logon type:\s+(10)\s' } | % {
(new-object -Type PSObject -Property @{
TimeGenerated = $_.TimeGenerated
ClientIP = $_.Message -replace '(?smi).*Source Network Address:\s+([^\s]+)\s+.*', '$1'
UserName = $_.Message -replace '(?smi).*Account Name:\s+([^\s]+)\s+.*', '$1'
UserDomain = $_.Message -replace '(?smi).*Account Domain:\s+([^\s]+)\s+.*', '$1'
LogonType = $_.Message -replace '(?smi).*Logon Type:\s+([^\s]+)\s+.*', '$1'
})
} | Sort-Object TimeGenerated -Descending | Select-Object TimeGenerated, ClientIP `
, @{N = 'Username'; E = { '{0}\{1}' -f $_.UserDomain, $_.UserName } } `
/*
**
** derleme:
** gcc -O3 -DMAX_THREAD=8 tcnouretici.c -lpthread
**
** i7-4770k 8 thread
** ./a.out > /dev/null 0.02s user 0.01s system 473% cpu 0.008 total
** ./a.out > /dev/null 0.03s user 0.00s system 382% cpu 0.008 total
** ./a.out > /dev/null 0.03s user 0.00s system 484% cpu 0.007 total
** ./a.out > /dev/null 0.03s user 0.00s system 377% cpu 0.008 total