Skip to content

Instantly share code, notes, and snippets.

Hacking Cloud Foundry

Lakshman Diwaakar lakshmantgld

Hacking Cloud Foundry
View GitHub Profile
lakshmantgld / serverless.yml
Created Oct 21, 2016
dynamoDB in serverless.yml
View serverless.yml
Type: "AWS::DynamoDB::Table"
- AttributeName: "eventId"
AttributeType: "S"
- AttributeName: "googleUserName"
AttributeType: "S"
lakshmantgld / index.html
Created Mar 16, 2017 — forked from stesie/index.html
AWS IoT-based serverless JS-Webapp Pub/Sub demo
View index.html
<!doctype html>
<meta charset="UTF-8">
<title>AWS IoT Pub/Sub Demo</title>
<h1>AWS IoT Pub/Sub Demo</h1>
<button type="button" id="connect">connect!</button>

How to setup AWS lambda function to talk to the internet and VPC

I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.

So it might be really unintuitive at first but lambda functions have three states.

  1. No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
  2. VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
  3. VPC with NAT, The best of both worlds, AWS services and web.
lakshmantgld /
Last active May 25, 2022
Free Sales Tax API based on Postal code by Avalara

Sales Tax API

There are many companies providing sales tax API. Out of all the companies, Avalara offers free API service for sales Tax. This gist is all about setting up avalara API and querying it.

The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code 429 - Too Many Requests. The requirement for this API is to create an avalara free trail account. You can create a free account using this link create free account.

Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:

Avalara e-mail

lakshmantgld /
Last active May 21, 2018
Documenting cronJob with examples

Cron is an utility program which is a time-based job scheduler in Unix-like computer operating systems. It can also be combined with AWS Lambda to invoke function based on the time-scheduler.

CronJob is represented as space-delimited 5 character string. Here is the syntax:

+---------------- minute (0 - 59)
 |  +------------- hour (0 - 23)
 |  |  +---------- day of month (1 - 31)
 | | | +------- month (1 - 12)
lakshmantgld /
Last active Nov 25, 2021
Configuring slack webhook

A Webhook, in simple terms, is a user-defined HTTP callback. It is a mechanism for the system to notify you about an event. In our case, we need to send messages to a particular channel in slack. Slack calls in Incoming Webhook. It is a mechanism to send messages to your Slack Channel from external sources. These external sources could be any application or service that is capable of sending a JSON payload over HTTP into a Slack Channel. Each Channel will be identified by a unique Incoming Webhook URL to which you can post the message from outside. This configuration is done via the Integrations for your channel.

Steps to create a incoming webhook in Slack:

  1. Naviagte to the Incoming Webhook URL. Click the hyper link incoming webhook integration below the heading Incoming Webhooks.
  2. You will be asked to enter your team URL, followed by your slack credentials.
  3. Once you have completed the above step, you will see the wizard kind of webpage to
lakshmantgld / buildspec.yml
Last active Jun 30, 2018
config file for the codeBuild
View buildspec.yml
version: 0.2
# Yarn installation
- curl -sS | sudo apt-key add -
- echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get -y update
- apt-get install -y yarn
View serverless.yml
service: stakinet-wakeup
name: aws
runtime: nodejs6.10
cfLogs: true
timeout: 20
View handler.js
if (!global._babelPolyfill) require('babel-polyfill');
import { Promise as bbPromise } from 'bluebird';
import AWS from 'aws-sdk';
const lambda = new AWS.Lambda({
region: 'ap-northeast-1'
module.exports.wakeup = (event, context, callback) => {
lakshmantgld / cloudSettings
Last active Oct 23, 2017
Visual Studio Code Settings Sync Gist
View cloudSettings