- Make sure the domain you picked points at the IP of your Redash server.
- Switch to the
root
user (sudo su
). - Create a folder named
nginx
in/opt/redash
. - Create in the nginx folder two additional folders:
certs
andcerts-data
. - Create the file
/opt/redash/nginx/nginx.conf
and place the following in it: (replaceexample.redashapp.com
with your domain name)upstream redash { server redash:5000; }
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Octokit = require("@octokit/rest"); | |
const createCsvWriter = require("csv-writer").createObjectCsvWriter; | |
const octokit = new Octokit({ | |
auth: "token " + process.env.GITHUB_TOKEN | |
}); | |
async function getCommits(since) { | |
const options = octokit.repos.listCommits.endpoint.merge({ | |
owner: "getredash", | |
repo: "redash", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.parse import urljoin | |
import requests | |
import click | |
import json | |
class Redash: | |
def __init__(self, host, api_key): | |
self.host = host | |
self.api_key = api_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function getQueryResult(slug, queryId, apiKey, options = {}) { | |
const instance = axios.create({ | |
baseURL: `https://app.redash.io/${slug}`, | |
headers: { | |
Authorization: `Key ${apiKey}` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import os | |
class Redash(object): | |
def __init__(self, redash_url, api_key): | |
self.redash_url = redash_url | |
self.session = requests.Session() | |
self.session.headers.update({'Authorization': 'Key {}'.format(api_key)}) | |
def test_credentials(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'httparty' | |
class Redash | |
include HTTParty | |
def initialize(slug, api_key) | |
@base_uri = "https://app.redash.io/#{slug}" | |
@headers = { | |
'Authorization': "Key #{api_key}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import sys | |
import re | |
import subprocess | |
def get_change_log(previous_sha): | |
args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', 'master...{}'.format(previous_sha)] | |
log = subprocess.check_output(args) | |
changes = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Explanation of what's going on in this query can be found in this blog post: https://blog.redash.io/sql-query-to-calculate-saas-metrics-dd25d72a0521. | |
*/ | |
WITH v_charges AS ( | |
SELECT org_id, | |
date_trunc('month', start_date) AS month, | |
coalesce((extra::json->>'amount')::float, (extra::json->>'charged_amount')::integer/100) as total | |
FROM charges | |
WHERE extra::json->>'months' = '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class Redash(object): | |
def __init__(self, redash_url, api_key): | |
self.redash_url = redash_url | |
if not self.redash_url.endswith('/'): | |
self.redash_url = '{}/'.format(self.redash_url) | |
self.auth_headers = {'Authorization': 'Key {}'.format(api_key)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"dynamodb:BatchGetItem", | |
"dynamodb:DescribeTable", | |
"dynamodb:GetItem", | |
"dynamodb:ListTables", | |
"dynamodb:Query", |
NewerOlder