- Install jq
- Keynote
- Numbers
- Pages
| https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html |
| # coding: utf-8 | |
| import fitz | |
| doc = fitz.open('outputbase.pdf') | |
| page = doc[0] | |
| rect = fitz.Rect(181,3226,1813,3358) | |
| page.drawRect(rect) | |
| doc.save('latest.pdf') | |
| page.drawRect(50,100,200,300) | |
| rect = fitz.Rect(50, 100, 200,300) | |
| page.drawRect(rect) |
| $ python -m venv projectname | |
| $ source projectname/bin/activate | |
| (venv) $ pip install ipykernel | |
| (venv) $ ipython kernel install --user --name=projectname |
| """ | |
| remember to set the following two layers | |
| arn:aws:lambda:ap-southeast-1:113088814899:layer:Klayers--tesseract:1 | |
| arn:aws:lambda:ap-southeast-1:113088814899:layer:Klayers-python37-pytesseract:1 | |
| """ | |
| import json | |
| import logging | |
| import pytesseract |
| import spacy | |
| import json | |
| def lambda_handler(event, context): | |
| nlp = spacy.load('/opt/en_core_web_sm-2.1.0') | |
| test = 'Keith is one awesome dude' | |
| nlp_test = nlp(test) | |
| output_ner = [(i, i.label_, i.label) for i in nlp_test.ents] | |
| print(output_ner) |
| #! /bin/bash | |
| wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-6.15.2-x64.bin | |
| chmod +x atlassian-confluence-6.15.2-x64.bin | |
| sudo ./atlassian-confluence-6.15.2-x64.bin | |
| sudo apt install postgresql postgresql-contrib | |
| sudo -i -u postgres | |
| createuser --interactive | |
| psql | |
| ALTER USER confluenceuser WITH ENCRYPTED PASSWORD '<password>'; |
| import json | |
| import spacy | |
| def lambda_handler(event, context): | |
| nlp = spacy.load('/opt/en_core_web_sm-2.1.0') | |
| doc = nlp(u"Apple is looking at buying U.K. startup for $1 billion. Keith Rozario doesn't have $1 billion.") | |
| for ent in doc.ents: | |
| print(ent.text, ent.start_char, ent.end_char, ent.label_) |
| message['ContinuationToken'] = token | |
| if context.get_remaining_time_in_millis() < reinvoke_seconds * 1000: | |
| logger.info(f"Running out of time, invoking new lambda") | |
| response = sqs_client.send_message(QueueUrl=os.environ['sqs_list_bucket_url'], | |
| MessageBody=json.dumps(message), | |
| DelaySeconds=2) | |
| logger.info(f"Called new message with messageId: {response['MessageId']}") |
| import boto3 | |
| import copy_bucket | |
| import time | |
| if __name__ == '__main__': | |
| region = copy_bucket.get_config()['provider']['region'] | |
| client = boto3.client('lambda', region_name=region) | |
| for x in range(199): | |
| time.sleep(0.01) |