Setup
bin/kafka-topics.sh \
--zookeeper zookeeper.example.com:2181 \
--create \| #!/bin/bash | |
| if [ -z $1 ]; then | |
| echo "Provide a BQ table spec, ideally fully qualified." | |
| exit 1 | |
| fi | |
| if $(echo "" | jq .); then | |
| bq --format json show $1 | jq -j '[.schema.fields[] | .name + ":" + .type] | join(",")' |
| #!/bin/bash | |
| if [ -z "${PROJECT}" -o -z "${DATASET}" ]; then | |
| echo "Please set \$PROJECT and \$DATASET." | |
| exit 1 | |
| fi | |
| IFS='' read -d '' Q <<EOF | |
| #standardSQL | |
| /* |
| #!/bin/bash | |
| if [ -z "${PROJECT}" -o -z "${DATASET}" ]; then | |
| echo "Please set \$PROJECT and \$DATASET." | |
| exit 1 | |
| fi | |
| IFS='' read -d '' Q <<EOF | |
| #standardSQL | |
| /* |
| #!/bin/bash | |
| if [ -z "${PROJECT}" -o -z "${DATASET}" ]; then | |
| echo "Please set \$PROJECT and \$DATASET." | |
| exit 1 | |
| fi | |
| IFS='' read -d '' Q <<EOF | |
| #standardSQL | |
| /* |
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
| #!/usr/bin/env python | |
| # Compare a file on S3 to see if we have the latest version | |
| # If not, upload it and invalidate CloudFront | |
| import fnmatch | |
| import os | |
| import boto | |
| import pprint | |
| import re |
| #!/bin/bash | |
| sudo apt-get update | |
| sudo apt-get install -y python3 python3-pip nginx python3-setuptools git | |
| sudo pip3 install uwsgi virtualenv Flask flask-restful gunicorn | |
| sudo mkdir -p /var/www/ | |
| cd /var/www/ | |
| echo "<h1>Hello world!</h1>" | tee index.html |
alter session set container=cdb$root;
select * from (
WITH
cpuwl AS (
SELECT /*+ MATERIALIZE NO_MERGE */
instance_number,
dbid,
snap_id,
SUM(CASE WHEN stat_name = 'RSRC_MGR_CPU_WAIT_TIME' THEN value ELSE 0 END) rsrcmgr,
| #!/bin/sh | |
| # AUTHOR | |
| # DANIEL E. GILLESPIE (2016) | |
| # https://github.com/dantheman213 | |
| # DESCRIPTION | |
| # Export your app's table schemas and stored functions from a PostgreSQL | |
| # database into individual *.sql files for easy management and source control. |