Skip to content

Instantly share code, notes, and snippets.

View saifkhan192's full-sized avatar
🎯
Focusing

Saifullah Khan saifkhan192

🎯
Focusing
  • Pakistan
  • 19:52 (UTC -12:00)
View GitHub Profile
@saifkhan192
saifkhan192 / buckets.tf
Created February 12, 2024 07:44 — forked from nagelflorian/buckets.tf
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@saifkhan192
saifkhan192 / ecs.yml
Created September 19, 2023 17:01 — forked from tkgregory/ecs.yml
An example CloudFormation template for deployment of a container to ECS, including integration with an Application Load Balancer.
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
Subnet1ID:
Type: String
Subnet2ID:
Type: String
VPCID:
Type: String
Resources:
Cluster:
"use strict";
var AWS = require("aws-sdk");
AWS.config.update({
region: process.env.AWS_DEFAULT_REGION || AWS.config.region || "us-east-1"
});
var dynamodb = new AWS.DynamoDB();
import * as AWS from 'aws-sdk';
import { Logger } from '@nestjs/common';
import { QueueInterface } from '../interfaces/queue.interface';
import { ConfigService } from '@nestjs/config';
import { Repository } from 'typeorm';
import { QueueEntity } from '../entities/queue.entity';
export const sqsService = new AWS.SQS({ region: 'us-east-1' });
export const QUEUE_URL = `https://sqs.us-east-1.amazonaws.com/account_id/`;
@saifkhan192
saifkhan192 / queue.ts
Created January 27, 2023 16:51 — forked from ugurgungezerler/queue.ts
NestJS SQS Lambda
import { Handler, Context } from 'aws-lambda';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { INestApplication } from '@nestjs/common';
import { SqsHandlerService } from './queue/sqs.handler.service';
let cachedServer: INestApplication;
async function bootstrapServer(): Promise<INestApplication> {
if (!cachedServer) {
@saifkhan192
saifkhan192 / ddb_lsi_example.py
Created May 12, 2022 12:27 — forked from parijatmishra/ddb_lsi_example.py
Using DynamoDB Local Secondary Indexes - example in Python and boto3
#!/usr/bin/env python
# ddb_lsi_example: A sample program to show how to use Local Secondary Indexes
# in DynamoDB, using Python and boto3.
#
# Copyright 2016 Parijat Mishra
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@saifkhan192
saifkhan192 / docker_debugging.md
Created April 12, 2022 18:07 — forked from veuncent/docker_debugging.md
Debugging Django apps running in Docker using ptvsd - Visual Studio (Code)

Remote debugging in Docker (for Django apps)

In order to enable debugging for your Django app running in a Docker container, follow these steps using Visual Studio (Code):

  1. Add ptvsd to your requirements.txt file
ptvsd == 4.3.2
  1. To your launch.json, add this:
@saifkhan192
saifkhan192 / docker-help.md
Created March 28, 2022 11:10 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info