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
# pip install pyscreenshot pyuserinput | |
import pyscreenshot | |
import pykeyboard | |
import time | |
X1 = 780 | |
X2 = 785 | |
Y1 = 410 | |
Y2 = 420 |
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
""" | |
runner.py - This is a cron-like executor. | |
You can run Python files in scheduled times. | |
""" | |
import schedule | |
import time | |
# Files to run (ordered) | |
files_to_run = ['some_file_1.py', 'another_file_2.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
#!/bin/bash | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "Execute este comando com sudo ou como root." | |
exit 1 | |
fi | |
clear | |
echo '------------------------------------------------------------' |
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
# Create first network with Keras | |
from keras.models import Sequential | |
from keras.layers import Dense | |
import numpy as np | |
# Define your X and y here | |
X = np.array([[1, 0], [1, 1], [0, 1], [0, 0]]) | |
y = np.array([1, 1, 1, 0]) | |
# Create model |
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
#!/bin/bash | |
# Com este script você cria uma forma de executar comandos | |
# que não terão acesso à rede externa e Internet. | |
# Por exemplo, se você quiser forçar o Spotify a fica offline: | |
# offline spotify.bin | |
sudo groupadd offline | |
echo '#!/bin/bash' | sudo tee /usr/local/bin/offline | |
echo 'sg offline "$*"' | sudo tee -a /usr/local/bin/offline | |
sudo chmod a+x /usr/local/bin/offline |
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 pandas as pd | |
import pyodbc as odbc | |
import os | |
query = 'select * from vendas' | |
# Trago os dados do servidor caso não exista um cache local, | |
# senão apenas carrego o cache | |
if os.path.isfile('./dados/julho_com_sala.csv'): |
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 | |
import pyodbc as odbc | |
import datetime | |
dsn = sys.argv[1] | |
query_file = sys.argv[2] | |
csv_file = sys.argv[3] | |
print(f'Connecting to {dsn}') | |
print(f'Executing {query_file}') |
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 | |
import pyodbc as odbc | |
import datetime | |
dsn = sys.argv[1] | |
query_file = sys.argv[2] | |
csv_file = sys.argv[3] | |
print(f'Connecting to {dsn}') | |
print(f'Executing {query_file}') |
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 | |
import time | |
from PyQt5.QtWidgets import QApplication, QDialog | |
from PyQt5.uic import loadUi | |
class IMC(QDialog): | |
def __init__(self): | |
super().__init__() | |
loadUi('imc.ui', self) |
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 tensorflow.python.client import device_lib | |
def get_available_devices(): | |
local_device_protos = device_lib.list_local_devices() | |
return [x.name for x in local_device_protos] | |
print(get_available_devices()) |