Skip to content

Instantly share code, notes, and snippets.

View korcankaraokcu's full-sized avatar

Korcan Karaokçu korcankaraokcu

View GitHub Profile
@korcankaraokcu
korcankaraokcu / start_suspended.py
Created January 25, 2025 22:16
Start windows process in suspended state
import ctypes
import sys
class SuspendedProcess:
def __init__(self, executable_path):
"""Create a suspended process"""
self.kernel32 = ctypes.windll.kernel32
self.CREATE_SUSPENDED = 0x00000004
# Startup and process info structures (same as previous script)
@korcankaraokcu
korcankaraokcu / KqlValidator.cs
Created September 26, 2024 10:00
Validate KQL query
using Kusto.Language;
class Program
{
static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("Please provide a KQL query as a command-line argument.");
return;
youtube-dl.exe -ci --no-check-certificate --extract-audio --audio-format flac --output "%(uploader)s%(title)s.%(ext)s" "https://www.youtube.com/watch?v=d_mLFHLSULw&list=PLC964A164F76816FB"
@korcankaraokcu
korcankaraokcu / change_default_spacing.py
Created April 25, 2017 18:41
Changes default spacing and margin values by altering setter functions
from PyQt5.QtWidgets import QLayout, QSplitter, QBoxLayout, QFormLayout, QGridLayout, QLabel, QWidget
# QLayout-->setSpacing, setContentsMargins
QLayout_setSpacing_original = QLayout.setSpacing
QLayout.setSpacing = lambda self, *args: QLayout_setSpacing_original(self, 0)
QLayout_setContentsMargins_original = QLayout.setContentsMargins
QLayout.setContentsMargins = lambda self, *args: QLayout_setContentsMargins_original(self, 0, 0, 0, 0)
# QBoxLayout, QFormLayout, QGridLayout-->setSpacing, setVerticalSpacing, setHorizontalSpacing
QBoxLayout_setSpacing_original = QBoxLayout.setSpacing