Skip to content

Instantly share code, notes, and snippets.

View asanka-x's full-sized avatar

Asanka Nissanka asanka-x

View GitHub Profile
@asanka-x
asanka-x / aws-sample-fraud-detector.js
Last active August 9, 2020 16:58
AWS fraud detector event prediction using nodejs
const AWS = require('aws-sdk');
const fraudDetector = new AWS.FraudDetector({
region:'us-east-1'
});
let params = {
detectorId: 'user_registration_fraud_detector',
entities: [
{
entityId: 'unknown',
const cdk = require('@aws-cdk/core');
const sqs = require('@aws-cdk/aws-sqs');
const apigateway = require('@aws-cdk/aws-apigateway');
const iam = require('@aws-cdk/aws-iam');
const lambda = require('@aws-cdk/aws-lambda');
const {SqsEventSource} = require('@aws-cdk/aws-lambda-event-sources');
const path = require('path');
class AwsAsyncApiWithCdkStack extends cdk.Stack {
/**
@asanka-x
asanka-x / cf_template.yaml
Last active October 7, 2019 03:49
cloud formation template to provision asynchronous api using API Gateway, SQS and Lambda
Resources:
asyncApiMessageDLQ23A9B11D:
Type: AWS::SQS::Queue
Metadata:
aws:cdk:path: AwsAsyncApiWithCdkStack/asyncApiMessageDLQ/Resource
asyncApiMessageQueue8EE5ED5B:
Type: AWS::SQS::Queue
Properties:
RedrivePolicy:
deadLetterTargetArn:
@asanka-x
asanka-x / haproxy.conf
Last active December 15, 2015 03:59 — forked from gburd/haproxy.conf
# Documentation for HAProxy
# http://code.google.com/p/haproxy-docs/w/list
# http://haproxy.1wt.eu/download/1.2/doc/architecture.txt
# NOTES:
# open files limits need to be > 256000, use ulimit -n to set (on most POSIX systems)
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice