Skip to content

Instantly share code, notes, and snippets.

@nirmalyaghosh
nirmalyaghosh / IPAddressGenerator
Created February 8, 2014 15:52
A random but realistic IP address generator. It makes use of country specific CIDR address files read from the resource directory. Files can be downloaded from http://www.ip2location.com/free/visitor-blocker in the CIDR format (each line is similar to 222.165.0.0/17). For the purpose of testing, a few CIDR addresses have been selected for a few …
package net.nirmalya.util.ipaddr;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.Scanner;
import org.apache.commons.net.util.SubnetUtils;
import org.slf4j.Logger;
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048