用途:BOS需要一个简单的文件查看页面,用于查看和下载
在百度云CFC函数计算中创建新的“空白函数”,运行时选择“Python 3.6“,超时时间选择 30s。
触发器选择“HTTP触发器”,URL路径为/{path+}
,HTTP方法为GET
,不开启验证
创建完成后,将bos_fileserver.py
的代码贴入代码框,调整其中的
#!/usr/bin/env python | |
"""A fake smtp server, use system sendmail to send the mail. (need Python > 2.4)""" | |
import smtpd | |
import asyncore | |
from subprocess import Popen, PIPE | |
class FakeSMTPServer(smtpd.SMTPServer): | |
"""A Fake smtp server""" |
# 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) |
#!/bin/bash | |
# 参数1:延迟的时间,单位s | |
# 参数2:需要执行的命令 | |
# example: | |
# delay 10 "conky -d" | |
sleep $1 | |
exec $2 |
<?php | |
require("sql.php"); | |
//确保在连接客户端时不会超时 | |
set_time_limit(0); | |
//设置IP和端口号 | |
$address = 'localhost'; | |
$port = 2009; |
; ---------------------------------------------------------------------- | |
; XMac | |
; (Only for MacType, NOT SUPPORT THE OLD VERSION OF GDI++/HE) | |
; | |
; maxchow@qq.com | |
; QQ Group: 18988755 | |
; ---------------------------------------------------------------------- | |
[Preview] | |
Font=XHei OSX |
#!/usr/bin/expect | |
set timeout 60 | |
spawn /usr/bin/ssh -D 7070 -g username@yourserver.com | |
#这里的 username 为你自己的用户名,yourserver.com 为你自己的服务器域名或ip | |
expect { | |
"password:" { | |
send "password\r" | |
#将第二个 password 改为你自己的密码 | |
} |
function createXHR(){ | |
return window.XMLHttpRequest? | |
new XMLHttpRequest(): | |
new ActiveXObject("Microsoft.XMLHTTP"); | |
} | |
function getappkey(url){ | |
xmlHttp = createXHR(); | |
xmlHttp.open("GET",url,false); | |
xmlHttp.send(); | |
result = xmlHttp.responseText; |
[General] | |
Icon=Candy.ico,0 | |
DirectWrite=1 | |
HintSmallFont=1 | |
HintingMode=1 | |
AntiAliasMode=2 | |
NormalWeight=10 | |
BoldWeight=1 | |
ItalicSlant=-2 | |
EnableKerning=0 |
#!/bin/sh | |
# by Jakukyo Friel <weakish@gmail.com> | |
# under Apache License, Version 2.0, <http://www.apache.org/licenses/LICENSE-2.0.html> | |
### Submit offline download tasks to Baidu Pan. | |
## Requires: | |
# | |
# - [jq](http://stedolan.github.io/jq/) |