Skip to content

Instantly share code, notes, and snippets.

'use strict';
const net = require('node:net');
const tls = require('node:tls');
const fs = require('node:fs');
const http2 = require('node:http2');
const dns = require('node:dns/promises');
const socketpair = require('unix-socketpair');
const capnp = require('../node-capnp');
@isaumya
isaumya / cloudflare-cdn-routing-anomaly-detailed-test.md
Created February 28, 2021 12:35
Cloudflare CDN Routing Anomaly detailed test across multiple DNS resolvers

Cloudflare CDN Routing Anomaly Detailed Test Across Multiple DNS Resolvers

Here are some key details about my testing location and ISP:

Important Note: Keep an eye on the value of colo on the following response. As that value will show exactly from which Cloudflare CDN edge the data is getting served from. Moreover these 3 letter colo values are basically the IATA airport code on that city. So, you can use a website like World Airport Codes to find out the exact City and Country Name.

@plockaby
plockaby / database.py
Last active January 7, 2024 15:49
Python Flask Connection Pool
import logging
import psycopg2
from psycopg2.extras import RealDictCursor
from psycopg2.extensions import TRANSACTION_STATUS_UNKNOWN, TRANSACTION_STATUS_IDLE
from flask import g
import threading
import tenacity
import uuid
import pwd
import os
@phillipkent
phillipkent / convert-docx.py
Last active November 7, 2023 09:19
Python code using the python-docx module to convert a DOCX file to another DOCX file
# Converts a docx file with tables and images to a new docx file
# The new file is based on a 'stub' document which contains preamble text and styles
#
# Requires the Python module 'python-docx' <https://python-docx.readthedocs.io>
# Written for Python 3
#
# Source documents are taken from the directory 'source' and converted documents are saved
# to the directory 'converted'
#
# Two types of source documents are handled: 'Fiscal Guide' or 'Economics Regime'. Each one
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 24, 2024 11:23
crack activate Office on mac with license file
@sbuzonas
sbuzonas / nginx-cors.conf
Created September 8, 2015 15:36
Nginx CORS maps
map $http_origin $allow_origin {
default "";
"~^https?://(?:[^/]*\.)?(stevebuzonas\.(?:com|local))(?::[0-9]+)?$" "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}
@rcoup
rcoup / rsync_parallel.sh
Created April 10, 2013 21:52
Parallel-ise an rsync transfer when you want multiple concurrent transfers happening,
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes: