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
# 配置文件 | |
# 脚本设置 |
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
vim /opt/redash/env | |
``` | |
PYTHONUNBUFFERED=0 | |
REDASH_LOG_LEVEL=INFO | |
REDASH_REDIS_URL=redis://redis:6379/0 | |
POSTGRES_PASSWORD=password | |
REDASH_COOKIE_SECRET=cookie_secret | |
REDASH_SECRET_KEY=secret_key | |
REDASH_DATABASE_URL=postgresql://postgres:password@postgres/postgres |
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
package main | |
import ( | |
"errors" | |
"example/c" | |
"fmt" | |
"reflect" | |
"rsc.io/quote" | |
) |
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
https://pingcap.com/blog-cn/best-practice-haproxy/ |
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
内网网段:192.168.1.* | |
外网可访问的机器 ip:192.168.1.44 | |
iptables -F | |
iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -j SNAT --to 192.168.1.44 | |
echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf |
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
user www-data; | |
worker_processes 2; | |
worker_rlimit_nofile 65535; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 65535; | |
} |
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
# {"name": "Eggs", 'price': 1223, 'us': ['12334']} | |
schema = { | |
"type": "object", | |
"properties": { | |
"price": {"type": "number"}, | |
"name": {"type": "string"}, | |
"us": { | |
"type": "array", | |
"items": { | |
"type": "string", "maxLength": 5 |
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 gzip | |
import io | |
from requests.adapters import HTTPAdapter | |
import requests | |
class GzipAdapter(HTTPAdapter): | |
"""Adapter used with `requests` library for sending compressed data.""" |
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 difflib | |
from string import digits | |
from typing import Tuple, Any | |
class Similarity: | |
remove_digits = str.maketrans('', '', digits) | |
@classmethod | |
def remove_digit(cls, s) -> str: |
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 os | |
from functools import wraps | |
import kerberos | |
from pyhive import presto | |
presto_cli = presto.connect(**RUN_ENV.PRESTO_MRS_CONF) |
NewerOlder