Skip to content

Instantly share code, notes, and snippets.

@wzrayyy
wzrayyy / vpn.sh
Created April 21, 2025 08:26
control openwrt pbr
#!/bin/sh
help() {
echo 'up/down [DEVICE]'
echo 'status [DEVICE]'
}
is_available() {
uci show pbr | grep -q "pbr.$1=policy"
}
@wzrayyy
wzrayyy / tester.py
Last active April 21, 2025 08:26
Tester for lab1.1
# Runs the entire test suite by default
# + | a - addition
# - | s - subtraction
# * | m - multiplication
# / | d - division
# p - printing
# -q - quiet mode
# -s - stop after the first failed test and copy it to clipboard (linux only)
import os
@wzrayyy
wzrayyy / poller.py
Last active May 13, 2025 18:14
Poll any website
import json
import random
import time
import requests
from collections.abc import Callable, Generator
from dataclasses import dataclass
from enum import Enum
from typing import Any
class Poller:
@wzrayyy
wzrayyy / git-gpt.py
Last active January 9, 2025 18:05
Git commit with GPT generated commit message
#!/usr/bin/env python3
# Usage:
# git gpt [-c COUNT] - Generate commit message with OpenAI GPT-4o-mini
# Installation
# 1. Install this script somewhere in `$PATH`
# 2. Create `${HOME}/.secrets/openai.secret` and put your OpenAI api key there
# 3. Run `git gpt`
import os
@wzrayyy
wzrayyy / lh.py
Created December 6, 2024 09:48
Looking house IP scraper
import bs4
import requests
import re
URL = input("URL: ")
p = re.compile(r"<.*")
p2 = re.compile(r"(\d+\.?){4}")
s = bs4.BeautifulSoup(requests.get(URL).text, features='lxml')
for item in s.select("a.btn.btn-default.btn-block"):