Skip to content

Instantly share code, notes, and snippets.

View sitano's full-sized avatar

Ivan Prisyazhnyy sitano

View GitHub Profile
@wiktorbgu
wiktorbgu / Mikrotik-WireGuard-anti-DPI.md
Last active July 19, 2025 02:57
Mikrotik WireGuard anti DPI

Чуть подправил скрипт , чтобы лишний раз не бегал по клиентским пирам, которые подключаются к этому роутеру, а только где роутер как клиент.
Работает убойно! Proton и Warp пробивает)

Upd.: увеличил время в фильтре до 2м30с как защита от ложных срабатываний у медленных подключений.
Считаю выполнение скрипта раз в 2 минуты средним нормальным значением.
Так же добавил в скрипт закомментированную строку с возможность исключения какого-либо wg интерфейса из проверки.

For old ROS < 7.17: у пиров изменили свойство is-responder на responder! добавил закоментированную строку в скрипт.

@httpsx
httpsx / WireGuard DPI обход РКН - Windows.md
Last active August 4, 2025 13:01
WireGuard DPI обход РКН - Windows

Для обхода блокировки достаточно отправить 1 любой udp пакет, тем самым нарушим начальное определение протокола WireGuard
Способ с использованием Windows PowerShell. Без скачивания Nmap и подобного софта.

Шаг 0: Отключитесь от всех туннелей.

Шаг 1: Редактируем Клиент конфиг

Добавим в него "ListenPort", это позволит иметь статичный порт на котором будет работать WireGuard
Нажмите ПКМ на нужный "туннель" и выберите "Редактировать выбранный туннель..." Step1

После DNS добавляем новую строку

@sitano
sitano / leetcode_helpers.cc
Last active July 9, 2025 08:35
leetcode c++ headers
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,mmx,abm,popcnt,tune=native")
int const _ = [] { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); return 0; } ();
template <class T> using vec = vector<T>;
using T = TreeNode;
using ll = long long;
using vi = vec<int>;
@lalitmee
lalitmee / settings.lua
Created March 29, 2021 10:59
nvim settings
local fn = vim.fn
local api = vim.api
local executable = function(e)
return fn.executable(e) > 0
end
local opts_info = vim.api.nvim_get_all_options_info()
local opt = setmetatable(
{}, {
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active July 30, 2025 14:42
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like [Unreal](https:

@rigred
rigred / PCI-e_bus_bandwidth_calc.md
Last active June 15, 2023 13:10
PCI-e bus bandwidth calculation

How PCI-e bandwidth and actual true data bandwidth can be calculated.

PCI-e 1.x uses an 8/10b encoding scheme, so to send 8 bits of data, 10 bits of encoded data must be transfered. 2 of those bits are there as error checking and correction bits to account for interference which is very common on fast buses. SATA btw also uses 8b/10b encoding, you loose 20% of bandwidth (1-8/10) to get the data across.

PCI-e 1.0 is clocked at 2.5Ghz, it sends 1 bit per clock cycle and each lane corresponds to a 1 bit bi-directional serial channel. Which is kind of neat since here 'Gigatransfers' indicate 1 bit transfered for every clock cycle. This should immediately tell us that unlike FSB which transfers multiple bts per cycle in a parallel fashion, PCI-e is serial, since we are sequentially throwing 1 bit of data per cycle onto the bus and it takes multiple cycles to send a full byte. While on a parallel bus multiple bytes can be sent per cycle.

unsigned integers

-O3

|               ns/op |                op/s |   MdAPE | benchmark
|--------------------:|--------------------:|--------:|:----------------------------------------------
|                3.03 |      329,748,861.72 |    3.2% | `(a + b) / 2`
|                3.01 |      332,744,047.95 |    4.1% | `a + ((b - a) / 2)`
|                3.01 |      331,690,526.09 |    2.3% | `A/2 + B/2 + (A & B & 1)`
|                3.13 |      318,986,706.11 |    2.3% | `std::midpoint()`
@lcarsos
lcarsos / restore_functionality.sh
Last active February 27, 2025 13:44
Repeatedly kill sentinelone so you can actually use the processor and ram on your mac
#!/usr/bin/env bash
# Usage: sudo ./restore_functionality.sh
#ps aux | grep sentinel | awk -F " +" '{print $2}' | xargs kill
while true; do
launchctl kill SIGKILL system/com.crowdstrike.falcond
launchctl kill SIGKILL system/com.crowdstrike.userdaemon
launchctl kill SIGKILL system/com.sentinelone.sentineld
launchctl kill SIGKILL system/com.sentinelone.sentineld-helper
@limitedeternity
limitedeternity / source.js
Last active September 2, 2021 11:17
Decrypt m3u8 files from play.boomstream.com/player.html
// FileSaver.min.js
(function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Depricated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;return b.open("HEAD",a,!1),b.send(),200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof