-
【强制】 代码中的命名均不能以下划线或美元符号开始,也不能以下划线或美元符号结束。
反例:
_name
/__name
/$name
/name_
/name$
/name__
This file contains hidden or 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 is an example of how to use async langchain with fastapi and return a streaming response. | |
The latest version of Langchain has improved its compatibility with asynchronous FastAPI, | |
making it easier to implement streaming functionality in your applications. | |
""" | |
import asyncio | |
import os | |
from typing import AsyncIterable, Awaitable | |
import uvicorn | |
from dotenv import load_dotenv |
This file contains hidden or 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 nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 | |
ENV DEBIAN_FRONTEND noninteractive | |
############################################################################## | |
# Temporary Installation Directory | |
############################################################################## | |
ENV STAGE_DIR=/tmp | |
RUN mkdir -p ${STAGE_DIR} |
This file contains hidden or 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 "fmt" | |
type tree struct { | |
value int | |
left, right *tree | |
} | |
func Sort(values []int) []int { |
This file contains hidden or 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
#如果rewrite操作正在进行,则记录所使用的时间 | |
redis_aof_current_rewrite_duration_sec{addr="redis://10.121.9.179:6379",alias=""} -1 | |
#是否开启aof,默认没开启(已开启) | |
redis_aof_enabled{addr="redis://10.121.9.179:6379",alias=""} 0 | |
#上次rewrite操作的状态 | |
redis_aof_last_bgrewrite_status{addr="redis://10.121.9.179:6379",alias=""} 1 | |
# 在执行AOF重写期间,分配给COW的大小 | |
redis_aof_last_cow_size_bytes{addr="redis://10.121.9.179:6379",alias=""} 0 | |
# 上次rewrite操作使用的时间(单位s) | |
redis_aof_last_rewrite_duration_sec{addr="redis://10.121.9.179:6379",alias=""} -1 |
This file contains hidden or 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 ( | |
"fmt" | |
"math/rand" | |
"time" | |
// "os" | |
// "os/signal" | |
) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# python elasticsearch_pulk_del.py --keep=31 --ip=10.140.65.12 保留31天index | |
# python elasticsearch_pulk_del.py --start_index=0 --end_index=10 --ip=10.140.65.12 删除最老的11个index | |
# python elasticsearch_pulk_del.py --om=true --ip=10.140.65.12 优化merge吞吐量 | |
import urllib2 | |
import json | |
import time | |
import datetime | |
from optparse import OptionParser |
#分布式搜索elasticsearch配置文件详解
配置文件位于%ES_HOME%/config/elasticsearch.yml文件中
所有的配置都可以使用环境变量,例如: node.rack: ${RACK_ENV_VAR} 表示环境变量中有一个RACK_ENV_VAR变量。
下面列举一下elasticsearch的可配置项:
- 集群名称,默认为elasticsearch: cluster.name: elasticsearch
This file contains hidden or 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 phusion/baseimage:latest | |
MAINTAINER flurdy | |
ENV DEBIAN_FRONTEND noninteractive | |
# accept-java-license | |
RUN echo /usr/bin/debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections | |
RUN apt-get update && \ |
NewerOlder