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 |
| #!/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. |
This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL