$ pip install click requests
$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
| [ | |
| {"caption": "CSV to Where", "command": "format_as_where"} | |
| ] |
| from sshtunnel import SSHTunnelForwarder | |
| import pymysql | |
| with SSHTunnelForwarder( | |
| ('ec2-52-202-194-76.public-ec2-instance.amazonaws.com'), | |
| ssh_username="ec2-user", | |
| ssh_pkey="~/ssh-tunnel-rds.pem", | |
| remote_bind_address=('private-rds-instance.ckfkidfytpr4.us-east-1.rds.amazonaws.com', 3306) | |
| ) as tunnel: | |
| print("****SSH Tunnel Established****") |
| docker buildx create --use --platform=linux/arm64,linux/amd64 --name multi-platform-builder | |
| docker buildx inspect --bootstrap | |
| docker buildx build --platform=linux/arm64,linux/amd64 --push --tag project-name:latest -f ./project-name/Dockerfile . |
| # tabc <profile name> do the profile change | |
| function tabc() { | |
| NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi | |
| # if you have trouble with this, change | |
| # "Default" to the name of your default theme | |
| echo -e "\033]50;SetProfile=$NAME\a" | |
| } | |
| # reset the terminal profile to Default when exit from the ssh session | |
| function tab-reset() { |
| #!/usr/bin/bash | |
| langs=( "ar" "es" "de" "fr" "it" "ja" "ru" "vi" "vi" "zh-CN" ) | |
| for session in * | |
| do | |
| if [ -d $session ]; then | |
| echo $session | |
| for resource in $session/* | |
| do |
root user (sudo su).nginx in /opt/redash.certs and certs-data./opt/redash/nginx/nginx.conf and place the following in it: (replace example.redashapp.com with your domain name)
upstream redash {
server redash:5000;
}
| #!/usr/bin/ruby | |
| require 'logger' | |
| require 'pragmatic_tokenizer' | |
| require 'unicode_utils' | |
| class Serbilian | |
| SINGLE_LETTER_WORDS = { | |
| "à" => "a", | |
| "ã" => "ɐ̃", | |
| "â" => "ɐ̃", |
| CREATE ROLE _readonly_user_name_ WITH LOGIN PASSWORD '_readonly_user_password_' | |
| NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION VALID UNTIL 'infinity'; | |
| GRANT CONNECT ON DATABASE _database_to_give_access_ TO _readonly_user_name_; | |
| GRANT USAGE ON SCHEMA public TO _readonly_user_name_; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO _readonly_user_name_; | |
| GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO _readonly_user_name_; | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO _readonly_user_name_; |
| #!/usr/bin/env zsh | |
| declare -a colors | |
| colors=( | |
| "red" | |
| "purple" | |
| "yellow" | |
| "blue" | |
| "cyan" |