Skip to content

Instantly share code, notes, and snippets.

View mesmacosta's full-sized avatar
🏠
Working from home

Marcelo Costa mesmacosta

🏠
Working from home
View GitHub Profile
const apis = [{
method: 'POST',
name: 'create_pizza_order',
regex: '**/api/pizzas/order',
response: 'pizza_order/create_pizza_order',
}]
export { apis }
/// <reference types="Cypress" />
import * as commons from '../support/functions/commons.functions'
import { PizzaOrderPageData } from '../support/pages_data/pizza_order/pizza-order.pd'
const pd = new PizzaOrderPageData()
context('Pizza Creator', () => {
beforeEach(() => {
cy.visit(pd.url)
╔════════════════════════╦═════════════════════════════════════════════════════════════════════╦═══════════╗
║ Field ║ Description ║ Mandatory ║
╠════════════════════════╬═════════════════════════════════════════════════════════════════════╬═══════════╗
║ execution_time** ║ Execution time when all stats were collected. ║ Y ║
║ files ║ Number of files found, that matches the prefix. ║ N ║
║ min_file_size ║ Minimum file size found in bytes. ║ N ║
║ max_file_size ║ Maximum file size found in bytes. ║ N ║
║ avg_file_size ║ Average file size found in bytes. ║ N ║
║ total_file_size ║ Total file size found in bytes. ║ N ║
║ first_created_date ║ First time a fil
Find deleted tables:
protoPayload.methodName="google.cloud.bigquery.v2.TableService.DeleteTable"
Find deleted tables by expiration event:
protoPayload.methodName="InternalTableExpired"
MYDIR=allen-p
FILES=$(find $MYDIR -type f -not -name "*.encrypted")
for file in $FILES; do
PLAINTEXT=$(cat $file | base64 -w0)
curl -v "https://cloudkms.googleapis.com/v1/projects/$DEVSHELL_PROJECT_ID/locations/global/keyRings/$KEYRING_NAME/cryptoKeys/$CRYPTOKEY_NAME:encrypt" \
-d "{\"plaintext\":\"$PLAINTEXT\"}" \
-H "Authorization:Bearer $(gcloud auth application-default print-access-token)" \
-H "Content-Type:application/json" \
| jq .ciphertext -r > $file.encrypted
done
# To install pip, execute the following command:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 get-pip.py
https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/datastore/cloud-client/snippets_test.py
@mesmacosta
mesmacosta / Dockerfile
Created November 28, 2019 17:30
Docker alpine python + grpc
FROM python:3.7-alpine as base
# install gcc and grpc dependencies
FROM base as builder
RUN apk add --update --no-cache \
gcc \
linux-headers \
make \
musl-dev \
python-dev \
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -
curl ifconfig.me
curl icanhazip.com
curl ipecho.net/plain
curl ident.me
curl bot.whatismyipaddress.com
curl https://diagnostic.opendns.com/myip
curl http://checkip.amazonaws.com
dig +short myip.opendns.com @resolver1.opendns.com