Ubuntu 安装 VLC

安装 VLC

参考 VLC media player for Ubuntu

1
2
huzhifeng@Ubuntu16041:~$ sudo apt-get update
huzhifeng@Ubuntu16041:~$ sudo apt-get install vlc browser-plugin-vlc

设置 VLC 为默认播放器

进入 System Settings -> Details -> Default Applications -> Video,从下拉菜单中选择 VLC media player 即可

创建桌面快捷图标

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
huzhifeng@Ubuntu16041:~$ dpkg-query --listfiles vlc | grep desktop
/usr/share/applications/vlc.desktop
/usr/share/kde4/apps/solid/actions/vlc-openvcd.desktop
/usr/share/kde4/apps/solid/actions/vlc-opencda.desktop
/usr/share/kde4/apps/solid/actions/vlc-opendvd.desktop
/usr/share/kde4/apps/solid/actions/vlc-openbd.desktop
huzhifeng@Ubuntu16041:~$ cp /usr/share/applications/vlc.desktop ~/Desktop/
huzhifeng@Ubuntu16041:~$ vim ~/Desktop/vlc.desktop
huzhifeng@Ubuntu16041:~$ chmod a+x ~/Desktop/vlc.desktop
huzhifeng@Ubuntu16041:~$ cat ~/Desktop/vlc.desktop
[Desktop Entry]
Version=1.0
Name=VLC media player
Exec=/usr/bin/vlc --started-from-file %U
Icon=vlc
Terminal=false
Type=Application
huzhifeng@Ubuntu16041:~$
阅读全文 »

frp 是一个高性能的反向代理应用,可以帮助轻松地进行内网穿透,对外网提供服务,支持 tcp, udp, http, https 等协议类型,并且 web 服务支持根据域名进行路由转发。

下载 frp

下载最新版本的 frp v0.9.3,解压后将 frpsfrps.ini 放到有公网 IP 的机器上,将 frpcfrpc.ini 放到处于内网环境的机器上。

1
2
3
4
5
6
7
8
➜ ~ mkdir frp
➜ ~ cd frp
➜ frp wget https://github.com/fatedier/frp/releases/download/v0.9.3/frp_0.9.3_linux_amd64.tar.gz
➜ frp tar -xzf frp_0.9.3_linux_amd64.tar.gz
➜ frp cd frp_0.9.3_linux_amd64
➜ frp_0.9.3_linux_amd64 ls
frpc frpc.ini frpc_min.ini frps frps.ini frps_min.ini LICENSE
➜ frp_0.9.3_linux_amd64

SSH 反向代理实验

参考 Github 上说明文档中的使用示例
通过 ssh 访问公司内网机器

公网服务器端配置

1
2
3
4
5
6
7
8
9
root@vps:~/frp/frp_0.9.3_linux_amd64# cat frps.ini
[common]
bind_port = 7000
[ssh]
listen_port = 6000
auth_token = 123
root@vps:~/frp/frp_0.9.3_linux_amd64# ./frps -c ./frps.ini
2017/02/15 20:22:42 [main.go:194] [I] Start frps success

内网客户端配置

1
2
3
4
5
6
7
8
9
10
11
12
13
➜ frp_0.9.3_linux_amd64 cat frpc.ini
[common]
server_addr = 43.242.xxx.xxx
server_port = 7000
auth_token = 123
[ssh]
local_ip = 127.0.0.1
local_port = 22
➜ frp_0.9.3_linux_amd64 ./frpc -c ./frpc.ini
2017/02/15 20:26:27 [main.go:109] [I] Start frpc success
2017/02/15 20:26:27 [control.go:206] [I] ProxyName [ssh], connect to server [43.242.xxx.xxx:7000] success!
2017/02/15 20:26:27 [control.go:220] [I] Start to send heartbeat to frps

测试

1
➜ ~ ssh root@43.242.xxx.xxx -p 6000
阅读全文 »

Foxit Reader 是一款小巧、快速且功能丰富的 PDF 阅读器,跨平台支持 Windows/Linux/Mac

下载

1
2
3
4
5
6
➜ Downloads wget http://cdn01.foxitsoftware.com/pub/foxit/reader/desktop/linux/2.x/2.3/en_us/FoxitReader2.3.0.2174_Server_x64_enu_Setup.run.tar.gz
➜ Downloads ls -lh FoxitReader2.3.0.2174_Server_x64_enu_Setup.run.tar.gz
-rw-rw-r--. 1 huzhifeng huzhifeng 65M Feb 14 16:48 FoxitReader2.3.0.2174_Server_x64_enu_Setup.run.tar.gz
➜ Downloads md5sum FoxitReader2.3.0.2174_Server_x64_enu_Setup.run.tar.gz
1f870461404d90e15c750cec1b29eafb FoxitReader2.3.0.2174_Server_x64_enu_Setup.run.tar.gz
➜ Downloads

安装

参考

1
2
3
4
5
6
7
8
9
10
Please follow the steps below to install Foxit Reader for Linux:
Change to the directory containing the downloaded file (used /tmp as the example):
# cd /tmp
Uncompress the executable:
# gzip -d 'FoxitReader_version_Setup.run.tar.gz'
Untar the .tar file:
# tar xvf 'FoxitReader_version_Setup.run.tar'
Run the installer:
# ./'FoxitReader_version_Setup.run'

安装过程如下

1
2
3
➜ Downloads tar -xzf FoxitReader2.3.0.2174_Server_x64_enu_Setup.run.tar.gz
➜ Downloads sudo ./FoxitReader.enu.setup.2.3.0.2174\(r242174\).x64.run
➜ Downloads /opt/foxitsoftware/foxitreader/FoxitReader.sh

创建桌面快捷图标

1
2
3
4
5
6
7
8
9
10
11
12
13
➜ Downloads cp /opt/foxitsoftware/foxitreader/FoxitReader.desktop ~/Desktop
➜ Downloads sudo chown huzhifeng:huzhifeng ~/Desktop/FoxitReader.desktop
➜ Downloads chmod +x ~/Desktop/FoxitReader.desktop
➜ Downloads vim ~/Desktop/FoxitReader.desktop
➜ Downloads cat ~/Desktop/FoxitReader.desktop
[Desktop Entry]
Name=Foxit Reader
Version=1.0
Terminal=false
Type=Application
Icon=/opt/foxitsoftware/foxitreader/images/FoxitReader-128x128.png
Exec=/opt/foxitsoftware/foxitreader/FoxitReader.sh %F
➜ Downloads

其它 PDF 工具

Evince
Okular

EOF

Rime 中州韵输入法引擎,是一个跨平台的输入法算法框架。

Ubuntu 安装 ibus-rime

安装 ibus-rime

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
huzhifeng@Ubuntu16041:~$ sudo apt-get install -y ibus-rime
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libboost-chrono1.58.0 libboost-regex1.58.0 libboost-thread1.58.0 libgflags2v5 libgoogle-glog0v5 libkyotocabinet16v5 libmarisa0 libopencc1 librime-bin librime-data librime-data-cangjie5
librime-data-luna-pinyin librime1 libyaml-cpp0.5v5
Suggested packages:
librime-data-bopomofo librime-data-combo-pinyin librime-data-double-pinyin librime-data-ipa-xsampa librime-data-jyutping librime-data-pinyin-simp librime-data-quick5 librime-data-scj6
librime-data-stenotype librime-data-stroke librime-data-terra-pinyin librime-data-sampheng librime-data-wubi librime-data-wugniu librime-data-zyenpheng
The following NEW packages will be installed:
ibus-rime libboost-chrono1.58.0 libboost-regex1.58.0 libboost-thread1.58.0 libgflags2v5 libgoogle-glog0v5 libkyotocabinet16v5 libmarisa0 libopencc1 librime-bin librime-data librime-data-cangjie5
librime-data-luna-pinyin librime1 libyaml-cpp0.5v5
0 upgraded, 15 newly installed, 0 to remove and 182 not upgraded.
Need to get 12.9 MB of archives.
huzhifeng@Ubuntu16041:~$ dpkg-query --listfiles ibus-rime
/.
/usr
/usr/share
/usr/share/ibus
/usr/share/ibus/component
/usr/share/ibus/component/rime.xml
/usr/share/ibus-rime
/usr/share/ibus-rime/icons
/usr/share/ibus-rime/icons/disabled.png
/usr/share/ibus-rime/icons/abc.png
/usr/share/ibus-rime/icons/zh.png
/usr/share/ibus-rime/icons/sync.png
/usr/share/ibus-rime/icons/reload.png
/usr/share/ibus-rime/icons/keyboard.png
/usr/share/ibus-rime/icons/rime.png
/usr/share/ibus-rime/icons/pen.png
/usr/share/doc
/usr/share/doc/ibus-rime
/usr/share/doc/ibus-rime/README
/usr/share/doc/ibus-rime/copyright
/usr/share/doc/ibus-rime/changelog.Debian.gz
/usr/lib
/usr/lib/ibus-rime
/usr/lib/ibus-rime/ibus-engine-rime
huzhifeng@Ubuntu16041:~$

重启 ibus 服务

添加输入法之前需要重启ibus服务

1
huzhifeng@Ubuntu16041:~$ ibus restart

添加rime输入法

打开系统设置进入System Settings->Keyboard->Typing->Text Entry,点击加号+,添加输入法Chinese (Rime) (IBus)
然后记得勾选左下方的Show current input source in the menu bar,这样就能在桌面右上角看到输入法图标了,可以选择进行输入法切换。

配置文件 ~/.config/ibus/rime/

有兴趣的可以参考
Ubuntu 16.04 安装 Rime 输入法

1
2
3
4
5
huzhifeng@Ubuntu16041:~$ ls ~/.config/ibus/rime/
cangjie5_express.prism.bin cangjie5.schema.yaml installation.yaml luna_pinyin.prism.bin luna_pinyin_simp.prism.bin luna_pinyin_tw.prism.bin luna_pinyin.userdb.kct.wal
cangjie5.prism.bin cangjie5.table.bin luna_pinyin_fluency.prism.bin luna_pinyin.reverse.bin luna_pinyin_simp.schema.yaml luna_pinyin_tw.schema.yaml symbols.yaml
cangjie5.reverse.bin default.yaml luna_pinyin_fluency.schema.yaml luna_pinyin.schema.yaml luna_pinyin.table.bin luna_pinyin.userdb.kct user.yaml
huzhifeng@Ubuntu16041:~$

阅读全文 »

Typora

Typora

Ubuntu 安装 Typora

安装

参考 Typora for LinuxInstall Typora on Linux

1
2
3
4
5
6
7
8
9
# optional, but recommended
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
# add Typora's repository
sudo add-apt-repository 'deb https://typora.io ./linux/'
sudo apt-get update
# install typora
sudo apt-get install typora

安装过程记录如下:

1
2
3
huzhifeng@Ubuntu16041:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE
huzhifeng@Ubuntu16041:~$ sudo add-apt-repository 'deb https://typora.io ./linux/'
huzhifeng@Ubuntu16041:~$ sudo apt-get update && sudo apt-get install typora

桌面快捷图标

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
huzhifeng@Ubuntu16041:~$ dpkg --listfiles typora | grep desktop
/usr/share/applications/typora.desktop
huzhifeng@Ubuntu16041:~$ cp /usr/share/applications/typora.desktop ~/Desktop/
huzhifeng@Ubuntu16041:~$ vim ~/Desktop/typora.desktop
huzhifeng@Ubuntu16041:~$ chmod +x ~/Desktop/typora.desktop
huzhifeng@Ubuntu16041:~$ cat ~/Desktop/typora.desktop
[Desktop Entry]
Name=Typora
Version=1.0
Exec=typora %U
Icon=typora
Type=Application
Terminal=false
huzhifeng@Ubuntu16041:~$
阅读全文 »

我安装的 CentOS 7.2是一个最小版本的 CentOS-7-x86_64-Minimal-1511.iso,不带桌面环境,需要手动安装,我通过 yum 安装 GNOME Desktop 后不会自动切换到桌面环境,每次需要执行 startx
后来参考 CentOS-7 “Minimal Desktop” installation GNOMEInstall Gnome GUI on CentOS 7 / RHEL 7 解决,解决方案说明如下:

1
2
In CentOS 7, systemd uses ‘targets’ instead of runlevels; /etc/inittab file is no more used to change run levels. Issue the following command to enable the GUI on system start.
# ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

相关操作记录如下:

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
[root@CentOS72 ~]# yum group list
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.pubyun.com
* extras: mirrors.sina.cn
* updates: mirrors.pubyun.com
Installed Environment Groups:
GNOME Desktop
Available Environment Groups:
Minimal Install
Compute Node
Infrastructure Server
File and Print Server
Basic Web Server
Virtualization Host
Server with GUI
KDE Plasma Workspaces
Development and Creative Workstation
Available Groups:
Compatibility Libraries
Console Internet Tools
Development Tools
Graphical Administration Tools
Legacy UNIX Compatibility
Scientific Support
Security Tools
Smart Card Support
System Administration Tools
System Management
Done
[root@CentOS72 ~]# yum groupinstall "GNOME Desktop"
[root@CentOS72 ~]# cat /etc/inittab
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
#
# To view current default target, run:
# systemctl get-default
#
# To set a default target, run:
# systemctl set-default TARGET.target
#
[root@CentOS72 ~]# ls -l /lib/systemd/system/runlevel*.target
lrwxrwxrwx. 1 root root 15 May 8 15:20 /lib/systemd/system/runlevel0.target -> poweroff.target
lrwxrwxrwx. 1 root root 13 May 8 15:20 /lib/systemd/system/runlevel1.target -> rescue.target
lrwxrwxrwx. 1 root root 17 May 8 15:20 /lib/systemd/system/runlevel2.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 May 8 15:20 /lib/systemd/system/runlevel3.target -> multi-user.target
lrwxrwxrwx. 1 root root 17 May 8 15:20 /lib/systemd/system/runlevel4.target -> multi-user.target
lrwxrwxrwx. 1 root root 16 May 8 15:20 /lib/systemd/system/runlevel5.target -> graphical.target
lrwxrwxrwx. 1 root root 13 May 8 15:20 /lib/systemd/system/runlevel6.target -> reboot.target
[root@CentOS72 ~]# cat /lib/systemd/system/graphical.target
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target
Wants=display-manager.service
Conflicts=rescue.service rescue.target
After=multi-user.target rescue.service rescue.target display-manager.service
AllowIsolate=yes
[root@CentOS72 ~]# ls -l /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 37 Feb 12 11:12 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target
[root@CentOS72 ~]# unlink /etc/systemd/system/default.target
[root@CentOS72 ~]# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
[root@CentOS72 ~]# reboot

EOF

Ubuntu 安装 Shadowsocks 客户端

参考安装指南#ubuntu

1
2
3
4
5
PPA is for Ubuntu >= 14.04.
sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt-get update
sudo apt-get install shadowsocks-qt5

以下为我的安装记录:

安装 shadowsocks-qt5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
huzhifeng@Ubuntu16041:~$ sudo add-apt-repository ppa:hzwhuang/ss-qt5
huzhifeng@Ubuntu16041:~$ sudo apt-get update && sudo apt-get install shadowsocks-qt5
huzhifeng@Ubuntu16041:~$ dpkg-query --listfiles shadowsocks-qt5
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/shadowsocks-qt5
/usr/share/doc/shadowsocks-qt5/copyright
/usr/share/doc/shadowsocks-qt5/README.md
/usr/share/doc/shadowsocks-qt5/changelog.Debian.gz
/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/512x512
/usr/share/icons/hicolor/512x512/apps
/usr/share/icons/hicolor/512x512/apps/shadowsocks-qt5.png
/usr/share/applications
/usr/share/applications/shadowsocks-qt5.desktop
/usr/bin
/usr/bin/ss-qt5
huzhifeng@Ubuntu16041:~$

设置开机自启动

参考 Startup ApplicationsAddingProgramToSessionStartup

1
2
3
1. Use the Dash to find and open `Startup Applications`. Alternatively you can press `Alt+F2` and run the `gnome-session-properties` command.
2. Click Add and enter the command to be executed at login (name and comment are optional). For example, to make Firefox start automatically, it's sufficient to type firefox in the Command field and confirm with Add.

以下为开机脚本内容:

1
2
3
4
5
6
7
8
9
10
11
12
huzhifeng@Ubuntu16041:~$ cat ~/.config/autostart/ss-qt5.desktop
[Desktop Entry]
Type=Application
Exec=/usr/bin/ss-qt5
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=ss
Name=ss
Comment[en_US]=Shadowsocks
Comment=Shadowsocks
huzhifeng@Ubuntu16041:~$

创建桌面快捷图标

1
2
3
4
5
6
7
8
9
10
11
12
13
14
huzhifeng@Ubuntu16041:~$ dpkg-query --listfiles shadowsocks-qt5 | grep desktop
/usr/share/applications/shadowsocks-qt5.desktop
huzhifeng@Ubuntu16041:~$ cp /usr/share/applications/shadowsocks-qt5.desktop ~/Desktop/
huzhifeng@Ubuntu16041:~$ vim ~/Desktop/shadowsocks-qt5.desktop
huzhifeng@Ubuntu16041:~$ chmod a+x ~/Desktop/shadowsocks-qt5.desktop
huzhifeng@Ubuntu16041:~$ cat ~/Desktop/shadowsocks-qt5.desktop
[Desktop Entry]
Name=Shadowsocks-Qt5
Version=2.8.0
Exec=/usr/bin/ss-qt5
Icon=/usr/share/icons/hicolor/512x512/apps/shadowsocks-qt5.png
Terminal=false
Type=Application
huzhifeng@Ubuntu16041:~$

设置快捷键(Ctrl+Shift+S)

进入 System Settings -> Keyboard -> Shortcuts -> Custom Shortcuts
点击 + 号为 Shadowsocks 设置快捷键,例如Ctrl+Shift+S

阅读全文 »

Ubuntu 安装 VirtualBox

repo 方式安装 VirtualBox 5.1(推荐)

参考 VirtualBox 5.1.14 for Linux

1
2
3
4
5
6
7
8
9
Debian-based Linux distributions
Add the following line to your /etc/apt/sources.list:
deb http://download.virtualbox.org/virtualbox/debian xenial contrib
According to your distribution, replace 'xenial' by 'vivid', 'utopic', 'trusty', 'raring', 'quantal', 'precise', 'lucid', 'jessie', 'wheezy', or 'squeeze'.
To install VirtualBox, do
sudo apt-get update
sudo apt-get install virtualbox-5.1

安装过程记录如下:

1
2
3
4
5
6
7
8
9
huzhifeng@Ubuntu16041:~$ sudo sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian xenial contrib' > /etc/apt/sources.list.d/virtualbox.list"
huzhifeng@Ubuntu16041:~$ cat /etc/apt/sources.list.d/virtualbox.list
deb http://download.virtualbox.org/virtualbox/debian xenial contrib
huzhifeng@Ubuntu16041:~$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
OK
huzhifeng@Ubuntu16041:~$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
OK
huzhifeng@Ubuntu16041:~$ sudo apt-get update
huzhifeng@Ubuntu16041:~$ sudo apt-get install virtualbox-5.1

阅读全文 »

CentOS 安装 Resilio Sync

使用 repo 方式安装,参考 Installing Sync package on Linux

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Create file /etc/yum.repos.d/resilio-sync.repo with the following content to register Resilio repository:
[resilio-sync]
name=Resilio Sync
baseurl=http://linux-packages.resilio.com/resilio-sync/rpm/$basearch
enabled=1
gpgcheck=1
Add public key:
rpm --import https://linux-packages.resilio.com/resilio-sync/key.asc
Install Sync:
yum update
yum install resilio-sync

安装过程记录如下:

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
[huzhifeng@CentOS72 ~]$ sudo vim /etc/yum.repos.d/resilio-sync.repo
[huzhifeng@CentOS72 ~]$ cat /etc/yum.repos.d/resilio-sync.repo
[resilio-sync]
name=Resilio Sync $basearch
baseurl=http://linux-packages.resilio.com/resilio-sync/rpm/$basearch
enabled=1
gpgcheck=1
[huzhifeng@CentOS72 ~]$ sudo rpm --import https://linux-packages.resilio.com/resilio-sync/key.asc
[huzhifeng@CentOS72 ~]$ sudo yum install -y resilio-sync
Created symlink from /etc/systemd/system/multi-user.target.wants/resilio-sync.service to /usr/lib/systemd/system/resilio-sync.service.
[huzhifeng@CentOS72 ~]$ rpm -ql resilio-sync
/etc/init.d/resilio-sync
/etc/resilio-sync/config.json
/etc/resilio-sync/init_user_config.sh
/etc/resilio-sync/user_config.json
/lib/systemd/system/resilio-sync.service
/lib/systemd/user/resilio-sync.service
/usr/bin/rslsync
/usr/share/doc/resilio-sync-2.4.2
/usr/share/doc/resilio-sync-2.4.2/LICENSE.TXT
/var/lib/resilio-sync
[huzhifeng@CentOS72 ~]$ ls -l /etc/resilio-sync/
total 12
-rw-r--r--. 1 root root 174 Nov 16 00:01 config.json
-rwxrwxr-x. 1 root root 496 Nov 16 00:01 init_user_config.sh
-rw-r--r--. 1 root root 193 Nov 16 00:01 user_config.json
[huzhifeng@CentOS72 ~]$ cat /etc/resilio-sync/config.json
{
"storage_path" : "/var/lib/resilio-sync/",
"pid_file" : "/var/run/resilio-sync/sync.pid",
"webui" :
{
"listen" : "127.0.0.1:8888"
}
}
[huzhifeng@CentOS72 ~]$ sudo systemctl start resilio-sync
[huzhifeng@CentOS72 ~]$ ps -ef | grep sync
rslsync 20362 1 0 18:14 ? 00:00:00 /usr/bin/rslsync --config /etc/resilio-sync/config.json
huzhife+ 20384 18071 0 18:14 pts/0 00:00:00 grep --color=auto sync
[huzhifeng@CentOS72 ~]$ netstat -nlp | grep 8888
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 127.0.0.1:8888 0.0.0.0:* LISTEN 24710/rslsync
[huzhifeng@CentOS72 ~]$ sudo systemctl enable resilio-sync

阅读全文 »

Axel 是 Linux 下的多线程下载工具

安装 Axel

Debian/Ubuntu/LinuxMint

1
$ sudo apt-get install axel

RHEL/CentOS

1
2
3
4
5
sudo yum install axel
➜ ~ sudo yum install axel
➜ ~ rpm -q axel
axel-2.4-9.el7.x86_64
➜ ~

Fedora

1
sudo dnf install axel

或者从源码编译,最新源码版本 axel-2.4.tar.gz

1
2
3
4
5
6
wget -c https://wilmer.gaa.st/downloads/axel-1.0b.tar.gz
tar zxvf axel-1.0b.tar.gz
cd axel-1.0b/
./configure
make
make instal

配置

Axel 的配置文件位于/etc/axelrc, 一般不需要额外配置,使用默认即可

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
➜ ~ rpm -ql axel
/etc/axelrc
/usr/bin/axel
/usr/share/doc/axel-2.4
/usr/share/doc/axel-2.4/API
/usr/share/doc/axel-2.4/CHANGES
/usr/share/doc/axel-2.4/COPYING
/usr/share/doc/axel-2.4/CREDITS
/usr/share/doc/axel-2.4/README
/usr/share/locale/de/LC_MESSAGES/axel.mo
/usr/share/locale/nl/LC_MESSAGES/axel.mo
/usr/share/locale/ru/LC_MESSAGES/axel.mo
/usr/share/locale/zh_CN/LC_MESSAGES/axel.mo
/usr/share/man/man1/axel.1.gz
/usr/share/man/zh_CN/man1/axel.1.gz
➜ ~
➜ ~ cp /etc/axelrc /tmp
➜ ~ sudo vim /etc/axelrc
➜ ~ diff /tmp/axelrc /etc/axelrc
10c10
< # reconnect_delay = 20
---
> reconnect_delay = 20
22c22
< # num_connections = 4
---
> num_connections = 4
27c27
< # connection_timeout = 45
---
> connection_timeout = 45
75c75
< # verbose = 1
---
> verbose = 0
➜ ~ grep -Ev "(^#|^$)" /etc/axelrc
reconnect_delay = 20
num_connections = 4
connection_timeout = 45
verbose = 0
➜ ~

使用

直接下载到当前目录

1
➜ ~ axel https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2

指定存储路径

1
➜ ~ axel -o cloud.tar.bz2 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2

指定线程数量

1
➜ ~ axel -n 4 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2

参数
-n 指定线程数
-o 指定另存为目录
-s 指定每秒的最大比特数
-q 静默模式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜ ~ axel -h
Usage: axel [options] url1 [url2] [url...]
--max-speed=x -s x Specify maximum speed (bytes per second)
--num-connections=x -n x Specify maximum number of connections
--output=f -o f Specify local output file
--search[=x] -S [x] Search for mirrors and download from x servers
--header=x -H x Add header string
--user-agent=x -U x Set user agent
--no-proxy -N Just don't use any proxy server
--quiet -q Leave stdout alone
--verbose -v More status information
--alternate -a Alternate progress indicator
--help -h This information
--version -V Version information
Visit http://axel.alioth.debian.org/ to report bugs
➜ ~

其它下载工具

aria2
wget
curl

参考资料

Axel
Axel
Speed up your downloads with Axel command line downloader/accelerator
How to Use ‘Axel’ as Download Accelerator to Speed Up FTP and HTTP Downloads
Axel – Linux下多线程下载工具

EOF