You should install VirtualBox and Vagrant before you start.
You should create a Vagrantfile
in an empty directory with the following content:
###################################################################################### | |
## Automating Infrastructure on Google Cloud with Terraform: Challenge Lab # GSP345 ## | |
###################################################################################### | |
====================== Setup : Create the configuration files ====================== | |
Make the empty files and directories in Cloud Shell or the Cloud Shell Editor. | |
------------------------------------------------------------------------------------ | |
touch main.tf | |
touch variables.tf |
gcloud config set project $(gcloud projects list --format='value(PROJECT_ID)' --filter='qwiklabs-gcp') | |
git clone https://github.com/rosera/pet-theory.git | |
# 1. Firestore Database Create | |
Go to Firestore > Select Naive Mode > Location: nam5 > Create Database | |
# 2. Firestore Database Populate | |
cd pet-theory/lab06/firebase-import-csv/solution | |
npm install | |
node index.js netflix_titles_original.csv |
You should install VirtualBox and Vagrant before you start.
You should create a Vagrantfile
in an empty directory with the following content:
Producer | |
Setup | |
bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-two --partitions 6 --replication-factor 3 | |
Single thread, no replication | |
bin/kafka-run-class.sh org.apache.kafka.tools.ProducerPerformance --print-metrics --topic test-rep-one --num-records 6000000 --throughput 100000 --record-size 100 --producer-props bootstrap.servers=kafka_host:9092 buffer.memory=67108864 batch.size=8196 | |
Single-thread, async 3x replication |
#!/bin/bash | |
hosts=$@ | |
date_cmd="" | |
if [[ "$OSTYPE" == "darwin"* ]]; then | |
# make sure you have 'coreutils' -- brew install coreutils | |
date_cmd="gdate" | |
else | |
date_cmd="date" |
version: "3" | |
services: | |
sonarqube: | |
image: sonarqube | |
expose: | |
- 9000 | |
ports: | |
- "127.0.0.1:9000:9000" | |
networks: |
#!/bin/bash | |
# Load balance multiple internet connections. Requires iproute2, awk and grep. | |
# (C) 2016 Tobias Girstmair, isticktoit.net, GPLv2 | |
# Also useful: speedometer -l -r eth1 -t eth1 -m $(( 1024 * 1024 * 3 / 2 )) | |
# Not much user error checking is done - only pass working network connections | |
# script needs root to work and at least two interfaces to be useful | |
[ $EUID -eq 0 -a $# -ge 2 ] || { | |
echo "Usage (as root): $0 iface1[:weight1] iface2[:weight2] ..." >&2 |
server { | |
listen 80; | |
listen 443 default_server ssl; | |
ssl on; | |
ssl_certificate /etc/ssl/certs/myssl.crt; | |
ssl_certificate_key /etc/ssl/private/myssl.key; | |
server_name *.example.com; | |
root /var/www/vhosts/website; |
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |