Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win10使用finalspeed点击退出会不定时蓝屏,从休眠中恢复点击退出,蓝屏几率更高。 #85

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
/*.iml
/.idea/
/out/
/*.sh
/fortest/
73 changes: 30 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,41 @@
FinalSpeed是高速双边加速软件,可加速所有基于tcp协议的网络服务,在高丢包和高延迟环境下,仍可达到90%的物理带宽利用率,即使高峰时段也能轻松跑满带宽.

### 安装教程
[客户端安装说明](http://www.d1sm.net/thread-7-1-1.html)
[客户端安装说明](https://www.91yun.org/archives/615)
<br />
[服务端安装说明](http://www.d1sm.net/thread-8-1-1.html)
[服务端安装说明](http://www.91yun.org/archives/2775)

### 使用帮助
```
需要管理员权限
java -jar finalspeed.jar -b 运行CLI版
java -jar finalspeed.jar 运行GUI版
```
### 说明


finalspeed作者开始卖收费版了,所以停止了免费版的更新,并且删除了所有代码。不过还好我fork了一份。。作为Openvz的救星,还是有不少人对finalspeed有需求的。所以我就做了这个一键安装包。

这个一键安装包完全重写了作者原来的安装代码,启动,停止代码。并加入了服务,可以使用 service finalspeed star | stop 来控制,加入了开机启动启动。总之,你需要做的就是真正的一键。一键安装包安装的服务器端版本为1.2.需要1.0的自行到github下载。欢迎大家测试,有问题及时留言给我。

github地址:https://github.com/91yun/finalspeed

github里也有服务器端和客户端的文件。大家有需求可以自行去下载。

CLI版本需要手动配置, 且配置文件与finalspeed必须处在同一目录下.
clien_config.json

### 一键安装代码:
```
{
// 下载速度,单位是 B,字节。这里换算起来就是 11MB。请把这里改成本机的下载速度
"download_speed": 11200698,
// 协议:tcp 或 udp。注意:服务端如果是 OpenVZ 架构的话,则只支持 udp。
"protocal": "udp",
// 服务器地址
"server_address": "1.2.3.4",
// 一般不需要更改,保持默认即可。
"server_port": 150,
// 不需要更改,保持默认即可。
"socks5_port": 1083,
// 上传速度,单位是 B,字节。
"upload_speed": 357469
}
wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/finalspeed/master/install_fs.sh && bash install_fs.sh
```
port_map.json
###一键卸载代码
```
{
"map_list": [
{
// 要加速的服务器端口
"dst_port": 12345,
// 本地端口
"listen_port": 1099,
// 备注信息
"name": "ss"
},
{
"dst_port": 23456,
"listen_port": 2200,
"name": "ssh"
}
]
}
wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/finalspeed/master/install_fs.sh && bash install_fs.sh uninstall
```
### finalspeed操作命令

启动: /etc/init.d/finalspeed start

停止命令:/etc/init.d/finalspeed stop

状态命令(查看日志):/etc/init.d/finalspeed status

### finalspeed安装路径

安装路径: /fs/

日志路径:/fs/server.log

论坛 http://www.d1sm.net/forum-44-1.html
93 changes: 93 additions & 0 deletions finalspeed
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/bin/bash
# chkconfig: 2345 90 10
# description: start or stop the finalspeed server
#
### BEGIN INIT INFO
# Provides: finalspeed
# Required-Start: $network $syslog $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start or stop the finalspeed server
### END INIT INFO

# Author: 91yun <http://www.91yun.org>

name=finalspeed
BIN=/fs/fs.sh
conf=/fs/fs.conf
logname=/fs/server.log

start(){
ulimit -s 65535
ulimit -n 65535
tram=$( free -m | awk '/Mem/ {print $2}' )
if [ "$tram" -le 128 ]; then
nohup java -Xmx64M -XX:MaxGCPauseMillis=30 -jar /fs/fs.jar > $logname 2>&1 &
elif [ "$tram" -le 256 ]; then
nohup java -Xmx128M -XX:MaxGCPauseMillis=30 -jar /fs/fs.jar > $logname 2>&1 &
elif [ "$tram" -le 512 ]; then
nohup java -Xmx256M -XX:MaxGCPauseMillis=30 -jar /fs/fs.jar > $logname 2>&1 &
elif [ "$tram" -gt 512 ]; then
nohup java -Xmx512M -XX:MaxGCPauseMillis=30 -jar /fs/fs.jar > $logname 2>&1 &
fi
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
tail $logname
echo "$name start success"
else
tail $logname
echo "$name start failed"
fi
}

stop(){
pid=`ps -ef | grep fs.jar | grep -v grep | awk '{print $2}'`
if [[ ! -z $pid ]]; then
ps -ef | grep fs.jar | grep -v grep | awk '{print $2}' | xargs kill -s 9
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
echo "$name stop success"
else
echo "$name stop failed"
fi
else
echo "$name is not running"
RETVAL=1
fi
}

status(){
pid=`ps -ef | grep fs.jar | grep -v grep | awk '{print $2}'`
if [[ -z $pid ]]; then
echo "$name is not running"
RETVAL=1
else
echo "$name is running with PID $pid"
tail $logname
RETVAL=0
fi
}

case "$1" in
'start')
stop
start
;;
'stop')
stop
;;
'status')
status
;;
'restart')
stop
start
RETVAL=$?
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
91 changes: 91 additions & 0 deletions finalspeed-debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: finalspeed
# Required-Start: $network $syslog $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the finalspeed server
# Description: Start or stop the finalspeed server
### END INIT INFO

# Author: 91yun <http://www.91yun.org>

name=finalspeed
BIN=/fs/fs.sh
conf=/fs/fs.conf
logname=/fs/server.log

start(){
ulimit -s 65535
ulimit -n 65535
tram=$( free -m | awk '/Mem/ {print $2}' )
if [ "$tram" -le 128 ]; then
nohup java -Xmx64M -XX:MaxGCPauseMillis=30 -jar /fs/fs.jar > $logname 2>&1 &
elif [ "$tram" -le 256 ]; then
nohup java -Xmx128M -XX:MaxGCPauseMillis=30 -jar /fs/fs.jar > $logname 2>&1 &
elif [ "$tram" -le 512 ]; then
nohup java -Xmx256M -XX:MaxGCPauseMillis=30 -jar /fs/fs.jar > $logname 2>&1 &
elif [ "$tram" -gt 512 ]; then
nohup java -Xmx512M -XX:MaxGCPauseMillis=30 -jar /fs/fs.jar > $logname 2>&1 &
fi
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
tail $logname
echo "$name start success"
else
tail $logname
echo "$name start failed"
fi
}

stop(){
pid=`ps -ef | grep fs.jar | grep -v grep | awk '{print $2}'`
if [[ ! -z $pid ]]; then
ps -ef | grep fs.jar | grep -v grep | awk '{print $2}' | xargs kill -s 9
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
echo "$name stop success"
else
echo "$name stop failed"
fi
else
echo "$name is not running"
RETVAL=1
fi
}

status(){
pid=`ps -ef | grep fs.jar | grep -v grep | awk '{print $2}'`
if [[ -z $pid ]]; then
echo "$name is not running"
RETVAL=1
else
echo "$name is running with PID $pid"
tail $logname
RETVAL=0
fi
}

case "$1" in
'start')
stop
start
;;
'stop')
stop
;;
'status')
status
;;
'restart')
stop
start
RETVAL=$?
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL
Binary file added finalspeed_client.zip
Binary file not shown.
Binary file added finalspeed_install1.0.exe
Binary file not shown.
Binary file added finalspeed_install1.12.exe
Binary file not shown.
Binary file added fs1.0_server.zip
Binary file not shown.
Binary file added fs1.0_server/fs.jar
Binary file not shown.
Binary file added fs1.2_server.zip
Binary file not shown.
Binary file added fs1.2_server/fs.jar
Binary file not shown.
116 changes: 116 additions & 0 deletions install_fs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#! /bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

#安装地址勿做修改
install_path=/fs/


# Make sure only root can run our script
function rootness(){
if [[ $EUID -ne 0 ]]; then
echo "Error:This script must be run as root!" 1>&2
exit 1
fi
}


function checkenv(){
if [[ $OS = "centos" ]]; then
yum install epel-release -y
yum -y install libpcap
yum -y install iptables
yum install -y java
else
apt-get update
apt-get -y install libpcap-dev
apt-get -y install iptables
apt-get install -y openjdk-7-jre
fi
}



function checkos(){
if [ -f /etc/redhat-release ];then
OS='centos'
elif [ ! -z "`cat /etc/issue | grep bian`" ];then
OS='debian'
elif [ ! -z "`cat /etc/issue | grep Ubuntu`" ];then
OS='ubuntu'
else
echo "Not support OS, Please reinstall OS and retry!"
exit 1
fi
}


# Install finalspeed
function install_finalspeed(){
rootness
checkos
checkenv
mkdir -p $install_path
echo '' > ${install_path}"server.log"
wget --no-check-certificate https://raw.githubusercontent.com/91yun/finalspeed/master/fs1.2_server/fs.jar -O ${install_path}"fs.jar"
if [ "$OS" == 'centos' ]; then
if ! wget --no-check-certificate https://raw.githubusercontent.com/91yun/finalspeed/master/finalspeed -O /etc/init.d/finalspeed; then
echo "Failed to download finalspeed chkconfig file!"
exit 1
fi
chmod +x /etc/init.d/finalspeed
chkconfig --add finalspeed
chkconfig finalspeed on
else
if ! wget --no-check-certificate https://raw.githubusercontent.com/91yun/finalspeed/master/finalspeed-debian -O /etc/init.d/finalspeed; then
echo "Failed to download finalspeed chkconfig file!"
exit 1
fi
chmod +x /etc/init.d/finalspeed
update-rc.d -f finalspeed defaults
fi
/etc/init.d/finalspeed start
}

# Uninstall finalspeed
function uninstall_finalspeed(){
printf "Are you sure uninstall finalspeed? (y/n) "
printf "\n"
read -p "(Default: n):" answer
if [ -z $answer ]; then
answer="n"
fi
if [ "$answer" = "y" ]; then
/etc/init.d/finalspeed stop
checkos
if [ "$OS" == 'centos' ]; then
chkconfig --del finalspeed
else
update-rc.d -f finalspeed remove
fi
rm -f /etc/init.d/finalspeed
rm -rf $install_path
echo "finalspeed uninstall success!"
else
echo "uninstall cancelled, Nothing to do"
fi
}

# Initialization step
action=$1
[ -z $1 ] && action=install
case "$action" in
install)
install_finalspeed
;;
uninstall)
uninstall_finalspeed
;;
*)
echo "Arguments error! [${action} ]"
echo "Usage: `basename $0` {install|uninstall}"
;;
esac