Skip to content

Instantly share code, notes, and snippets.

@thocell
thocell / is-cloudflare-ip.php
Created February 21, 2016 12:11 — forked from josuecau/is-cloudflare-ip.php
Check if a given IPV4 belongs to Cloudflare. Usage : `php is-cloudflare-ip.php 108.162.242.71`
<?php
/**
* Check if a given ip is in a network.
*
* @link https://gist.github.com/tott/7684443
*
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
*
#!/bin/bash
PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
else
apt-get update
apt-get install -y build-essential chrpath libssl-dev libxft-dev
apt-get install -y libfreetype6 libfreetype6-dev
apt-get install -y libfontconfig1 libfontconfig1-dev