Skip to content

Instantly share code, notes, and snippets.

View ninehills's full-sized avatar

Tao Yang ninehills

View GitHub Profile
背景信息:
===
当让你搜索时,你要使用 WebPilot 插件并用如下 URL 结构来进行 Google 搜索:
https://google.com/search?q={query}&hl=en&gl=US&tbs={time}
参数:
- {query} :搜索关键字。
- {time} [optional] :时间要求,比如'qdr:d2' 表示过去两天内的搜索。
===
@ninehills
ninehills / chatglm.ipynb
Created April 21, 2023 12:18
ChatGLM.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ninehills
ninehills / chatglm-openai-api.ipynb
Last active April 16, 2024 01:15
chatglm-openai-api.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ninehills
ninehills / chatpdf-zh.ipynb
Last active April 9, 2024 06:40
ChatPDF-zh.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am ninehills on github.
  • I am swulling (https://keybase.io/swulling) on keybase.
  • I have a public key whose fingerprint is 0EF7 EEB1 D9C4 4046 FC8A EAB6 3BA6 1B43 76F1 756D

To claim this, I am signing this object:

@ninehills
ninehills / urandom-reads.py
Created August 11, 2021 10:44 — forked from drsnyder/urandom-reads.py
Demonstrate the contention on /dev/urandom with N threads.
# Create a user land file for testing.
# dd if=/dev/urandom of=/tmp/urandom bs=1M count=10
#
# urandom-reads.py infile threads
# Examples:
# time python2.6 urandom-reads.py /tmp/urandom
# time python2.6 urandom-reads.py /dev/urandom
#
# R to generate a plot of the read time distribution at each level of concurrency
# rdt = read.csv("output.csv", header=F)
@ninehills
ninehills / README.md
Last active December 25, 2020 04:49
使用百度云CFC提供百度云BOS的文件查看服务

使用百度云CFC提供百度云BOS的文件查看服务

用途:BOS需要一个简单的文件查看页面,用于查看和下载

操作步骤

在百度云CFC函数计算中创建新的“空白函数”,运行时选择“Python 3.6“,超时时间选择 30s。 触发器选择“HTTP触发器”,URL路径为/{path+},HTTP方法为GET,不开启验证

创建完成后,将bos_fileserver.py的代码贴入代码框,调整其中的

@ninehills
ninehills / benchmarks.ipynb
Created September 19, 2016 07:28 — forked from dongweiming/benchmarks.ipynb
benchmarks.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import Terminal256Formatter
from pprint import pformat
def pprint_color(obj):
print highlight(pformat(obj), PythonLexer(), Terminal256Formatter())
@ninehills
ninehills / bing-wallpaper.sh
Created May 25, 2015 09:06
Auto download bing wallpapers.
#!/usr/bin/env bash
PICTURE_DIR="$HOME/Pictures/bing-wallpapers/"
mkdir -p $PICTURE_DIR
BING_URL="http://global.bing.com/?FORM=HPCNEN&setmkt=en-us&setlang=en-us#"
urls=( $(curl -s $BING_URL | \
grep -Eo "url:'.*?'" | \
sed -e "s/url:'\([^']*\)'.*/http:\/\/bing.com\1/" | \