Skip to content

Instantly share code, notes, and snippets.

View maesoser's full-sized avatar
:shipit:

Sergio maesoser

:shipit:
View GitHub Profile
@maesoser
maesoser / cf-azure-list-updater.js
Created July 1, 2025 09:01
Cloudflare Workers script that fetches Microsoft Azure Service Tags JSON, extracts IP addresses for a specified service (like ApplicationInsightsAvailability), and automatically updates a Cloudflare IP list via API.
// Cloudflare Workers script to update IP lists from Microsoft Service Tags
// Configure these environment variables in your worker:
// - CLOUDFLARE_API_KEY: Your Cloudflare API key
// - CLOUDFLARE_ACCOUNT_ID: Your Cloudflare account ID
// - CLOUDFLARE_LIST_ID: The ID of the list to update
// - SERVICE_NAME: The service name to filter (e.g., "ApplicationInsightsAvailability")
const MICROSOFT_SERVICE_TAGS_URL = 'https://download.microsoft.com/download/7/1/d/71d86715-5596-4529-9b13-da13a5de5b63/ServiceTags_Public_20250616.json';
export default {
@maesoser
maesoser / cloudflare-perf-exporter.js
Last active July 1, 2025 08:59
Performance exporter worker
export default {
async fetch(request, env, ctx) {
const ACCOUNT_TAG = env.CLOUDFLARE_ACCOUNT_TAG || '';
const API_TOKEN = env.CLOUDFLARE_API_TOKEN || '';
// Only handle GET requests to the metrics endpoint
if (request.method !== 'GET') {
return new Response('Method not allowed', { status: 405 })
}
#!/bin/bash
# install the smartctl package first! (apt-get install smartctl)
if sudo true
then
true
else
echo 'Root privileges required'
@maesoser
maesoser / sitespeed.sh
Created April 20, 2025 23:06
sitespeed
#!/usr/bin/env bash
function sitespeed {
docker run --rm \
-v "$1" \
--add-host=${2}:${3} \
sitespeedio/sitespeed.io:33.6.1 "$4" \
--outputFolder /home/chrome/reports \
--plugins.add analysisstorer \
--summary-detail \
@maesoser
maesoser / threat_intel_sources.md
Last active March 25, 2025 11:56
Threat Intelligence Sources
#!/usr/bin/env python3
'''
atlas-dig --country ES --probes 3 www.google.es
'''
import urllib3
import requests, argparse, base64, json, os
from time import sleep
from tabulate import tabulate
@maesoser
maesoser / qbitorrentctl
Created March 8, 2024 09:16
It resumes or pauses all downloads while using qbittorrent
#!/usr/bin/env bash
# 0 23 * * * qbitorrentctl start
# 0 8 * * * qbitorrentctl stop
url="http://127.0.0.1:8080"
passwd="password"
user="user"
if [ "$#" -ne 1 ]; then
@maesoser
maesoser / dnsdiscover
Last active March 28, 2024 13:36
Simple dictionary based subdomain discovery tool
#! /usr/bin/env python3
import dns.resolver
from tabulate import tabulate
from multiprocessing.dummy import Pool
from random import shuffle
import ipaddress, argparse
CEND = '\33[0m'
@maesoser
maesoser / ifblinkd.c
Created December 23, 2022 00:33
Armbian/Raspberry led blink daemon
#include <wiringPi.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define TRAFFIC_TRESH 64
#define BLINK_DELAY 83
#define TX_LED 7 // GREEN
#define RX_LED 0 // RED
@maesoser
maesoser / banner-scan
Last active March 4, 2024 08:00
Fast and small multithreading http scanner and html title grabber
#!/usr/bin/env python3
'''
python3 -u titleget --ports 8080 80 443 8443 5601 3000 1900 9000 4444 9090 7777 5555 2332 8888 6002 6001 8000 80 1234 7001 50100 3128 20183 \
--threads 512 \
--input targets --output targets.json
'''
import urllib3