- Download terraform binary
- Install Azure CLI
curl -L https://aka.ms/InstallAzureCli | bash
- Login with
az login
you will be taken to the browser and returned to the shell
- create app server looker-1
#!/bin/bash | |
MC_API_KEY="apikey:YOUR_KEY" | |
MC_LIST_ID="YOUR LIST ID" | |
# don't forget to update usN to your own MailChimp data center ID | |
TOTAL_ITEMS=`curl --silent --request GET --url "https://usN.api.mailchimp.com/3.0/lists/$MC_LIST_ID/members?fields=total_items" --user $MC_API_KEY | jq -r ".total_items"` | |
CHUNK_SIZE=1000 | |
echo "id,email_address,status,avg_open_rate,avg_click_rate,timestamp_signup,last_changed,member_rating" > mailchimp_list.csv | |
echo "action,timestamp,url,type,campaign_id,title,parent_campaign,subscriber_id" > mailchimp_list_activity.csv |
curl -L https://aka.ms/InstallAzureCli | bash
az login
you will be taken to the browser and returned to the shellimport csv | |
import argparse | |
import lkml | |
import os | |
""" | |
This script automatically adds labels and descriptions saved in a CSV file to fields within LookML project files. | |
Warning! Since this script doesn't check for fully-scoped field names, if you specify an update to a field with | |
a common name, like "count", every instance of a field called count in your LookML project will be updated with |
#!/bin/bash | |
# Author: [email protected] | |
# | |
# The purpose of this script is to copy a LookML project and some of its dependencies (connections, user attributes, models) from | |
# a source environment to a destination environment. This script will not copy users, groups, roles, or permission sets. | |
# Please update the following environment variables: | |
export SRC_REPO_URL="https://github.com/drewgillson/looker-data-applications-exercise.git" | |
export SRC_CLIENT_ID="..." | |
export SRC_CLIENT_SECRET="..." |
import csv | |
import argparse | |
from looker_sdk import client | |
""" | |
The purpose of this script is to parse a CSV file containing a list of emails separated by line breaks. If | |
the email in the file corresponds to an email in the Looker instance referred to in looker.ini, that user will | |
be automatically disabled. | |
""" |
terraform
is in your $PATHgcloud auth application-default login
and follow these instructions to create an admin project that can provision additional projects. You will also need to
add two more IAM bindings:
gcloud organizations add-iam-policy-binding ${TF_VAR_org_id} \
--member serviceAccount:terraform@$
""" | |
This is a Google Cloud Function, it can be deployed like this: | |
gcloud functions deploy download_full_look --env-vars-file .env.yaml --runtime python37 --trigger-http --allow-unauthenticated | |
You need a requirements.txt in the same directory, to specify the Flask | |
and Looker SDK versions. You also need a .env.yaml file to contain | |
environment variable values for the Looker SDK! | |
Read logs like this: | |
gcloud functions logs read download_full_look |
#!/bin/bash | |
# This script logs into the Looker UI using the specified credentials and generates a new API3 key. It was written on Mac OS X | |
# and may need to be slightly adapted if running on Linux (possibly just replacing ggrep with grep) | |
if [ ! -f /usr/local/bin/ggrep ]; then | |
echo "Install GNU grep by running 'brew install grep'" | |
exit 1 | |
fi | |
if [ ! -f /usr/local/bin/jq ]; then | |
echo "Install jq by running 'brew install jq'" |
#!/bin/bash | |
TOKEN=$(gcloud auth application-default print-access-token) | |
PROJECT_ID="663188713804" | |
DOCUMENT_ID="29oiqkhlqm5o8" | |
ENDPOINT="https://contentwarehouse.googleapis.com/v1/projects/$PROJECT_ID/locations/us/documents/$DOCUMENT_ID:setAcl" | |
# Set the policy | |
POLICY='{ | |
"policy": { |