@byxiaoxie2年前

03/6
07:01
Home

解决 tomcat 控制台输出乱码

打开配置文件 [D:\apache-tomcat-8.5.76\conf\logging.properties]

找到 47行 [java.util.logging.ConsoleHandler.encoding = UTF-8] 将 [UTF-8] 改成 [GBK]

然后保存重新启动即可解决控制台输出乱码问题

[java.util.logging.ConsoleHandler.encoding = UTF-8]
----改----
[java.util.logging.ConsoleHandler.encoding = GBK]

 

解决 tomcat 控制台输出乱码

@byxiaoxie3年前

09/23
09:29
Home

Windows KMS激活服务器

KMS来源:萌咖
#需管理员身份打开CMD命令提示符
# 激活 Windows
slmgr /skms kms.moeclub.org
slmgr /ato
slmgr /xpr
# 激活 Office
cd "C:\Program Files\Microsoft Office\Office15" //打开安装目录
cscript ospp.vbs /sethst:kms.moeclub.org
cscript ospp.vbs /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99  //需自行找一个对应Office版本的key
cscript ospp.vbs /act
cscript ospp.vbs /dstatus

Windows KMS激活服务器

@byxiaoxie3年前

09/9
18:11
Home

C++ 查询内存页属性

std::string QueryMemInfo(LPVOID address)
{
	MEMORY_BASIC_INFORMATION meminfo;
	VirtualQueryEx(GameHandle, address, &meminfo, sizeof(meminfo));  //查询内存页属性保存到[meminfo]

	PVOID base_address = meminfo.BaseAddress;
	PVOID alloc_base = meminfo.AllocationBase;
	DWORD alloc_protect = meminfo.AllocationProtect;
	DWORD region_size = meminfo.RegionSize;
	DWORD state = meminfo.State;
	DWORD protect = meminfo.Protect;
	DWORD type = meminfo.Type;

	std::string s_alloc_protect;
	if (alloc_protect & PAGE_NOACCESS)                // 0x0001
		s_alloc_protect = "NoAccess";
	if (alloc_protect & PAGE_READONLY)                // 0x0002
		s_alloc_protect = "Readonly";
	else if (alloc_protect & PAGE_READWRITE)          // 0x0004
		s_alloc_protect = "ReadWrite";
	else if (alloc_protect & PAGE_WRITECOPY)          // 0x0008
		s_alloc_protect = "WriteCopy";
	else if (alloc_protect & PAGE_EXECUTE)            // 0x0010
		s_alloc_protect = "Execute";
	else if (alloc_protect & PAGE_EXECUTE_READ)       // 0x0020
		s_alloc_protect = "Execute_Read";
	else if (alloc_protect & PAGE_EXECUTE_READWRITE)  // 0x0040
		s_alloc_protect = "Execute_ReadWrite";
	else if (alloc_protect & PAGE_EXECUTE_WRITECOPY)  // 0x0080
		s_alloc_protect = "Execute_WriteCopy";
	if (alloc_protect & PAGE_GUARD)                   // 0x0100
		s_alloc_protect += "+Guard";
	if (alloc_protect & PAGE_NOCACHE)                 // 0x0200
		s_alloc_protect += "+NoCache";

	std::string s_state;
	if (state == MEM_COMMIT)
		s_state = "Commit ";
	else if (state == MEM_FREE)
		s_state = "Free   ";
	else if (state == MEM_RESERVE)
		s_state = "Reserve";
	else
		s_state = "Damned ";

	std::string s_protect;
	if (protect & PAGE_NOACCESS)
		s_protect = "NoAccess";
	if (protect & PAGE_READONLY)
		s_protect = "Readonly";
	else if (protect & PAGE_READWRITE)
		s_protect = "ReadWrite";
	else if (protect & PAGE_WRITECOPY)
		s_protect = "WriteCopy";
	else if (protect & PAGE_EXECUTE)
		s_protect = "Execute";
	else if (protect & PAGE_EXECUTE_READ)
		s_protect = "Execute_Read";
	else if (protect & PAGE_EXECUTE_READWRITE)
		s_protect = "Execute_ReadWrite";
	else if (protect & PAGE_EXECUTE_WRITECOPY)
		s_protect = "Execute_WriteCopy";
	if (protect & PAGE_GUARD)
		s_protect += "+Guard";
	if (protect & PAGE_NOCACHE)
		s_protect += "+NoCache";

	std::string s_type;
	if (type == MEM_IMAGE)
		s_type = "Image  ";
	else if (type == MEM_MAPPED)
		s_type = "Free   ";
	else if (type == MEM_PRIVATE)
		s_type = "Private";
	else
		s_type = "-      ";

	char buf[128] = { '/0' };
	sprintf(buf, "%8X %8X %25s %7s %25s %7s %8X", base_address, alloc_base,s_alloc_protect.c_str(), s_state.c_str(), s_protect.c_str(), s_type.c_str(), region_size);

	return std::string(buf);
}

int main(){
	HANDLE GameHandle = 0x0; //游戏句柄
	LPVOID BaseAddress = NULL; //游戏模块
	QueryMemInfo(GetBaseAddress + OFFSET_Role);  //调用方法
}

不提供完整的C++代码,仅查询内存页属性代码

C++ 查询内存页属性

@byxiaoxie3年前

04/19
20:23
Home

搭建SRS服务器RTC串流

测试搭建环境 系统 [Ubuntu 20.04]
SRS项目地址:https://github.com/ossrs/srs
安装需要用到的软件包

apt-get install make
apt-get install gcc
apt-get install libssl-dev
apt-get install golang
apt-get install git
apt-get install python
下载SRS项目

git clone https://github.com/ossrs/srs.git
切换4.0版本 [默认版本为3.0,没有RTC所以需要4.0版本]

cd srs/
git checkout 4.0release  //切换最新版本
git branch -v  //查看当前版本
编译SRS

cd trunk/

./configure --with-hls --with-ssl --with-http-server --with-http-callback --with-http-api --with-ingest --with-stream-caster

make
编译完成后修改配置文件

vim conf/rtc.conf

找到[bframe discard]删除他 (原因我也不清楚这个会导致播放卡住)

修改后:
rtc {
    enabled     on;
}

保存配置文件

配置文件部分说明:

listen          1935;   //串流端口
listen          8080;   //HTTP端口
listen          1985;   //API端口(一般不修改)
listen          8000;   //UDP端口(一般不修改)

http_remux {
    enabled     on;
    mount       [vhost]/[app]/[stream].flv;
    hstrs      on;  //添加这个可拉流flv
}
启动RTC

./objs/srs -c conf/rtc.conf
OBS推流设置

服务器:rtmp://127.0.0.1/live/
串流秘钥:myname
播放地址:

webrtc          webrtc://127.0.0.1/live/myname         (端口1985可以不用填写因为webrtc默认端口是1985)
rtmp            rtmp://127.0.0.1:1935/live/myname      (端口1935可以不用填写因为RTMP默认端口是1935除非修改了)
http/flv	http://127.0.0.1:8080/live/myname.flv  (端口8080是HTTP端口如果修改过输入对应的端口即可)
http/m3u8	http://127.0.0.1:8080/live/myname.m3u8 (端口8080是HTTP端口如果修改过输入对应的端口即可)

SRS测试地址:http://127.0.0.1:8080/players/rtc_player.html
如果外网无法播放RTC打开rtc.conf配置文件修改

candidate       $CANDIDATE;  //搜索找到这个

外网无法播放把 [$CANDIDATE] 修改成你的外网IP 

例子: candidate       101.28.1.1;

或者尝试访问 webrtc://127.0.0.1/live/myname?eip=101.28.1.1

启动后可以看到端口信息:

QQ截图20210419200408 搭建SRS服务器RTC串流

WebRTC测试效果(延迟1秒以下,测试图非局域网情况下测试的,网络不好的情况下1~3秒):

QQ截图20210419200408 搭建SRS服务器RTC串流

搭建SRS服务器RTC串流

@byxiaoxie3年前

11/3
17:56
Home

owncast 搭建自己的直播间(带聊天功能)

// 准备工作
系统 [Ubuntu 20.04] (其他系统自行测试)
GitHub:https://github.com/owncast/owncast
教程地址:https://owncast.online/docs/quickstart/
需要:FFmpeg版本4.2以上的版本 必须要支持:[x264/var_stream_map] 手动编译安装教程:https://www.byxiaoxie.com/?p=525
//安装 FFmpeg (Ubuntu20.04 ffmpeg版本4.2.4)

apt update

apt install ffmpeg
//下载[owncast] (GitHub上的发布版)

mkdir -p /opt/owncast && cd /opt/owncast  //创建文件夹并进入文件夹

wget https://github.com/owncast/owncast/releases/download/v0.0.2/owncast-0.0.2-linux-64bit.zip  //下载发布版

unzip owncast-0.0.2-linux-64bit.zip  // 解压
//编辑配置文件[config.yaml]

vim config.yaml

修改自己的串流秘钥和信息,我自己的文件内容如下:
# See https://owncast.online/docs/configuration/ for more details

instanceDetails:
  name: Gary   //名称
  title: Live Game Test  //网站标题

  logo:
    small: /img/logo128.png
    large: /img/logo256.png

  tags:
    - music
    - software
    - streaming

  # https://owncast.online/docs/configuration/#external-links
  # for full list of supported social links.  All optional.
  socialHandles:
    - platform: github
      url: http://github.com/owncast/owncast
    - platform: mastodon
      url: http://mastodon.something/owncast

videoSettings:
  # Change this value and keep it secure.  Treat it like a password to your live stream.
  streamingKey: xiaoxie   //串流秘钥
//启动 [owncast]

./owncast  //启动指令

启动后查看日志文件 [transcoder.log] 如果没有报错着运行成功,如报错无法正常串流播放

//使用后台运行  [owncast]

screen -S live  //创建新的命令行

cd cd /opt/owncast  //进入目录

./owncast  //执行脚本
服务器需要开放端口[1935,8080]
设置OBS串流

服务器 [rtmp://127.0.0.1/live]
串流秘钥 [xiaoxie] (名称自行修改)

播放器地址

播放地址 [http://127.0.0.1:8080]

阅读全文 →

owncast 搭建自己的直播间(带聊天功能)

@byxiaoxie3年前

11/3
17:25
Home

Windows VPS一键重装为Linux系统

一键脚本来源:萌咖
感谢小伙伴的帮助:萌咖 / Shira
测试系统 [Windows Server 2012]
准备工作:一台干净的[Ubuntu16.04]系统VPS或虚拟机都可以 (我使用的虚拟机系统安装包[ubuntu-16.04.5-server-amd64.iso])
脚本下载地址: https://pan.baidu.com/s/1AXkyj9MMk4Gu5gufs6F11w 提取码:gary
// 生成自定义系统(必须使用 Root 用户下执行)

sudo -i  //进入root用户

chmod 777 InstallNET.sh  //设置777权限

wget http://127.0.0.1/InstallNET.sh  //下载生成脚本

bash InstallNET.sh -u 16.04 -v 64 -a --ip-addr 192.168.2.101 --ip-gate 192.168.2.1 --ip-mask 255.255.255.0 --mirror 'http://archive.ubuntu.com/ubuntu' -firmware --loader   // 自定义IP(没DHCP的服务器必须使用)

bash InstallNET.sh -u 16.04 -v 64 -a --mirror 'http://archive.ubuntu.com/ubuntu' -firmware --loader // 服务器有DHCP使用此指令

把生成后的系统两个文件都从服务器上拿出来 [initrd.img] [vmlinuz]

photo_2020-10-30_14-59-41 Windows VPS一键重装为Linux系统
// 开始下载文件并重装系统

// CMD下载文件 (把文件放在C盘根目录下)

curl http://127.0.0.1/win32loader.bat >> win32loader.bat   //下载重装脚本

md win32-loader  // 创建文件夹

cd win32-loader  //打开文件夹

curl http://127.0.0.1/initrd.img >> initrd.img  //下载生成好的系统

curl http://127.0.0.1/vmlinuz >> vmlinuz   //下载生成好的系统

// 开始安装系统

cd ..   //返回到根目录
win32loader.bat  //执行一键重装脚本

这里使用生成的系统安装所以选择 [Local file] 然后按两次回车键即可自动重启并安装系统

photo_2020-10-30_14-59-41 Windows VPS一键重装为Linux系统
全自动安装完成后默认用户名:root 密码:MoeClub.org

 

Windows VPS一键重装为Linux系统

@byxiaoxie3年前

09/28
22:14
Home

Free HLS Live 服务器搭建

Free HLS Live 服务器搭建  测试环境 系统[CentOS 7]
Free HLS Live 需求的软件:
NodeJS
Yarn
FFmpeg
NodeJS 安装 官方网站[https://nodejs.org/en/download/]

下载 NodeJS
wget https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-x64.tar.xz

解压 NodeJS

xz -d node-v12.18.4-linux-x64.tar.xz
tar -xf node-v12.18.4-linux-x64.tar

设置软连接
ln -s ~/node-v12.18.4-linux-x64/bin/node /usr/bin/node
ln -s ~/node-v12.18.4-linux-x64/bin/npm /usr/bin/npm
ln -s ~/node-v12.18.4-linux-x64/bin/npm /usr/bin/npx

测试是否添加成功
node -v  返回值[v12.18.4]

阅读全文 →

Free HLS Live 服务器搭建

@byxiaoxie4年前

09/25
13:18
Home

TeamSpeak 3 服务器搭建

创建新用户
useradd teamspeak
passwd teamspeak
进入新用户
su - teamspeak
下载 TeamSpeak Server 官网地址[www.teamspeak.com]
wget https://files.teamspeak-services.com/releases/server/3.12.1/teamspeak3-server_linux_amd64-3.12.1.tar.bz2

解压 tar.bz2
tar -xjf teamspeak3-server_linux_amd64-3.12.1.tar.bz2
修改文件夹名称 , 方便设置开机启动
mv teamspeak3-server_linux_amd64 teamspeak3
创建 TeamSpeak 授权文件
cd teamspeak3
touch .ts3server_license_accepted

启动 TeamSpeak 服务器 
[新创建的记得把启动后的信息复制下来,token和password 的信息都必须复制下来,客户端进去后输入token即可获取管理员权限]
./ts3server_startscript.sh start
创建开机启动
su - (返回Root下创建)

vim /lib/systemd/system/ts3.service
ts3.service 配置内容

[Unit]
Description=Teamspeak server
After=network.target
[Service]
WorkingDirectory=/home/teamspeak/teamspeak3
User=teamspeak
Group=teamspeak
Type=forking
ExecStart=/home/teamspeak/teamspeak3/ts3server_startscript.sh start inifile=ts3server.ini
ExecStop=/home/teamspeak/teamspeak3/ts3server_startscript.sh stop
PIDFile=/home/teamspeak/teamspeak3/ts3server.pid
RestartSec=15
Restart=always
[Install]
WantedBy=multi-user.target
启动关闭指令

systemctl start ts3 [启动服务端]

systemctl stop ts3 [关闭服务端]

systemctl enable ts3 [开机启动]

systemctl status ts3 [运行状态信息]

 

TeamSpeak 3 服务器搭建

@byxiaoxie4年前

01/17
19:06
Home

Kaillerasrv – 街机联机搭建教程

街机模拟器 WinKawaks 1.65 (709合集)下载地址:https://pan.baidu.com/s/1DRRtgKofMCI8wxx3-ftn7w  提取码:nfoo
Kaillerasrv 0.86 服务端下载地址:https://pan.baidu.com/s/16AyC8AgatQRkL-D3_BhPlA  提取码:p3x9
服务端 [kaillerasrv.conf] 配置说明:

; Kaillera server config file

; ServerName can be up to 64 characters long.
; 服务器名称
ServerName=ByXiaoXie.Com
; Location can be up to 64 characters long.
; 设置国家地区
Location=China
; URL can be up to 128 characters long. (ex: http://www.mysite.com/)
;你的URL (可以不用设置保留空就可以了)
URL=https://www.byxiaoxie.com

; 最大用户数
MaxUsers=10
; 默认端口 27888 可自行修改
Port=27888

; Set Public to 0 if you want to run the server on a private LAN
; 是否公开搜索 (1 公网) (0局域网)
Public=1

; Use this parameter if you want to manually specify your server's
; IP address or leave blank for automatic
; (ex: IP=154.253.21.56)
; 设置成你的服务器公网IP 或 局域网联机设置成局域网IP
IP=192.168.1.100

; Messages flood protection
; FloodMsgNb is the max. number of times a same message has to
; be received in FloodMsgTime seconds.
; 防消息刷屏限制 [FloodMsgNb=5] 仅显示5条  [FloodMsgTime=3] 3秒发送一次
FloodMsgNb=5
FloodMsgTime=3

; Minimum ping restriction (in ms)
; 0=disabled
; 最小延迟限制 (0禁用)
MinPing=0

; Maximum connection setting restriction
; 0=disabled, 1=Bad, 2=Low, 3=Average, 4=Good, 5=Excellant, 6=LAN
; 连接限制 (一般默认0就可以了)
MaxConnSet=0

; Message of the Day
; Note that you can stack "MotdLine" options
; 进入服务器提示信息 (以下是我个人的配置)
MotdLine=Hello,Welcome to join [ByXiaoXie] Test Server
MotdLine=My Blog:https://www.byxiaoxie.com/

; AllowWebAccess (1=yes,0=no) 允许Web连接 (1 允许 0 不允许)
AllowWebAccess=1

; End of Kaillera server config file

 

Kaillerasrv – 街机联机搭建教程

加载中……