Skip to content

Instantly share code, notes, and snippets.

View KevinAlavik's full-sized avatar

Kevin Alavik KevinAlavik

View GitHub Profile
CC ?= gcc
CFLAGS := -Wall -Wno-newline-eof -pedantic -Werror -Wshadow -Wstrict-aliasing -Wstrict-overflow -O3
LDFLAGS :=
BIN_DIR := bin
OBJ_DIR := build
SRC_DIR := src
DESTDIR ?= /usr/local/bin
TARGET_NAME := main
@KevinAlavik
KevinAlavik / BlockGPT.py
Created August 1, 2024 08:28
Blocks any traffics to chatgpt (only for linux) using the iptables command. This blocks traffic when running and unblocks when stoped
import os
import sys
import time
BLOCKED_DOMAIN = "chatgpt.com"
def block_traffic():
try:
os.system(f"sudo iptables -A OUTPUT -p tcp -d {BLOCKED_DOMAIN} -j REJECT")
os.system(f"sudo iptables -A OUTPUT -p udp -d {BLOCKED_DOMAIN} -j REJECT")
@KevinAlavik
KevinAlavik / BlockGPT-GUI.py
Created August 1, 2024 09:17
A python program to block chatgpt on linux (this uses the iptables command to block and unblock GPT) this uses tkinter for UI
import tkinter as tk
import subprocess
import logging
logging.basicConfig(filename='/home/kevin/Kod/BlockGPT/block_gpt.log', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
class BlockerApp:
def __init__(self, root):
self.root = root
self.root.title("ChatGPT Blocker")
@KevinAlavik
KevinAlavik / scrapper.py
Last active January 9, 2025 11:53
Myrient Scrapper, simple web-scrapper to download games (ROMS) from Myrient (https://myrient.erista.me), you can tweak the variables to change region and game type.
import os
import requests
from bs4 import BeautifulSoup
from urllib.parse import urljoin, unquote
import logging
import colorlog
from concurrent.futures import ThreadPoolExecutor
from time import time
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry