Skip to content

Instantly share code, notes, and snippets.

View ioxorg's full-sized avatar

Alireza ioxorg

  • United Arab Emirates
  • 20:25 (UTC +04:00)
View GitHub Profile
from scapy.all import IP, ICMP, sr1
import time
from datetime import datetime
import statistics
from rich.console import Console
from rich.table import Table
from rich.panel import Panel
from rich.progress import Progress, TextColumn, BarColumn, TimeElapsedColumn
import threading
@ioxorg
ioxorg / block_bittorrent.sh
Created March 6, 2025 20:01
Block BitTorrent via iptabls.
#!/usr/bin/env bash
echo "Applying Torrent blocking rules..."
# Block Torrent algo string using Boyer-Moore (bm)
BLOCK_STRINGS_BM=(
"BitTorrent"
"BitTorrent protocol"
"peer_id="
".torrent"
"announce.php?passkey="
"torrent"
import os
import requests
import logging
import time
# Replace with your own values
MP3_FOLDER_PATH = ''
TELEGRAM_TOKEN = ''
TELEGRAM_CHANNEL_ID = ''
@ioxorg
ioxorg / a_star_search_implementaion.py
Created February 18, 2024 06:28
Implementation of a 8 to 8 path of finding the best way from a vector to b vector.
import random
import heapq
# Define the Cell class
class Cell:
def __init__(self):
self.parent_i = 0 # Parent cell's row index
self.parent_j = 0 # Parent cell's column index
self.f = float('inf') # Total cost of the cell (g + h)
self.g = float('inf') # Cost from start to this cell
@ioxorg
ioxorg / ingress.yml
Created August 27, 2023 07:21
Ingress AllowAccess ip ranges
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 1
selector:
@ioxorg
ioxorg / sysctl.conf
Created June 21, 2023 21:02
sysctl tweaks for high load usahes
### IMPROVE SYSTEM MEMORY MANAGEMENT ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@ioxorg
ioxorg / CLocalApiClient.diff
Created May 7, 2023 11:19
ugly CLocalApiCLient.php patch
--- /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php.orig 2023-03-08 16:23:26.555055621 +0100
+++ /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php 2023-03-08 16:22:46.378217849 +0100
@@ -128,6 +128,13 @@
$newTransaction = true;
}
+ // UGLY GRAFANA DATASOURCE HACK
+ // rename "user" param to "username" when present
+ if ($params['user'] ?? null) {
+ $params['username'] = $params['user'];
#!/bin/bash
read -p 'Enter Email : ' email
read -p 'Enter Domain : ' domain
function install_socat() {
apt install socat -y
}
function install_acme() {
curl https://get.acme.sh | sh
const best_ips = 'http://bot.sudoer.net/best.cf.iran.all'
let operator_to_ips = {};
const https_ports = [443, 2053, 2083, 2087, 2096, 8443]
const subLink = 'https://raw.githubusercontent.com/mahdibland/ShadowsocksAggregator/master/sub/sub_merge.txt';
const alpns = ['h2', 'http/1.1', 'h2,http/1.1', ''];
const useragents = ['chrome', 'firefox', 'safari', 'random', 'randomized']
export default {
async fetch(request) {
let url = new URL(request.url);
#!/bin/bash -e
usage(){
echo "kubectl ssh <pod_name> [-n | --namespace] [-u | --user] [<ssh-parameters>]"
}
get_node_ip(){
pod_name=$1
namespace=$2