Skip to content

Instantly share code, notes, and snippets.

@ofgulban
ofgulban / pyvista_360.py
Created October 24, 2021 11:23
Generate 360 rotating with pyvista
"""Used for rendering frames as png files."""
import sys
import os
import numpy as np
import pyvista as pv
import nibabel as nb
FILENAME = "/path/to/image3D.nii.gz"
OUTDIR = "/path/to/output"
@avamsi
avamsi / irctc.py
Last active April 28, 2025 15:05
Python script to semi-automate tatkal ticket booking.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select, WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from time import sleep, strftime
def waituntil(s):
while strftime('%H:%M:%S') < s:
print strftime('%H:%M:%S')
sleep(1)
@wmealing
wmealing / C-states.md
Last active April 28, 2025 15:03
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered:

@albinowax
albinowax / race-condition-probe.java
Last active April 28, 2025 15:02
Race condition custom action for Burp Repeater
// This will use the single-packet attack for HTTP/2, and last-byte synchronisation for HTTP/1
int NUMBER_OF_REQUESTS = 10;
var reqs = new ArrayList<HttpRequest>();
for (int i = 0; i < NUMBER_OF_REQUESTS; i++) {
reqs.add(requestResponse.request());
}
var responses = api().http().sendRequests(reqs);
var codes = responses.stream().map(HttpRequestResponse::response).filter(Objects::nonNull).map(HttpResponse::statusCode).toList();
logging().logToOutput(codes);
@fellipec
fellipec / pihole-dhcp.md
Last active April 28, 2025 15:02
Pi-Hole DHCP configuration guide

Introduction

Pi-Hole's primary function is to be a DNS server with the ability to block domains, usually used for advertising, tracking or other unwanted sites. It also features a built-in DHCP Server.

Usually, your router will also have a built-in DHCP server, pre-configured from factory, and for most users this is perfectly fine. But in some cases you may want to run another DHCP server instead of relying on your router's one. This guide will help you understand how a DHCP server works and how to configure it without disturbing your network.

If you already know the networking basics, you can cut to the chase and read just the configuration part

Understanding the IP Addressing

Note

为简化无关环节,部分细节可能会省去,而进一步的深入解释将标记在 NOTE 内。 如果这是您第一次了解 MethodHandle 和 VarHandle,可直接掠过这些部分。

Tip

本文将用 TIP 标记您需要使用刚刚学到的技能实践的部分。 边学边练,效果 ++。

零开销·反射

OpenWRT-NPTv6-scripts

LICENSE

WTFPL

Note

  • File iptables-nptv6.sh is tested on OpenWRT 19.07 it's use iptables as network filter tool.
  • File nptv6.sh is tested on OpenWRT 23.05, and use nftables as network filter tool. It also keep iptables compatibility but no tested. If have any issue, please comment at below (suggested) or email me.
@gugazimmermann
gugazimmermann / phone-code-en.json
Created November 27, 2023 13:48
Array with Countries, Phone Codes, and Flag Emoji
[
{
"name": "Afghanistan",
"code": "AF",
"phoneCode": "+93",
"flagEmoji": "🇦🇫"
},
{
"name": "Aland Islands",
"code": "AX",
@bizz84
bizz84 / flutter_bootstrap.js
Created May 21, 2024 08:40
Custom Flutter Web App Initialization Logic with CSS Loader
{{flutter_js}}
{{flutter_build_config}}
// Manipulate the DOM to add a loading spinner will be rendered with this HTML:
// <div class="loading">
// <div class="loader" />
// </div>
const loadingDiv = document.createElement('div');
loadingDiv.className = "loading";
document.body.appendChild(loadingDiv);
@mvtenorio
mvtenorio / config_linux.md
Last active April 28, 2025 14:55
Configuração do meu ambiente Linux