View sqs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqs= boto3.resource('sqs', aws_access_key_id = AWS_ACCESS_KEY_ID, | |
aws_secret_access_key = AWS_SECRET_ACCESS_KEY, | |
region_name = REGION_NAME) | |
def receive_message_from_sqs(spider,delete=True): | |
queue = sqs.get_queue_by_name(QueueName=spider) | |
rows = [] |
View nginx.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
module = application:app | |
master = true | |
processes = 3 | |
chdir = YOUR_PROJECT_PATH | |
socket = YOUR_SOCK_FILE_PATH | |
chmod-socket = 777 | |
vacuum = true |
View test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('I am hungry Friday and Saturday is beautiful day') | |
View 1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aiohttp import gather, create_task | |
from string import Template | |
from aiohttp import web, ClientSession | |
from bs4 import BeautifulSoup | |
async def news(request): | |
sites = [ | |
('http://edition.cnn.com',cnn_articles), | |
('http://www.aljazeera.com',aljazeera_articles) | |
] |
View slimdown.md
AWS API move to local server
9 month data need 1. t3a.large 2 Variable 8 GiB EBS Only $0.0752 per Hour 54/month t3a.xlarge 4 Variable 16 GiB EBS Only $0.1504 per Hour 108/month
VPN tunnel in prod 2. $37/month
View color print.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = ( | |
"\033[0m", # End of color | |
"\033[36m", # Cyan | |
"\033[91m", # Red | |
"\033[32m", # Green | |
) |
View sleep.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Thread | |
from threading import current_thread | |
from asyncio import Future | |
import asyncio | |
import time | |
c = ( | |
"\033[0m", # End of color | |
"\033[36m", # Cyan | |
"\033[91m", # Red |
View Indexs.md
Indexs:
Secondary Index: not prmiary key Unique Index: the performace is almost same compared to (Secondary) index
View quene.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import itertools as it | |
import os | |
import random | |
import time | |
async def makeitem(size: int = 5) -> str: | |
return os.urandom(size).hex() | |
async def randsleep(a: int = 1, b: int = 5, caller=None) -> None: |
OlderNewer