Skip to content

Instantly share code, notes, and snippets.

View OopsieWoopsie's full-sized avatar
🌷

Sheidy OopsieWoopsie

🌷
View GitHub Profile
package me.sheidy.mfgparse;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.LinkedHashMap;
import java.util.Map;
public class ParseMfgData {
public static Map<String, byte[]> parseMfgData(byte[] data) {
@OopsieWoopsie
OopsieWoopsie / cloudflare.sh
Created October 23, 2020 23:43
Only allow CloudFlare connections to your web server
#!/bin/bash
# This script downloads the actual list of CloudFlare's IPv4/6 ranges
# and allows them to connect to the 443 port (HTTPS) and drops
# connections from other addresses.
# This is to prevent DDoS attacks and attackers from using the "Host"
# header to identify your server backend address.
# download the lists and remove the trailing newline
ranges4=$(curl -s https://www.cloudflare.com/ips-v4 | head -c -1)
ranges6=$(curl -s https://www.cloudflare.com/ips-v6 | head -c -1)