Skip to content

Instantly share code, notes, and snippets.

View immma's full-sized avatar
😀

ardi hanitya immma

😀
View GitHub Profile
@immma
immma / bulk-summarize.py
Created November 17, 2024 02:11
summarize_file.py
txt_files = [f for f in os.listdir(directoryName) if f.endswith('.txt')]
for file in txt_files:
summary = summarize_text(directoryName + file)
print(summary)
@immma
immma / extractor.py
Created October 20, 2024 06:36
AWS Textract Python PDF table
import boto3
import time
# Initialize Textract client
textract = boto3.client('textract')
s3 = boto3.client('s3')
def start_layout_analysis(document_bucket, document_key):
# Start the Textract job for layout analysis
response = textract.start_document_analysis(
@immma
immma / ec2-boostrap-private.sh
Last active September 27, 2022 04:14
EC2 Bootstrap with Bootstrap CSS
#!/bin/bash
yum update -y
yum install -y httpd
ipv4=$(curl -s "http://169.254.169.254/latest/meta-data/local-ipv4")
hostname=$(curl http://169.254.169.254/latest/meta-data/local-hostname)
cat > /var/www/html/index.html << _EOF_
<!DOCTYPE html>
@immma
immma / S3-bucketpolicy-MFA.json
Last active August 30, 2021 23:15
S3-bucketpolicy-MFA
{
"Version": "2012-10-17",
"Id": "Policy1630051047351",
"Statement": [
{
"Sid": "Stmt1630050786717",
"Effect": "Deny",
"Principal": {
"AWS": "*"
},