Skip to content

Instantly share code, notes, and snippets.

@sankar2389
sankar2389 / main.tf
Created January 2, 2023 14:32 — forked from AHaydar/main.tf
Terraform example for DynamoDB table, Lambda, and IAM to allow the Lambda to scan the table
provider "aws" {
profile = "default"
region = "ap-southeast-2"
}
module "company_table" {
source = "terraform-aws-modules/dynamodb-table/aws"
name = "company"
@sankar2389
sankar2389 / template.yaml
Created December 23, 2022 08:02 — forked from nmiguelmoura/template.yaml
AWS Api Gateway to SQS integration (request.body to SQS)
# POST endpoint /update with a JSON payload like {"products": ["123", "456"]}.
# Api Gateway will send this payload to an SQS Queue.
AWSTemplateFormatVersion: 2010-09-09
Description: >-
Api Gateway as a proxy to SQS.
Transform:
- AWS::Serverless-2016-10-31
@sankar2389
sankar2389 / api_gateway_to_sqs_cf.yaml
Created December 23, 2022 08:02
API Gateway to SQS CloudFormation Template
---
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
QueueName:
Description: The queue name for integration with API Gateway
Type: String
Default: api-gateway-queue
PassThroughProxyEndpoint:
Description: The proxy URL
Type: String
@sankar2389
sankar2389 / troubleshooting.md
Created November 14, 2022 16:46 — forked from cmawhorter/troubleshooting.md
Solution to AWS Lambda node.js UnrecognizedClientException "The security token included in the request is invalid."

Troubleshooting AWS unauthorized errors in lambda requests

This is mainly for node.js but might apply to other environments. Unsure.

If you are running a AWS Lambda function that calls another AWS service and getting an error about invalid tokens or other access denied errors, do this:

Check IAM

The role assigned to your lambda function will need permission to perform the actions. Check IAM and make sure the role has all the permissions.

@sankar2389
sankar2389 / schedule_cron
Created July 1, 2022 04:35 — forked from techthoughts2/schedule_cron
Scheduled cron expressions and examples of using cron to scheudle things in AWS
cron(Minutes | Hours | Day-of-month | Month | Day-of-week | Year)
cron(0 0/4 * * ? *) Every 4 hours
cron(0 10 * * ? *) 10:00AM UTC everyday
cron(15 12 * * ? *) 12:15PM UTC everyday
cron(0 18 ? * MON-FRI *) 6:00PM UTC every Mon-Fri
cron(0 8 1 * ? *) 8:00AM UTC every first day of the month
cron(0/10 * ? * MON-FRI *) Every 10 min Mon-Fri
cron(0/5 8-17 ? * MON-FRI *)Every 5 minutes Mon-Fri between 8:00AM - 5:55PM UTC
cron(0 9 ? * 2#1 *) 9:00AM UTC first Monday of each month
@sankar2389
sankar2389 / LIRC_Raspian_Buster.md
Created December 2, 2021 14:47 — forked from billpatrianakos/LIRC_Raspian_Buster.md
How to set up LIRC on Raspbian Buster (2019, 4.x kernel)

Infrared and LIRC

*Beware: These instructions have been cobbled together from all of the sources I found that got my specific unit working. I can verify it works on a Pi 3B running the latest OS as of summer 2019. Everyone's hardware and system will be a bit different so your mileage may vary. Before you go crazy trying to debug issues sending a signal, grab an existing lirc config for any remote and use the lirc CLI to send a signal out and verify your hardware is sending the signal by viewing the IR LED through a front-facing smartphone camera (almost all smartphone front cameras - even new iPhones - will not filter out IR light and you should see the LED flash when sending a signal). If you see your hardware is sending a signal and/or you can see that the IR input is seeing some signal, then you know your setup works and the issue may be that the remote you're trying to learn simply won't work with LIRC. I know for a fact that many Comcast/Xfinity cable remotes are actually RF devices and need to have

@sankar2389
sankar2389 / FlutterToastPlugin.java
Created June 9, 2021 17:59 — forked from axemclion/FlutterToastPlugin.java
An adapter to use React Native's Native Modules in Flutter
package com.example.helloflutterplugin;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.modules.toast.ToastModule;
import com.nparashuram.reactnative.ReactNativeModuleAdapter;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;
{
"description": "Fruits List",
"Fruits": [
"மாம்பழம்",
"பலாப்பழம்",
"எலுமிச்சம்பழம்",
"வாழைப்பழம்",
"சீத்தாப்பழம்",
"கிர்ணிப்பழம்",
"தர்பூசணிப்பழம்",