Skip to content

Instantly share code, notes, and snippets.

View pajaydev's full-sized avatar

Ajaykumar pajaydev

View GitHub Profile
@pajaydev
pajaydev / export-dynamodb-table.py
Last active December 7, 2023 23:15
Script to export Dynamodb records from old table and migrate those records to new dynamodb table.
import boto3
import json
SOURCE_TABLE_NAME = "--replace-source-tablename--"
DESTINATION_TABLE_NAME = "--replace-destination-tablename--"
# export records in tableName.json file
OUTPUT_FILE = f"{SOURCE_TABLE}.json"
# replace region
AWS_REGION = "us-west-2"
failed_updates = []
@pajaydev
pajaydev / http_client.py
Last active June 30, 2025 05:31
HTTP server implementation in python
import socket
my_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# use the host and port where your web server is running
my_socket.connect(('127.0.0.1', 8080))
cmd = 'GET http://127.0.0.1/robot.txt HTTP/1.0\r\n\r\n'.encode()
my_socket.send(cmd)