星宇、Blog - admin
type: channel
link: https://blog.xingyudemo.com/author/1/
description: admin
items: 一键更换源脚本
items: windows补丁包下载地址
items: 安装 VirtIO 和 QEMU-Guest-Agent 指南
items: python编写windows服务程序
items: CentOS7配置国内yum源
items: centos设置时区
items: PHP跨域处理
items: whmcs安装教程
items: 美元汇率查询接口
items: AWS EC2 Linux | ssh 使用密码登录

一键更换源脚本
type: item
date: 2025-11-01T02:21:00+08:00
description: ## Author: SuperManito ## Modified: 2025-11-01 ## License: MIT ## GitHub: https://github.com/SuperManito/LinuxMirrors ## Website: https://linuxmirrors.cn ## 定制方法 # 只需要在头部（此处）定义全局变量即可，具体详见官网文档，简单写几个例子 # SOURCE="www.example.com" # 指定软件源地址 # BRANCH="branch" # 指定软件源仓库 # WEB_PROTOCOL="https" # 指定 Web 协议 ## 软件源列表 # 中国大陆默认 mirror_list_default=( "mirrors.aliyun.com" "mirrors.tencent.com" "mirrors.huaweicloud.com" "mirrors.cmecloud.cn" "mirrors.ctyun.cn" "mirrors.163.com" "mirrors.volces.com" "mirrors.tuna.tsinghua.edu.cn" "mirrors.pku.edu.cn" "mirrors.zju.edu.cn" "mirrors.nju.edu.cn" "mirror.lzu.edu.cn" "mirror.sjtu.edu.cn" "mirrors.cqupt.edu.cn" "mirrors.ustc.edu.cn" "mirror.iscas.ac.cn" "__OFFICIAL_SOURCE_TAG__" ) # 中国大陆教育网 mirror_list_edu=( "mirrors.pku.edu.cn" "mirror.bjtu.edu.cn" "mirrors.bfsu.edu.cn" "mirrors.bupt.edu.cn" "mirrors.cqu.edu.cn" "mirrors.cqupt.edu.cn" "mirrors.neusoft.edu.cn" "mirrors.uestc.cn" "mirrors.scau.edu.cn" "mirrors.hust.edu.cn" "mirrors.jlu.edu.cn" "mirrors.jcut.edu.cn" "mirrors.jxust.edu.cn" "mirror.lzu.edu.cn" "mirrors.nju.edu.cn" "mirrors.njtech.edu.cn" "mirrors.njupt.edu.cn" "mirrors.sustech.edu.cn" "mirror.nyist.edu.cn" "mirrors.qlu.edu.cn" "mirrors.tuna.tsinghua.edu.cn" "mirrors.sdu.edu.cn" "mirrors.shanghaitech.edu.cn" "mirror.sjtu.edu.cn" "mirrors.sjtug.sjtu.edu.cn" "mirrors.wsyu.edu.cn" "mirrors.xjtu.edu.cn" "mirrors.nwafu.edu.cn" "mirrors.zju.edu.cn" "mirrors.ustc.edu.cn" "__OFFICIAL_SOURCE_TAG__" ) # 境外以及海外地区 mirror_list_abroad=( "mirrors.xtom.hk" "mirror.01link.hk" "download.nus.edu.sg/mirror" "mirror.sg.gs" "mirrors.xtom.sg" "free.nchc.org.tw" "mirror.ossplanet.net" "linux.cs.nctu.edu.tw" "ftp.tku.edu.tw" "mirror.twds.com.tw" "mirror.anigil.com" "ftp.udx.icscoe.jp/Linux" "ftp.jaist.ac.jp/pub/Linux" "linux2.yz.yamagata-u.ac.jp/pub/Linux" "mirrors.xtom.jp" "mirrors.gbnetwork.com" "mirror.kku.ac.th" "mirror.vorboss.net" "mirror.quickhost.uk" "mirror.dogado.de" "mirrors.xtom.de" "ftp.halifax.rwth-aachen.de" "ftp.agdsn.de" "mirror.in2p3…

windows补丁包下载地址
type: item
date: 2025-03-15T17:21:32+08:00
description: https://www.catalog.update.microsoft.com/Home.aspx

安装 VirtIO 和 QEMU-Guest-Agent 指南
type: item
date: 2025-03-15T16:30:00+08:00
description: 在 Windows 虚拟机安装完成后，需要检查 VirtIO 对应的 CD 驱动器下的文件。以下分别为常用 Windows Server 版本对应的 VirtIO 驱动下载链接：Windows Server 2008 系列：virtio-win-0.1.173-2Windows Server 2008 R2 系列：virtio-win-0.1.173-4Windows Server 2012 系列（包括 R2）：virtio-win-0.1.215-2Windows Server 2016/2019/2022 系列：virtio-win - 最新稳定版

python编写windows服务程序
type: item
date: 2024-11-26T22:41:00+08:00
description: class Windows_Python_Service(win32serviceutil.ServiceFramework): _svc_name_ = "Windows_Python_Service" _svc_display_name_ = "Windows Python Service" _svc_description_ = "Windows Python Service" def __init__(self, args): win32serviceutil.ServiceFramework.__init__(self, args) self.hWaitStop = win32event.CreateEvent(None, 0, 0, None) self.run = True def SvcDoRun(self): while self.run: #服务逻辑 print(time.time()) #跳出服务结束 time.sleep(5) def SvcStop(self): self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) win32event.SetEvent(self.hWaitStop) self.run = False if __name__ == '__main__': try: if len(sys.argv) == 1: evtsrc_dll = os.path.abspath(servicemanager.__file__) servicemanager.PrepareToHostSingle(Windows_Python_Service) servicemanager.Initialize('Windows_Python_Service', evtsrc_dll) servicemanager.StartServiceCtrlDispatcher() else: win32serviceutil.HandleCommandLine(Windows_Python_Service) except: print('Please use the command:') print('Windows_Python_Service install') print('Windows_Python_Service start') print('Windows_Python_Service stop') print('Windows_Python_Service remove')

CentOS7配置国内yum源
type: item
date: 2024-11-26T18:00:00+08:00
description: 一、备份YUM源cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo-backup二、下载YUM源wget下载与curl下载选择一个就可以阿里wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repocurl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo华为wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-anon.repocurl -o /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-anon.repo网易wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS7-Base-163.repocurl -o /etc/yum.repos.d http://mirrors.163.com/.help/CentOS7-Base-163.repo三、更换epel源wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repocurl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo四、清理更新缓存yum clean all && yum makecache

centos设置时区
type: item
date: 2024-11-20T23:25:40+08:00
description: 设置系统时区timedatectl set-timezone "Asia/Shanghai"reboot

PHP跨域处理
type: item
date: 2024-04-19T18:19:26+08:00
description: header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE'); header('Access-Control-Allow-Headers: *'); header('Access-Control-Allow-Credentials: true'); if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { header('HTTP/1.1 200 OK'); exit(); }

whmcs安装教程
type: item
date: 2024-03-07T17:39:00+08:00
description: 下载地址：https://s3.amazonaws.com/releases.whmcs.com/v2/pkgs/whmcs-8.8.0-release.1.zip汉化包：https://github.com/hostsoft/whmcs-chinese-lang<?php namespace WHMCS; class License { const LICENSE_API_VERSION = '1.1'; const LICENSE_API_HOSTS = array('127.0.0.1'); const STAGING_LICENSE_API_HOSTS = array('127.0.0.1'); const UNLICENSED_KEY = 'LICENSE-REQUIRED'; private $licensekey = ''; private $localkey = false; private $keydata = NULL; private $salt = ''; private $postmd5hash = ''; private $localkeydays = '10'; private $allowcheckfaildays = '5'; private $useInternalLicensingMirror = false; private $debuglog = array(); private $lastCurlError = NULL; public function checkFile($value) { if ($value != 'a896faf2c31f2acd47b0eda0b3fd6070958f1161') { throw new Exception\Fatal('File version mismatch. Please contact support.'); } return $this; } public function setLicenseKey($licenseKey) { $this->licensekey = $licenseKey; return $this; } public function setLocalKey($localKey) { $this->decodeLocal($localKey); return $this; } public function setSalt($version, $hash) { if (empty($version) || empty($hash)) { throw new Exception('Unable to generate licensing salt'); } $this->salt = sha1(sprintf('WHMCS%s%s%s', $version, '|-|', $hash)); return $this; } public function useInternalValidationMirror() { $this->useInternalLicensingMirror = true; return $this; } protected function getHosts() { if ($this->useInternalLicensingMirror) { return self::STAGING_LICENSE_API_HOSTS; } return self::LICENSE_API_HOSTS; } public function getLicenseKey() { return $this->licensekey; } protected function getHostDomain() { $domain = defined('WHMCS_LICENSE_DOMAIN') ? WHMCS_LICENSE_DOMAIN : ''; if (empty($domain) || $domain == '-') { throw new Exception('Unable to retrieve current server name. Please check PHP/vhost configuration and ensure SERVER_NAME is displaying appropriately via PHP Info.'); } $this->debug('Host Domain: ' . $domain); return $domain; } protected function getHostIP() { $ip = defined('WHMCS_LICENSE_IP'…

美元汇率查询接口
type: item
date: 2024-03-06T02:20:35+08:00
description: https://api.exchangerate-api.com/v4/latest/USD

AWS EC2 Linux | ssh 使用密码登录
type: item
date: 2023-11-16T14:12:59+08:00
description: 1、使用AWS控制台创建的密钥对或者直接通过网页登录注意：使用pem私钥不允许直接登录root用户，只能登录默认用户例如：ec2-user ,ubuntu等等2、创建root密码sudo passwd root3、切换到root用户su root4、修改 sshd_config 文件vim /etc/ssh/sshd_config允许使用密码登录PasswordAuthentication yes允许root用户登录PermitRootLogin yes注意：如果 PermitRootLogin 项找不到自行添加5、重新启动ssh服务systemctl restart sshd至此大功告成，可以使用ssh直接通过密码登录