Skip to content

Instantly share code, notes, and snippets.

View Miyake-Diogo's full-sized avatar

Diogo Miyake Miyake-Diogo

View GitHub Profile
@Miyake-Diogo
Miyake-Diogo / simple_example_gcp_variable.tf
Last active August 3, 2020 14:16
Simple exampe of variables.tf file
# Arquivo com as Variaveis
variable "project_id"{
type = string
default = "miyake-tech"
}
variable "default_region"{
type = string
default = "us-central1"
@Miyake-Diogo
Miyake-Diogo / gcp_example_iot_main.tf
Last active August 3, 2020 14:17
Simple Example for deploy of terraform and GCP
# Aqui vai as infos do provider
provider "google" {
version = "3.5.0"
credentials = file(var.credentials_location) # coloque o caminho completo para o arquivo de credenciais
project = var.project_id # Coloque aqui o nome de seu projeto
region = var.default_region
zone = var.default_zone
}
@Miyake-Diogo
Miyake-Diogo / sensorData.py
Last active August 4, 2020 15:32
Funções que capturam os dados dos sensores
# Funções para usar e retornar os dados necessários
from gpiozero import MotionSensor
import Adafruit_DHT
# from datetime import datetime
import time
import RPi.GPIO as gpio
gpio.setmode(gpio.BCM)
gpio.setup(4, gpio.IN)
@Miyake-Diogo
Miyake-Diogo / sendMessageToCloud.py
Last active August 4, 2020 15:32
Função que envia os dados a tabela no BigQuery
from google.cloud import pubsub_v1
import datetime
import json
import sensorData
import time
project_id = "miyake-tech" # Coloque aqui seu ID de projeto
topic_name = "my-topic" # Entre com o nome do topico criado
publisher = pubsub_v1.PublisherClient()
@Miyake-Diogo
Miyake-Diogo / postgres_metabase_docker_compose.yaml
Created January 20, 2020 12:58
YAML file for configure and deploy Metabse with PostgresSQL in Docker Compose.
version: "3.7"
# Declaração dos serviços.
services:
# Configuração do container do Postgres.
pgsql-metabase-docker:
# Nome da imagem a ser buscada.
image: postgres
# Permite escolher reiniciar caso o serviço pare.
restart: always
# Especificação do expose das portas.
http://www.oreilly.com/data/free/files/2014-data-science-salary-survey.pdf
http://www.oreilly.com/data/free/files/2015-data-science-salary-survey.pdf
http://www.oreilly.com/data/free/files/Data_Analytics_in_Sports.pdf
http://www.oreilly.com/data/free/files/advancing-procurement-analytics.pdf
http://www.oreilly.com/data/free/files/ai-and-medicine.pdf
http://www.oreilly.com/data/free/files/analyzing-data-in-the-internet-of-things.pdf
http://www.oreilly.com/data/free/files/analyzing-the-analyzers.pdf
http://www.oreilly.com/data/free/files/architecting-data-lakes.pdf
http://www.oreilly.com/data/free/files/being-a-data-skeptic.pdf
http://www.oreilly.com/data/free/files/big-data-analytics-emerging-architecture.pdf
@Miyake-Diogo
Miyake-Diogo / YAML_Tutorial.yaml
Last active October 18, 2022 18:56
Tutorial de YAML, codigos
# Este é um arquivo de tutorial mostrando com a linguagem yaml funciona
# Um resumo dos elementos básicos do Yaml
# Para comentários basta usar o caractere (#).
# Yaml não permite
# multiplas linhas em comentário.
# É importante a indentação quando se cria um objeto com estruturas
# Vários documentos com fluxos únicos são separados por 3 hífens (---) no inicio e três pontos no fim (...).
#Doc 1
--- # Start