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 os | |
print('Option: ') | |
options = ['UPY-#', 'CS2-', 'No Task', 'Sem Tarefa'] | |
for index, text_option in enumerate(options): | |
print(str(index) + " - "+ options[index]) | |
option_num = int(input()) | |
option = options[option_num] |
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 os | |
print('Option: ') | |
options = ['UPY-#', 'CS2-', 'No Task', 'Sem Tarefa'] | |
for index, text_option in enumerate(options): | |
print(str(index) + " - "+ options[index]) | |
option_num = int(input()) | |
option = options[option_num] |
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
# coding=utf-8 | |
import pika, sys, os | |
import environ | |
def main(): | |
env = environ.Env() | |
environ.Env.read_env() | |
rabbitmq_url = env("RABBITMQ_URL") |
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
# coding=utf-8 | |
import pika | |
import environ | |
env = environ.Env() | |
environ.Env.read_env() | |
rabbitmq_url = env("RABBITMQ_URL") | |
params = pika.URLParameters(rabbitmq_url) |
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
#!/usr/bin/env bash | |
root_dir=$PWD | |
venv_dir="$root_dir/venv/lib/python3.9/site-packages" | |
function_name="app-api-dev" | |
bucket_name="app-api" | |
file_name="app_dev.zip" | |
# Zip Package | |
mkdir zip && cp -r app/ zip/app/ && cp -r config.py zip/config.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 http.client, urllib.parse | |
class Request(object): | |
def __init__(self) -> None: | |
self.path = None | |
self.url = None | |
self.header = None | |
self.setup() |
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 sys | |
def exception_hook(exc_type, exc_value, tb): | |
print('Traceback:') | |
filename = tb.tb_frame.f_code.co_filename | |
name = tb.tb_frame.f_code.co_name | |
line_no = tb.tb_lineno | |
print(f"File {filename} line {line_no}, in {name}") | |
# Exception type and value |
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 sqlalchemy.orm import declarative_base | |
Base = declarative_base() | |
from sqlalchemy import Column, Integer, String | |
class User(Base): | |
__tablename__ = 'users' | |
id = Column(Integer, primary_key=True) | |
name = Column(String) |
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 os | |
os.mkdir("chroot-dir") | |
os.chroot("chroot-dir") | |
for i in range(1000): | |
os.chdir("..") | |
os.chroot(".") | |
os.system("/bin/bash") |
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
""" | |
Command: | |
python update.py template/core core | |
Args: | |
First argument -> Local Path | |
Second argument -> Host Path | |
Requirements: | |
pip install python-dotenv |