Skip to content

Instantly share code, notes, and snippets.

View MrCl0wnLab's full-sized avatar
🏠
Working from home

Mr. Cl0wn - H4ck1ng C0d3r MrCl0wnLab

🏠
Working from home
View GitHub Profile
@nil0x42
nil0x42 / subnetlist.py
Last active June 2, 2021 17:18
Quickly check if an IPv4 is contained in a list of subnets.
import struct
import socket
class SubnetList:
"""Quickly check if an IPv4 is contained in a list of subnets.
- by @nil0x42
- inspired by @nigel222's solution: https://stackoverflow.com/a/44264136
>>> cloudflare_ips = SubnetList("/wordlists/cloudflare-ips.txt")
>>> "103.31.4.12" in cloudflare_ips
True
@bmatheny
bmatheny / gist:991247
Created May 25, 2011 16:02
curl_multi speed for PHP
<?php
class CurlMulti
{
// Code from http://www.somacon.com/p537.php
public static function getMulti(array $urls)
{
// Create get requests for each URL
$mh = curl_multi_init();
foreach($urls as $i => $url)