Skip to content

Instantly share code, notes, and snippets.

View amihaiemil's full-sized avatar
☄️
Implementing objects.

Mihai A. 🇷🇴🇩🇪🇬🇧🇫🇷 amihaiemil

☄️
Implementing objects.
View GitHub Profile
@madan712
madan712 / IPRangeChecker.java
Created September 21, 2013 16:21
Java program to check IP address range. This is a simple java program to check IP address range. Here we provide a IP address to check whether it lies between start and end IP address.
import java.net.InetAddress;
import java.net.UnknownHostException;
public class IPRangeChecker {
public static long ipToLong(InetAddress ip) {
byte[] octets = ip.getAddress();
long result = 0;
for (byte octet : octets) {
result <<= 8;
@zak905
zak905 / AmazonS3TestClient.java
Created June 22, 2017 08:55
lightweight version of AmzonS3Client(AWS SDK) that can be used in tests with S3Ninja
public class AmazonS3TestClient extends AmazonS3Client {
private static Log log = LogFactory.getLog(AmazonS3TestClient.class);
String testBucketName = "yourBucketName";
public AmazonS3TestClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
super(new StaticCredentialsProvider(awsCredentials), clientConfiguration);
}