Skip to content

Instantly share code, notes, and snippets.

@umutbasal
umutbasal / ports.sh
Last active January 30, 2025 16:21
Get top n TCP/UDP ports
ports(){
protocol=${1:-tcp}
count=${2:-65535}
curl -s https://svn.nmap.org/nmap/nmap-services | awk '!/^#/ && NF >= 3 && /'$protocol'/ {split($2, p, "/"); print p[1], $3}' | sort -k2,2nr | awk '{print $1}' | head -n $count | tr '\n' ',' | sed 's/,$//'
}
# Usage
# ports tcp 10 > ports.txt && naabu -ports-file=ports.txt -host 127.0.0.1
@umutbasal
umutbasal / securityfocus.com.worker.js
Created February 26, 2025 01:39
securityfocus.com.worker.js
const TIME_TRAVEL_DATETIME = "20250101"; // Format: yyyyMMdd
const WAYBACK_URL = "https://web.archive.org/web/";
const WAYBACK_URL_FORMAT = /https:\/\/web\.archive\.org\/web\/([0-9a-z_]+)\/(.*)/i;
const BASE_DOMAIN = "http://securityfocus.com";
export default {
async fetch(request, env, ctx) {
const url = new URL(request.url);
const path = url.pathname;
const cache = caches.default;
#!/bin/bash
set -e
DIRS=(
# npm / node
~/.tnpm/_cacache
~/.tnpm/_logs
~/.yarn/cache
~/.bun/install/cache
~/Library/pnpm/store
#!/bin/bash
set -euo pipefail
ROOT="${1:-$(pwd)}"
TARGETS=(
node_modules
target
build
dist
#!/bin/bash
set -euo pipefail
PATHS=(
~/Library/Developer/CoreSimulator/Caches
~/Library/Developer/CoreSimulator/Devices
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer/Xcode/iOS\ Device\ Logs
~/Library/Developer/Xcode/watchOS\ Device\ Logs
~/Library/Developer/Xcode/Products