Skip to content

Instantly share code, notes, and snippets.

from flask import Flask, request
from google.cloud import bigquery
from google.auth import impersonated_credentials
import google.auth
import json
app = Flask(__name__)
@app.route('/')
def page_home():
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
@saltysoup
saltysoup / GCP Quota scraper
Last active March 12, 2024 04:28
Python tool for getting all GCP service quotas usage and limits
from google.cloud import monitoring_v3
import time
# for multiple projects, feed in a list of project names and use folder/org level IAM role for perm
project_name = "injae-sandbox"
def create_client():
try:
client = monitoring_v3.MetricServiceClient()
@saltysoup
saltysoup / lambda-ddbstream.py
Created August 10, 2017 04:51
Connect VoiceBot Demo. Code is provided on an as-is basis and is a personal, not AWS contribution
import boto3
import json
from datetime import datetime
region = "us-east-1"
client = boto3.client("s3",region)
bucketName = "connect-demo-voicemail"
def lambda_handler(event, context):
print ("raw event: {}".format(event))