跳至主要内容

Raspberry Pi从零开始搭建低成本NAS(7)-Aria2远程下载

原文地址是:http://www.mkitby.com/2016/01/15/raspberry-pi-nas-remote-download-aria2/
对作者表示感谢,作者关于NAS的系列文章写的都很棒,可以一看

远程下载内容比较多,所以分为两篇文章,先介绍Aria2,再介绍迅雷。
Aria2是一个轻量级命令行下载工具,支持HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink下载,但是不支持ed2k,支持JSON-RPC和XML-RPC调用,可以远程控制。
1.先安装aria2
sudo apt-get install aria2 –y
2.创建 aria2 配置文件 “/home/pi/.aria2/aria2.conf” 和 “/home/pi/.aria2/aria2.session” 这个文件 (我是以 pi 账户启动 aria2 的),
mkdir /home/pi/.aria2
touch /home/pi/.aria2/aria2.session
vim /home/pi/.aria2/aria2.conf
配置文件内容如下。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# 基本配置
# 下载目录
dir=/home/pi/nas-data/Inbox
# 下载从这个文件中找到的urls, 需自己建立这个文件
# touch /home/pi/.aria2/aria2.session
input-file=/home/pi/.aria2/aria2.session
# 最大同时下载任务数,默认 5
#max-concurrent-downloads=5
# 断点续传,只适用于 HTTP(S)/FTP
continue=true
# HTTP/FTP 配置
# 关闭连接如果下载速度等于或低于这个值,默认 0
#lowest-speed-limit=0
# 对于每个下载在同一个服务器上的连接数,默认 1
max-connection-per-server=5
# 每个文件最小分片大小,例如文件 20M,设置 size 为 10M, 则用2个连接下载,默认 20M
#min-split-size=10M
# 下载一个文件的连接数,默认 5
#split=5
# BT 特殊配置
# 启用本地节点查找,默认 false
bt-enable-lpd=true
# 指定最大文件数对于每个 bt 下载,默认 100
#bt-max-open-files=100
# 单种子最大连接数,默认 55
#bt-max-peers=55
# 设置最低的加密级别,可选全连接加密 arc4,默认是头加密 plain
#bt-min-crypto-level=plain
# 总是使用 obfuscation handshake,防迅雷必备,默认 false
bt-require-crypto=true
# 如果下载的是种子文件则自动解析并下载,默认 true
#follow-torrent=true
# 为 BT 下载设置 TCP 端口号,确保开放这些端口,默认 6881-6999
listen-port=65298
#Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker
dht-listen-port=65298
# 整体上传速度限制,0 表示不限制,默认 0
#max-overall-upload-limit=0
# 每个下载上传速度限制,默认 0
#max-upload-limit=0
# 种子分享率大于1, 则停止做种,默认 1.0
#seed-ratio=1
# 做种时间大于2小时,则停止做种
seed-time=120
# RPC 配置
# 开启 JSON-RPC/XML-RPC 服务,默认 false
enable-rpc=true
# 允许所有来源,web 界面跨域权限需要,默认 false
rpc-allow-origin-all=true
# 允许外部访问,默认 false
rpc-listen-all=true
# rpc 端口,默认 6800
rpc-listen-port=6800
# 设置最大的 JSON-RPC/XML-RPC 请求大小,默认 2M
#rpc-max-request-size=2M
# rpc 密码,可不设置
#rpc-passwd=raspberry
# rpc 用户名,可不设置
#rpc-user=aria2pi
# 高级配置
# This is useful if you have to use broken DNS and
# want to avoid terribly slow AAAA record lookup.
# 默认 false
disable-ipv6=true
# 指定文件分配方法,预分配能有效降低文件碎片,提高磁盘性能,缺点是预分配时间稍长
# 如果使用新的文件系统,例如 ext4 (with extents support), btrfs, xfs or NTFS(MinGW build only), falloc 是最好的选择
# 如果设置为 none,那么不预先分配文件空间,默认 prealloc
file-allocation=falloc
# 整体下载速度限制,默认 0
#max-overall-download-limit=0
# 每个下载下载速度限制,默认 0
#max-download-limit=0
# 保存错误或者未完成的下载到这个文件
# 和基本配置中的 input-file 一起使用,那么重启后仍可继续下载
save-session=/home/pi/.aria2/aria2.session
# 每5分钟自动保存错误或未完成的下载,如果为 0, 只有 aria2 正常退出才回保存,默认 0
save-session-interval=300
# 若要用于 PT 下载,需另外的配置,这里没写
RPC调用加入验证(外网调用最好加上验证),可以采用下面两种方式:
1) 使用token验证(建议使用,需要1.18.4以上版本,帐号密码方式将在后续版本中停用!)
# token验证
rpc-secret=secret
在YAAW中使用 http://token:secret@hostname:port/jsonrpc 的地址格式设置secret.
2 )如果需要使用密码验证(需要1.15.2以上,1.18.6以下版本)
#用户名
rpc-user=username
#密码
rpc-passwd=passwd
在YAAW中使用 http://username:passwd@hostname:port/jsonrpc 的地址格式设置密码.
3.运行 aria2, 测试配置是否有错误,如果没有提示任何错误信息,那就按Ctrl+C停止。
aria2c --conf-path=/home/pi/.aria2/aria2.conf
4.为 aria2 添加自启动服务
1) 新建 sudo vim /etc/init.d/aria2c 文件,输入以下内容
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /bin/sh
# /etc/init.d/aria2c
### BEGIN INIT INFO
# Provides: aria2c
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: aria2c RPC init script.
# Description: Starts and stops aria2 RPC services.
### END INIT INFO
#VAR
RUN="/usr/bin/aria2c"
ARIA_PID=$(ps ux | awk '/aria2c --daemon=true --enable-rpc/ && !/awk/ {print $2}')
# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting script aria2c "
if [ -z "$ARIA_PID" ]; then
$RUN --daemon=true --enable-rpc=true -D --conf-path=/home/pi/.aria2/aria2.conf
echo "Started"
else
echo "aria2c already started"
fi
;;
stop)
echo "Stopping script aria2c"
if [ ! -z "$ARIA_PID" ]; then
kill $ARIA_PID
fi
echo "OK"
;;
restart)
echo "Restarting script aria2c"
if [ ! -z "$ARIA_PID" ]; then
kill $ARIA_PID
fi
sleep 3 # TODO:Maybe need to be adjust
$RUN --daemon=true --enable-rpc=true -D --conf-path=/home/pi/.aria2/aria2.conf
echo "OK"
;;
status)
if [ ! -z "$ARIA_PID" ]; then
echo "The aria2c is running with PID = "$ARIA_PID
else
echo "No process found for aria2c RPC"
fi
;;
*)
echo "Usage: /etc/init.d/aria2c {start|stop|restart|status}"
exit 1
;;
esac
exit 0
2) 添加可执行权限
sudo chmod +x /etc/init.d/aria2c
3) 然后更新rc,添加自启动服务
sudo update-rc.d aria2c defaults
4) 最后重启aria2c服务
sudo service aria2c restart
5.安装web 前端yaaw或者webui-aria2来实现web管理
yaaw 和 webui-aria2 都是不错的,yaaw 界面简洁,wubui-aria2 功能强大,可以根据自己的喜好来选择。
1) 首先需要安装需要安装 nginx
sudo apt-get install nginx –y
2) 接下来我们来配置nginx,首先打开配置文件,/etc/nginx/nginx.conf ,按照下面的配置进行修改。
1
2
3
4
5
6
7
8
9
10
11
user www-data; #默认以www-data运行工作进程
worker_processes 1; #单工作进程足够了,就我自己访问
worker_connections 256; #一般支持100在线连接就达到raspberry pi的极限了
gzip on; #gzip开启取消前面的#让默认设置生效即可,可以加快网页访问速度
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
3) 配置站点属性
sudo vim /etc/nginx/sites-availiable/default
输入,
server {
listen 81; # 访问端口号
#listen [::]:80 default_server; # 一定要注释掉,ipv6
server_name pi.com;
root /var/www/html; #站点存储位置
4) 测试配置文件看有没有问题
sudo nginx -t
如果没有问题会显示
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
5) 创建目录,然后设置权限
sudo mkdir /var/www && sudo mkdir /var/www/html
sudo chown -R www-data:www-data /var/www/html
sudo chmod -R 0755 /var/www/html
6) 下载webui-aria2
sudo git clone https://github.com/ziahamza/webui-aria2.git /var/www/html/
7) 重新启动nginx服务
sudo service nginx restart
到这一步了,现在我们通过http://192.168.1.118:81/webui-aria2/ 来访问,如果提示链接到aria2 RPC server失败,重启aria2c服务,然后刷新网页即可。
6.Aria2定时下载功能
1) 首先创建定时下载脚本,sudo vim /home/pi/.aria2/aria2_auto.py,输入如下内容,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
import urllib2, json, time
WEEKDAY = int(time.strftime('%w'))
HOUR = int(time.strftime('%H'))
jsonreq_pauseAll = json.dumps({'jsonrpc':'2.0', 'id':'qwer','method':'aria2.pauseAll'})
jsonreq_unpauseAll = json.dumps({'jsonrpc':'2.0', 'id':'qwer','method':'aria2.unpauseAll'})
if WEEKDAY in [1,2,3,4,5]:
if HOUR == 1:
urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq_unpauseAll)
if HOUR == 17:
urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq_pauseAll)
if WEEKDAY in [6,0]:
if HOUR == 2:
urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq_unpauseAll)
if HOUR == 9:
urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq_pauseAll)
上面代码的意思就是周一到周五1:00~17:00,周末两天2:00~9:00,开启全部下载任务,其他时间暂停全部下载任务。然后加入cron实现定时运行
sudo crontab -e
在文件末尾加入
0 * * * * /usr/bin/python2 /home/pi/.aria2/aria2_auto.py
表示每个小时运行一次脚本。
7.BT端口映射
上面BT监听TCP, UDP端口都为65298,需要在路由器里面设置端口映射,服务端口号填65298,IP地址填树莓派内网IP地址192.168.1.118。
8.外网访问webui-aria2
下面会考虑三种典型的网络环境,前提都是路由器WAN是公网IP。
第一种网络环境:
Raspberry Pi的本地网络供应商80, 8080端口没有被封,从外网能正常访问,这个最简单了,修改树莓派nginx站点属性配置,把端口改为80, 然后在路由器上设置端口映射,80端口映射到树莓派上,然后路由器绑定动态域名,这样通过动态域名就可以在外网直接访问Aria2。
第二种网络环境:
Raspberry Pi的本地网络供应商80, 8080端口被封,你所在其他网络能正常访问外网,修改树莓派nginx站点属性配置,把端口改为81(或者其他能访问的端口),同样在路由上设置端口映射,绑定动态域名。
第三种网络环境:
Raspberry Pi的本地网络供应商80, 8080端口被封,公司只开放80, 8080端口。那么如何在公司畅快的远程下载呢?下面介绍我是如何实现的:
1) 首先需要有一台VPS,通过搭建nginx反向代理服务来实现远程下载。
配置nginx
sudo vim /etc/nginx/nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
user nginx;
worker_processes 1;
#error_log logs/error.log;
#pid logs/nginx.pid;
worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
sendfile on;
keepalive_timeout 65;
gzip on;
client_max_body_size 50m;
client_body_buffer_size 256k;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
proxy_connect_timeout 300s;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_ignore_client_abort on;
}
2) 创建反向代理配置文件
sudo vim /etc/nginx/conf.d/reverser-proxy.conf
输入内容
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
server
{
listen 8080;
server_name xxx.xxx.xxx.xxx; #VPS IP Address
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://xxxx.oicp.net:6800; # RPC web address, http://xxxx.oicp.net 为动态域名
}
}
server
{
listen 80;
server_name xxx.xxx.xxx.xxx; #VPS IP Address
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://xxxx.oicp.net:81; #aria2 web gui
}
}
3) 路由器添加端口映射,81(webgui), 6800(rpc)端口。
4) 通过http://xxx.xxx.xxx.xxx 访问aria2 web gui, aria2采用token验证,通过http://token:secret@ xxx.xxx.xxx.xxx:8080/jsonrpc访问RPC, xxx.xxx.xxx.xxx为VPS IP地址。

这三种情况下都需要动态域名来绑定到路由器IP地址。关于动态域名,如果不清楚的,可以参考我后面的文章 Raspberry Pi从零开始搭建低成本NAS(9)-外网登录树莓派。里面会介绍动态域名,还会介绍不通过动态域名,如何在外网来访问树莓派。

Popular posts from 产品随想的博客

《沸腾十五年》

  《沸腾十五年》 讲述中国,1995-2009 1995互联网商业元年 马云中国黄页 杭州电信有着非常好的社会资源和政府资源,马云却一样都没有。 杭州电信利用中国黄页( chinapage.com )已有的名声,做了一个名字很接近的网站,也叫“中国黄页”( chinesepage.com ),借以分割马云版“中国黄页”的市场。 海归、极客、商人成为中国互联网创业者中的三大特色群体(VC是推手) 1996海归归来 为了确保搜狐不被遗忘,张朝阳选择了最便宜也最有效的方法:树立个人品牌。 1997大门洞开 互联网的一年等于其他行业的7年 网易免费电子邮箱系统一出,中关村性急的评论家们甚至给丁磊戴上第三代程序员的帽子,这个代别划分是这样的:基于DOS平台开发的是第一代,基于Windows平台开发的是第二代,基于Internet平台开发的是第三代。 1998极客当道 曾李青是腾讯5个创始人中最好玩、最开放、最具激情和感召力的一个,与温和的马化腾、爱好技术的张志东相比,是另一个类型。 周鸿祎在公开场合经常教育年轻的创业者,应该先用创业的心态去打工,充分积累自己在管理和业务上的能力和资源 1999狂欢开始了 海归、商人、极客、VC推手,这四类人一起齐刷刷地汇聚在1999年,1999年就这样成为中国互联网最黄金、最灿烂、最辉煌、最值得念想的大年份。 2000泡沫四溢 亚马逊的卖点是:‘最近50年的书我们都有’——这是它提供海量品种的意义。(因为国外有很高的信息化程度,以查询库房是否有存书) 雷军在商店买T恤的时候,发现了求同消费现象。“中国经济和美国经济处在不同的发展阶段,美国消费者寻求个性消费,中国现阶段,需求高度趋同,中国需要50年前版书的人极少。” 单品价格压得再便宜,但5元钱的配送费卓越坚决不免,用户冲着几乎免费的产品而来,但想想既然要出5元的配送费,买一样商品是这个钱,10样商品也是,不如多挑几样商品。 雷军发现,互联网比软件要好玩得多,可以不断地改,不断地去修正,用户可以很快地反馈给你,你也可以很快地进步 2001大转折 段永平反问他:“你卖了公司之后干吗?”丁磊说:“我卖了公司有钱后再开一家公司。” 段永平发现,网易股票被低估是因为公司面临一场官司,也可能被摘牌,这里面有些不确定性。段永平就去找一些法律界人士问官司的问题,问类似的官司最可能的结果是什么,得到...

产品随想 | 陪读《芯片战争》:一、二章

作者其它书也值得读读 已出版《食用油营销第1书》《金龙鱼背后的粮油帝国》《鲁花:一粒花生撬动的粮油帝国》《手机战争》等财经书籍。 第一章 从晶体管到芯片 肖克利要创业的消息,就像17世纪的牛顿宣布要建立工场一样引起了轰动。那时候,美国还在草创时期的半导体产业主要集中在东部的波士顿和纽约长岛地区,许多科学家和工程师精英都慕肖克利之名前往美国西海岸,不远千里地聚集在肖克利旗下。可以这么说,肖克利给硅谷带来了最初的火种。 ——我也認可這個說法,不是斯坦福或其他校園,純粹是人才的原因 芯片发明后的六年间,政府对芯片项目的资助高达3200万美元,其中70%来自空军。同期美国半导体产业的研发经费有约85%的比例来自政府,政府的支持成就了美国在半导体领域的技术优势。“华盛顿通过支付技术研发费用和保证最终产品的市场份额,将原子弹最终制造成功的间隔缩短至六年,晶体管缩短至五年,集成电路缩短至三年。”不过,这些半导体企业实力壮大以后,往往不愿再参与美国政府出资的研发项目,因为那意味着专利权归政府所有,而且还得受保密条款的约束。 ——這纔是更合理的產業支持政策 诺伊斯采用激进的价格政策,将主要芯片产品的价格一举降到1美元,不仅是市场上的主流芯片价格的零头,还低于当时芯片的成本。这不是传统意义上的亏本倾销,而是第一个以反摩尔定律为定价依据的案例。反摩尔定律认为,同样的芯片在18个月后价格就会跌一半,所以按照几年后的价格为当前的芯片定价是有一定合理性的。市场被迅速打开,芯片很快在民用市场得到越来越广泛的应用,仙童的营收和利润都迅速上升,还带动了其母公司的股价上涨。摩尔后来评论:“诺伊斯以低价刺激需求,继而扩大产能、降低成本的策略,对于芯片产业的发展而言,其重要性堪比芯片的发明。” ——看到這裏的時候,真是非常震撼,好厲害的定價策略 东通工用磷渗透法研发出了高频的晶体管,于1957年做出世界上第一款袖珍收音机,并在这款产品上启用了索尼商标。盛田昭夫到美国去推销袖珍收音机的时候,德州仪器刚刚轻率地放弃了这个市场。美国人对盛田昭夫说:你们为什么要制造这种小收音机?美国人都想要大收音机。盛田昭夫回答:单单纽约就有20多家广播公司,同时就有20多套节目在播放,每人使用一台小收音机收听自己喜欢的节目,岂不更好?索尼用“一人一台”的宣传成功打破了美国人全家共用一台大型收音机的观念,成为全世界最畅销的收音机...

Scott Forstall: "Great leaders exude a positive attitude of possibility and don’t shy from working harder than their employees and taking risks."​

  Scott Forstall led the team at Apple that developed the iPhone – and is equally successful in vastly different realms, including co-producing multiple Tony Award winning Broadway shows. What has always impressed me most, though, is the time he devotes to mentoring a diverse set of entrepreneurial founders. We’ve had the pleasure of knowing each other for several years, thanks to mutual friend Ali Partovi ’s incredible Neo community , a mentor community, accelerator and VC through which we support junior engineers to become senior leaders. Ali was an early backer of Airbnb, Dropbox, Uber and Facebook, so I knew I was in good hands! At our recent Neo reunion I was able to catch-up with Scott for a wide-ranging conversation on the landscapes of opportunity in technology and what we’re anticipating next. He kindly agreed to go o...

产品随想 | 周刊 第116期:Great things in business are never done by one person.

Cromite   https://github.com/uazo/cromite Cromite a Bromite fork with ad blocking and privacy enhancements; take back your browser! awesome-shizuku   https://github.com/timschneeb/awesome-shizuku Curated list of awesome Android apps making use of Shizuku KernelSU   https://github.com/tiann/KernelSU A Kernel based root solution for Android Love, Hate or Fear It, ​​TikTok Has Changed America   https://www.nytimes.com/interactive/2024/04/18/business/media/tiktok-ban-american-culture.html?unlocked_article_code=1.mE0.DpEZ.VWmNssw5B6_c "My model for business is The Beatles.There were four guys who kept each others, kind of, negative tendencies in check. They balanced each other, and the total was greater than the sum of the parts. And that's how I see business. You know, great things in business are never done by one person. They're done by a team of people. "Our motivation is simple--we want to provide the most advanced and innovative platform to our developers, and we wa...

《Becoming Steve Jobs》Chapter 11 Do Your Level Best

As a mass-market consumer electronics device, the iPod would eventually be sold, of course, all the usual places: Best Buy, Circuit City, big-box department stores, and even the computer retailers like CompUSA. Steve disdained all these outlets. His obsession with his products continued well after they’d been manufactured. The tacky, low-margin hustle of these chains ran completely against the minimalist aesthetic of his products and the clean exuberance of his marketing. There was only one place where he really enjoyed seeing his products sold to the public: his own Apple stores, which had debuted four months ahead of the iPod. 觉得那些喧嚣、嘈杂的零售渠道,配不上自己极美的产品 Going back as far as the debut of the Mac, Steve had always groused about the way Apple computers were sold in its resellers’ stores. The way his computers were displayed and sold represented the very worst of what could go wrong when things weren’t done his way. The salespeople, always interested in quick turnover, seemed to make litt...

产品随想 | 周刊 第117期:He saw the intersection of art and science and business and built an organization to reflect that.

He disliked biography attempts. “I regard my scientific papers as my essential biography,’’ Land said. “I pour my whole life into the scientific project I’m investigating. I leave behind the things I’ve done in the past to do the work in the present.’’ “The purpose of inventing instant photography was essentially aesthetic,’’ Land said in 1947, announcing the process’s invention. “We live in a world changing so rapidly that what we mean frequently by common sense is doing the thing that would have been right last year.” — Edwin Land, Statement to Polaroid Corporation employees (25 June 1958) The worldview he was describing perfectly echoed Land’s: “Market research is what you do when your product isn’t any good.” And his sense of innovation: “Every significant invention,” Land once said, “must be startling, unexpected, and must come into a world that is not prepared for it. If the world were prepared for it, it would not be much of an invention.” Thirty years later, when a reporter ask...

Bilibili Q2 2023 Earnings Call Transcript

Moving on to our community growth. Our DAUs increased by 15% year-over-year to 96.5 million in the second quarter, driving our DAU to MAU ratio up to 29.8%. In the second half of this year, we plan to shift our video watching metric from video views to video time spent, which will help our users discover more high-quality content on Bilibili. In addition, we are exploring new live broadcasting products to create more paying channels for our users, including live celebration events. We expect our ongoing integration activities to support our revenue growth in the second half of 2023. Our top five advertising verticals in the second quarter were games, e-commerce, digital products and home appliances, skincare and cosmetics, and food and beverage. 五大Top广告垂类 In the meantime, we have seven new titles that we plan to release in domestic and overseas markets in the second half of the year, including the highly anticipated game Pretty Derby 期待7款游戏能红火一波 We cut sales and marketing expenses by 2...

产品随想 | 读《置身事内:中国政府与经济发展》 第一章:地方政府的权力与事务

产品随想 此书写于疫情封锁期间的那2个月,作者表述是,平时太忙没时间,疫情封锁刚好有大块完整空闲 ──果真是有闲,才能促进思考,当大家都忙于房贷、生存的时候,即使是智者,也没时间思考 引言 一套严格的概念框架无疑有助于厘清问题,但也经常让人错把问题当成答案。社会科学总渴望发现一套“放之四海而皆准”的方法和规律,但这种心态需要成熟起来。不要低估经济现实的复杂性,也不要高估科学工具的质量。 ——亚历山大·格申克龙《经济落后的历史透视》 ──别把问题当成是答案 前言 我剔除了技术细节,尽量用通俗的语言讲述核心的内容和观念:在我国,政府不但影响“蛋糕”的分配,也参与“蛋糕”的生产,所以我们不可能脱离政府谈经济。必须深入了解这一政治经济机体如何运作,才可能对其进行判断。我们生活在这个机体中,我们的发展有赖于对这个机体的认知。要避免把舶来的理论化成先入为主的判断——看到现实与理论不符,便直斥现实之非,进而把要了解的现象变成了讥讽的对象——否则就丧失了“同情的理解”的机会。 ──开宗明义,即:我们学到的西方经济学,与中国现实不符合时,不应该直接讽刺中国,而应更深了解中国。政府参与蛋糕生产、蛋糕分配的表述,足够清晰。 对从事经济实务工作(如金融和投资)的读者,我希望能帮助他们了解日常业务之外的政治经济背景,这些背景的变化往往对行业有深远的影响。对经济学专业的大学生,由于他们所学的西方理论和中国现实之间脱节严重,我将中国政府作为本书分析的主角,希望可以帮助构建二者之间的桥梁。对非经济学专业的读者,我希望这本书能帮助他们读懂国家政经大事和新闻。 ──1000个哈姆雷特 本书注重描述现实,注重解释“是什么”和“为什么”。当不可避免涉及“怎么办”的时候,则注重解释当下正在实施的政策和改革。对读者来说,了解政府认为应该怎么办,比了解“我”认为应该怎么办,重要得多。 ──“比了解“我”认为应该怎么办,重要得多”,个人不赞同,更好的做法是,了解政府认为怎么做之后,仍继续思考、提出自己认为更优的解法,因为政府采取的方案,并不一定是最优的。 本书几乎每一章的主题,复旦的同事都有研究和著述,我从他们那里学到了很多。在复旦工作的六七年中,我几乎每周都参加陈钊和陆铭等同仁组织的学习讨论小组,本书中的很多想法都源于这些讨论。 ──又推荐了2名学者 书籍框架 第一章:介绍决定地方事务范围的主要因素,这些因素不...

Steve Jobs: Rolling Stone’s 2003 Interview

  When Steve Jobs cruises into the airy reception area on the Apple Computer campus in Cupertino, California, on a recent morning, nobody pays much attention to him, even though he’s the company’s CEO. He’s wearing shorts, a black T-shirt and running shoes. Tall and a little gawky, Jobs has a fast, loping walk, like a wolf in a hurry. These days Jobs seems eager to distance himself from his barefoot youth – who was that crazy kid who once called the computer “a bicycle for the mind”? – and driven to prove himself as a clear-thinking Silicon Valley capitalist. Jobs punches the elevator button to the fourth floor, where his small office is located. For a man who is as responsible as anyone for the wonder and chaos of Silicon Valley, Jobs’ view of it all is surprisingly modest: shrubby treetops extending out toward San Francisco Bay, the distant whoosh of the freeway below. There is nothing modest, however, about Apple’s recent accomplishments. In the past few months,...

Hacking Team武器库

之前百度盘上公开了部分Hacking Team工具,自己一直没有看懂,今天在泉哥博客上看到他对于武器库的几篇文章,mark一下