Skip to content

Instantly share code, notes, and snippets.

Diego Parrilla diegoparrilla

View GitHub Profile
View medium-validation-apilityio
{
"response": {
"score": 0,
"ip": {
"score": 0,
"blacklist": [],
"is_quarantined": false,
"address": "35.189.84.182"
},
"address": {
@diegoparrilla
diegoparrilla / aws-lambdaedge-apilityio-add-header.js
Created Aug 23, 2018
Using AWS Lambad@edge and Cloudfront with https://Apility.io API to add to the request headers information of the blacklists of abusers that contains the IP address of the client.
View aws-lambdaedge-apilityio-add-header.js
'use strict';
const http = require('http');
exports.handler = (event, context, callback) => {
var startTime = new Date();
const request = event.Records[0].cf.request;
let clientIp = request.clientIp;
var options = {
host: "api.apility.net",
path: "/badip/" + clientIp,
@diegoparrilla
diegoparrilla / cloudflare-workers-block-europeans.js
Created May 25, 2018
Using Cloudflare Workers and https://Apility.io API to block access to the pages filtered if the IP belongs to an European country because of the GDPR.
View cloudflare-workers-block-europeans.js
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckOrigin(event.request))
})
async function fetchAndCheckOrigin(req) {
try {
const body = await req.body;
const ip = req.headers.get('cf-connecting-ip');
const apilityio = await fetch('https://api.apility.net/badip/' + ip + '?token=APILITY_IO_API_KEY');
@diegoparrilla
diegoparrilla / cloudflare-workers-block-blacklisted.js
Created May 11, 2018
Using Cloudflare Workers and https://Apility.io API to block access to the pages filtered if the IP belongs to a blacklisted IP address of the service
View cloudflare-workers-block-blacklisted.js
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckOrigin(event.request))
})
async function fetchAndCheckOrigin(req) {
try {
const body = await req.body;
const ip = req.headers.get('cf-connecting-ip');
const apilityio = await fetch('https://api.apility.net/badip/' + ip + '?token=APILITY_IO_API_KEY');
@diegoparrilla
diegoparrilla / cloudflare-workers-apilityio.js
Last active Aug 27, 2018
Using Cloudflare Workers and https://Apility.io API add to the request headers information of the blacklists of abusers that contains the IP address of the client.
View cloudflare-workers-apilityio.js
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckOrigin(event.request))
})
async function fetchAndCheckOrigin(req) {
try {
startTime = new Date();
const body = await req.body;
const ip = req.headers.get('cf-connecting-ip');
const es = req.headers.get('cf-ipcountry');
View custom-disposable-email-domains.txt
riseup.net
e.sino.tw
e.ycn.ro
g.tiv.cc
o.civx.org
mx.dnses.ro
dr.vankin.de
mx.dnses.ro
mx1.dnses.ro
mx2.dnses.ro
View disposable-email-provider-domains
0815.ru
0wnd.net
0wnd.org
10minutemail.co.za
10minutemail.com
123-m.com
1fsdfdsfsdf.tk
1pad.de
20minutemail.com
21cn.com
View ruby_ang_gems_version.log
MacBook-Air-de-Diego:bosh-bootstrap diego$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
MacBook-Air-de-Diego:bosh-bootstrap diego$ gem list bosh
*** LOCAL GEMS ***
bosh-director-core (1.2685.0, 1.2681.0, 1.2671.0)
bosh-registry (1.2685.0, 1.2681.0, 1.2671.0)
bosh-stemcell (1.2685.0, 1.2681.0, 1.2671.0)
View bosh-bootstrap-second-run.log
MacBook-Air-de-Diego:bosh-bootstrap diego$ ./bin/bosh-bootstrap deploy
Using provider OpenStack
Confirming: Using OpenStack (user: XXXXXXXX)
Confirming: Using address 10.0.61.66
Reusing security group ssh
-> no additional ports opened
View bosh-script-first-execution.log
MacBook-Air-de-Diego:bosh-bootstrap diego$ ./bin/bosh-bootstrap deploy
1. AWS
2. OpenStack
3. vSphere
Choose your infrastructure: 2
Using provider OpenStack
Username: XXXXXXXXXXX
Password: XXXXXXXXXXX
Tenant: XXXXXXXXX
You can’t perform that action at this time.