跳至主要内容

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 产品随想的博客

Steve Jobs on the iTunes Music Store: The Unpublished Interview

A candid talk with Apple's CEO on a landmark day in its history. By Laura Locke  |  Wednesday, December 7, 2011 at 1:15 am Steve Jobs announces the iTunes Music Store. On April 28th, 2003, moments before I was about to interview Steve Jobs at San Francisco’s Moscone Center, I was jittery. Anticipation? Nerves? Excitement? You bet. All of those visceral emotions were firing. Knowing Jobs’ storied reputation as an irascible and exacting Silicon Valley CEO had me on edge. But I had prepared a tight set of questions. Secretly, I was hoping he might enjoy the line of inquiry. In turn, I would have a lively and candid report for my editors at TIME. What I didn’t know was that the interview was taking place on what would turn out to be one of the most important days in Apple’s history: The launch of the iTunes Music Store. Once again, Ste...

“真假难辨”的效果图如何打造,以一只笔为例(下)——渲染篇

原文地址 独家教程 | “真假难辨”的效果图如何打造,以一只笔为例(下)——渲染篇 上期独家教程,康石石带大家用Rhino完成了 COPIC MULTILINER 针管笔建模(复习请戳: 独家教程 | “真假难辨”的效果图如何打造,以一只笔为例(上)——建模篇 ),下面我们把它丢进Keyshot渲染器里,看看究竟Keyshot究竟能不能打造真实照片一般的既视感。 Keyshot虽为各家晚辈,但近年来突飞猛进。有的同学说Keyshot渲染效果不如V-Ray,但我们可以看下本期独家教程内容再作判断。 基础材质赋予 首先我们打开 Keyshot 基本导入参数 导入后 由于我们事先在Rhino中,对各个部件分过色,所以我们可以直接,尽情 把左边各种需要的材质球直接拖到需要的部件上 。 初步赋予材质后效果 特写效果 环境光赋予 Keyshot预设的材质显然不能够完全适合所需情况,且物体上的光线并不是很正确。因此同学们需要 将环境光换成更加接近真实摄影棚的灯光场景 。 选用 3 Panels Tilted 2k 作为的基本环境光,将环境光拖入环境里之后,效果如下: 模型各部材质赋予 由于光影的变化,整个模型已更加真实。 接下来 各部的材质还需根据实际的视觉情况 手工调整 。 以下是这次模型各部材质的参数:   笔身主要的金属材质 黑色塑料件部分以及笔头的黑色 笔夹与笔头所使用的金属材质 Tip:金属材质是将Keyshot预设的钢材质的粗糙度调整为0.01而成。 握柄处的塑料材质 Tip:因为塑料的视觉特点,此处特地选用了 半透明属性的材质 做调整,除了表面颜色的参数之外,剩余的三个颜色区域均使用了 R255,G255,B255的纯白 。 笔身标签渲染 在给各部赋予了材质之后,产品很重要的一个环节就是印刷于产品之上的各种商标与说明,在Keyshot中,这些效果可以很轻松的通过标签功能来实现。 首先对实物上的印刷效果进行观察, 可以看出实物上的印刷效果其实是比较立体的 。 Tip: 细节,往往是产品品质的一种体现。 在效果图的渲染中,也应该...

BIM江湖演义——ArchiCAD vs Revit

原文 地址 江湖中历来不缺乏传奇。在建筑软件的这片江湖中,风云变幻,豪杰辈出,有两大世家始终屹立不倒——一个来自欧罗巴,名字低调:“图形软件”(Graphisoft),却继承了一身的艺术家气质,手握长剑白衣胜雪;一个来自美利坚,人称“自动桌子”(Autodesk),性格豪放不羁,七种武器样样精通。本文所说的,就是这两大世家的代表人物:ArchiCAD与Revit之间的较量。 这个论题本是老生常谈了,谈到BIM绕不过的就是Revit与ArchiCAD。两者的对比许多帖子都讨论过,但往往大而化之,原则性的东西多,细节的东西少,因此我想再作一次比较,希望能深入一点,具体一点,力争较为全面地反映两者的真实面貌。但这种对比往往两面都不讨好,你懂的,因此本文也多用戏说的语气,我姑妄说之,列位看官也就姑妄听之吧,有不当之处还请多多包涵! 先介绍一下本人对这两个软件的熟悉程度。我用ArchiCAD有4年了,出过几套施工图,都已竣工,编过一系列向日葵图库,颇受好评,对ArchiCAD的认识偏重于施工图;用Revit一年半,出过四个工程的土建及MEP模型,也用其API编了若干插件,对Revit的认识偏重于建模(包括结构及MEP建模)。应该说对ArchiCAD与Revit的认识都算深入了。 当然两者的深度比较是一个庞大的工程,而且个人看法难免有偏见,技术上也多有误解之处,因此希望各位能指正与补充。 1 软件的思想、架构对比 从软件的历史来说,无疑是ArchiCAD悠久得多,Revit是Autodesk在2002年才收购回来的,但Revit有一个强有力的东家,马上推出“BIM”这个很炫的口号,一下把ArchiCAD沿用多年的“虚拟建筑”这个老老实实的口号给打败了,于是ArchiCAD也只好宣称自己是个BIM软件,搞得在外人看来,倒像是Revit占了先机。 从软件设计的角度来看,两者也是差别巨大的。ArchiCAD从20多年前就致力于三维建筑设计,在这方面积累了足够多的经验,多年来也是沿用其架构做一些小更新、小完善、小整合。从我接触的7.0到最新的14.0,感觉比较大的变动就是10.0版整合PlotMaker、12版支持多核计算提升速度、12版新增幕墙工具、13版团队工作大幅改进。在界面上、使用习惯上一直差别不大,这也在一个侧面反映了ArchiCAD软件设计的一个“精英思路”——我本来就...

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,...

产品随想 | 周刊 第75期:2023.1.8 君民共主之国

Products 各大高校课程资源汇总   https://github.com/nwuzmedoutlook/university 120+国内高校课程资源纯手工整理,欢迎补充、修订 Ideas Marc Andreessen   https://www.theobservereffect.org/marc.html 关于阅读,工作计划 Design The biggest auction sales of 2022   https://insider.hagerty.com/trends/the-biggest-auction-sales-of-2022/ 非常精美的老车集合 它可能是個人電腦史上最重要的一張椅子:Herman Miller 和科技怎麼共同演化的?   https://blog.starrocket.io/posts/herman-miller-mother-of-invention/ 「如果說 Engelbart 是透過 科技 推動心智發展(他稱之為 bootstrap),那 Herman Miller 就是透過 家具 提升人類智識。」 Every Default macOS Wallpaper – in Glorious 6K Resolution   https://512pixels.net/projects/default-mac-wallpapers-in-5k/ Mac原始壁纸 Citizenship Consciousness & Privacy 豆瓣9.0分以上的社会学好书,你看过几本?   https://www.sohu.com/a/536977365_565460 读懂中国 史料搬运工 | 一生事业付诸流水后的反思   https://chinadigitaltimes.net/chinese/666961.html 「李鸿章是个谨小慎微之人。他没有在信函中说要如何做才能实现上下一心。但在郭、曾、薛三人的日记里,这个问题有一个共同的答案,那就是:将清廷变革为“君民共主之国”。」 Economy & Business & Market data 中国软件三十年:烟尘隐入,夹缝重生   https://mp.weixin.qq...

Steve Jobs talks about the difference between art and technology

  When asked by   Time   magazine about the difference between art and technology, Jobs said, “I’ve never believed that they’re separate. Leonardo da Vinci was a great artist and a great scientist. Michelangelo knew a tremendous amount about how to cut stone at the quarry. The finest dozen computer scientists I know are all musicians. Some are better than others, but they all consider that an important part of their life. I don’t believe that the best people in any of these fields see themselves as one branch of a forked tree. I just don’t see that. People bring these things together a lot. Dr. Land at Polaroid said, ‘I want Polaroid to stand at the intersection of art and science,’ and I’ve never forgotten that. I think that that’s possible, and I think a lot of people have tried.”

产品随想 | 周刊 第52期:HP家的Linux笔记本

Products 腾讯柠檬清理   https://github.com/Tencent/lemon-cleaner 腾讯开源,那基本意味着不再维护了...... (据专业人士看,代码写的烂) Teclis   https://teclis.com/ 一个比较窄,但质量非常高的搜索引擎 Ina La Revue Des Médias   https://larevuedesmedias.ina.fr/ 挺小众的法语网站,对于媒体,对于新闻热点的解读,还挺好 Dashy   https://github.com/Lissy93/dashy A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more! 全定制化的看板,非常酷 OpenSnitch   https://github.com/evilsocket/opensnitch OpenSnitch is a GNU/Linux port of the Little Snitch application firewall 好用的Linux网络状态监控软件,帮助盯住不老实的App 这个工具的创作者,Simone Margaritelli,evilsocket,非常高产 emoji-supply   https://github.com/alcor/emoji-supply 把 Emoji 组合成漂亮的壁纸、封面图 Vue Color Avatar   https://github.com/Codennnn/vue-color-avatar 一个纯前端实现的头像生成网站 itty.bitty   https://github.com/alcor/itty-bitty Itty.bitty is a tool to create links that contain small sites Administrative-divisions-of-China   https://github.com/modood/Administrativ...

写给大家看的中文排版指南

作者:Hindy 原文地址: http:// zhuanlan.zhihu.com/uici rcle/20506092 前言:很遗憾,我们的周围充斥着大量排版丑陋的文章。我国的字体排印与日本、美国等设计强国差距实在太大。我希望能够做些力所能及的小事,让更多人意识到“设计”的价值和其必要性,创造更美好的视觉环境。本文旨在帮助普及、提升大家对文字排版的认识,让大家在平时的学习工作中能有更专业的文字排版素养。 必看人群: 设计师、编辑、作家、撰稿人、教师、学生 目录: 1. 中文排版 1.1 引号 1.2 省略号与破折号 1.3 行首行尾禁则 2. 西文排版基础 2.1 西文撰写基础 2.2 西文标点相关 2.3 斜体的用法 2.4 大小写的区别 3. 中西文混排 3.1 基础原则 3.2 标点相关 1. 中文排版 1.1 引号 我国国家标准要求弯引号,个人建议使用直角引号。 示例:你竟然喜欢“苹果表”? 引号中再用引号使用双直角引号。 示例:我问他,“你竟然喜欢‘苹果表’?” 当引号表示讽刺、反语暗示时,使用弯引号(用法参考“西文排版”部分)。 示例:说真的,我也很 “喜欢”“苹果表”哦。 1.2 省略号(删节号)与破折号 省略号占两个汉字空间,包含六个点。 正确示例:中国设计还有太长路要走…… 错误示例:中国设计还有太长路要走… 破折号占两个汉字空间。 示例:中国设计还有太长路要走──加油罢。 1.3 行首行尾禁则 点号(顿号、逗号、句号等)、结束引号、结束括号等,不能出现在一行的开头。 错误示例: 排版时注意某些 符号不能在行首 ,别弄错了。 正确示例: 排版时注意某些 符号不能在行首, 别弄错了。 开始引号、开始括号、开始双书名号等,不能出现在一行的结尾。 错误示例: 她对我们说:“ 这书太赞了。” 正确示例: 她对我们说: “这书太赞了。” 2. 西文排版基础 2.1 西文撰写基础 句首字母大写。 单词间留空格。 示例:Have a question? 2.2 西文标点相关 点号后加一个空格(如逗号、句号等)。 示例:Hello everyone! Welcome to my blog....

Laurene’s own remarks about Steve

Steve and I met here, at Stanford, the second week I lived in California. He came here to give a talk, and afterwards we found each other in the parking lot. We talked until four in the morning. He proposed with a fistful of freshly picked wildflowers on a rainy New Year’s Day. I said yes. Of course I said yes. We built our lives together. He shaped how I came to view the world. We were both strong-minded, but he had a fully formed aesthetic and I did not. It is hard enough to see what is already there, to remove the many impediments to a clear view of reality, but Steve’s gift was even greater: he saw clearly what was not there, what could be there, what had to be there. His mind was never a captive of reality. Quite the contrary. He imagined what reality lacked, and he set out to remedy it. His ideas were not arguments but intuitions, born of a true inner freedom. For this reason, he possessed an uncannily large sense of possibility—an epic sense of possibility. Steve’s love of beaut...

产品随想 | 周刊 第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...