2025年8月14日星期四

HP P1606dn 打印机部分设置

重置打印机IP:关机状态下,长按两个功能键,然后按一下开机键,直到状态灯闪烁时,松开功能键,就可以完成机器初始化,并获得新的IP地址。
查看打印机配置:长按5秒机器上的打印键就能列印出相关信息了。

2025年7月31日星期四

GM265DN C8

1、先把机器关机,轻按电源开机
2、在机器预热响动的过程中,马上打开上盖(看到粉盒为止)
3、2秒内,连续按电源键5次
4、关闭上盖

ps:理论上不用关机,后三步就可以了。

2025年4月13日星期日

毕业25年了

  •  转眼,人生已过大半,距离开盐校已经快25年了。还记得离校独自乘车,同学们追来送站的场景;还记得三年时光的无忧天真,仿佛就在昨天。
  •  本月清明假期,班级群里难得的热闹了一回,有些同学都有迫切的举办同学聚会的热情。少数同学偶尔也会在线下见面、联络。我和老姚上次见面也最少过去了五年了吧。
  •  依然记得班里每一个同学的名字,似乎没有什么用,但是少年时期的情感和同学情谊是最真诚的,那三十多个名字是各自多彩生活的依托,也是偶尔挂念名单。
  •  虽然要集聚全员聚会有如登天,每个人都有自己的人生和遗憾。同学们分布在全国各地、甚至五湖四海。大家隔着屏幕和网络还能偶尔聊天或是视频见见。当然更遗憾的是已确知有同学已登极乐。
  •  看着通讯录的名单,依然有8人暂无音信,盼着你们回归。活着的同学们,如若有机会还是希望大家都能再见。

2025年1月1日星期三

2025元旦

一元复始,现在的一元会和未来的一百有什么关系吗?

祝所有“人”元旦快乐!

2024年12月28日星期六

Typecho 后台登录验证码插件更新

<?php
namespace TypechoPlugin\LoginCaptcha;
use Typecho\Common;
use Typecho\Cookie;
use Typecho\Plugin\PluginInterface;
use Typecho\Widget\Helper\Form;
use Typecho\Widget\Helper\Form\Element\Select;
use Typecho\Request as HttpRequest;
use Typecho\Response as HttpResponse;
use Typecho\Widget\Request;
use Typecho\Widget\Response;
use Utils\Helper;
use Widget\Notice;
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
/**
* Typecho 后台登录页面增加验证码保护
*
* @package LoginCaptcha
* @author Yaner
* @version 2.0.1
* @link https://typecho.com.mp
*
*/
class Plugin implements PluginInterface
{
// 添加一个常量控制开关
const ENABLE_CAPTCHA = true; // true=on false=off
public static function activate()
{
\Typecho\Plugin::factory('index.php')->begin = [__CLASS__, 'hookRoute'];
Helper::addRoute('login-captcha', '/login-captcha', Action::class, 'renderCaptcha');
\Typecho\Plugin::factory('admin/footer.php')->end = [__CLASS__, 'addCaptcha'];
}
public static function deactivate()
{
Helper::removeRoute('login-captcha');
}
public static function config(Form $form)
{
// 添加验证码类型选择配置
$captchaType = new Select(
'captchaType',
[
'alphabet' => '纯字母',
'numeric' => '数字加法',
'mixed' => '数字汉字加法',
'random' => '随机'
],
'numeric',
_t('选择验证码类型')
);
$form->addInput($captchaType);
}
public static function personalConfig(Form $form)
{
// 个人配置项
}
public static function hookRoute()
{
if (!self::ENABLE_CAPTCHA) {
return;
}
$options = Helper::options();
if (!isset($options->plugins['activated']['LoginCaptcha']) || $options->plugin('LoginCaptcha')->enableCaptcha === 'disabled') {
return;
}
$request = new Request(HttpRequest::getInstance());
$response = new Response(HttpRequest::getInstance(), HttpResponse::getInstance());
$pathinfo = $request->getPathInfo();
// 确保会话已启动
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
// 检查验证码
if (preg_match("#/action/login#", $pathinfo)) {
if (!isset($_SESSION['captcha']) || $_POST['captcha'] != $_SESSION['captcha']) {
Notice::alloc()->set(_t('验证码错误'), 'error');
Cookie::set('__typecho_remember_captcha', '');
$response->goBack();
}
}
}
public static function addCaptcha()
{
if (!self::ENABLE_CAPTCHA) {
return;
}
$options = Helper::options();
if (!isset($options->plugins['activated']['LoginCaptcha']) || $options->plugin('LoginCaptcha')->enableCaptcha === 'disabled') {
return;
}
$request = new Request(HttpRequest::getInstance());
$pathinfo = $request->getRequestUri();
$loginPath = Common::url('login.php', defined('__TYPECHO_ADMIN_DIR__') ? __TYPECHO_ADMIN_DIR__ : '/admin/');
$secureUrl = Helper::security()->getIndex('login-captcha');
if (stripos($pathinfo, $loginPath) === 0) {
?>
<script>
(function () {
var src = '<?php echo $secureUrl ?>';
var pwd = document.getElementById('password');
if (pwd) {
var captchaSection = document.createElement('p');
captchaSection.id = 'captcha-section';
var captchaLabel = document.createElement('label');
captchaLabel.className = 'sr-only';
captchaLabel.setAttribute('for', 'captcha');
captchaLabel.innerText = '<?php _e("验证码"); ?>';
captchaSection.appendChild(captchaLabel);
var captchaInput = document.createElement('input');
captchaInput.type = 'text';
captchaInput.name = 'captcha';
captchaInput.id = 'captcha';
captchaInput.className = 'text-l w-100';
captchaInput.placeholder = '<?php _e("填写答案"); ?>';
captchaInput.required = true;
captchaSection.appendChild(captchaInput);
var captchaImg = document.createElement('img');
captchaImg.id = 'captcha-img';
captchaImg.src = src;
captchaImg.title = '<?php _e("点击刷新") ?>';
captchaSection.appendChild(captchaImg);
pwd.parentNode.insertAdjacentElement('afterend', captchaSection);
captchaImg.onclick = function () {
if (captchaImg.classList.contains('not-allow')) {
return;
}
captchaImg.classList.add('not-allow');
captchaImg.src = src + '&t=' + Math.random();
setTimeout(function () {
captchaImg.classList.remove('not-allow');
}, 1000);
};
}
})();
</script>
<style>
#captcha-section {
display: flex;
}
#captcha {
box-sizing: border-box;
}
#captcha:invalid:not(:placeholder-shown) {
border: 2px solid red;
}
#captcha:valid {
border: 2px solid green;
}
#captcha-img {
cursor: pointer;
}
#captcha-img.not-allow {
cursor: not-allowed;
}
</style>
<?php
}
}
}
?>

Plugin.php 验证码插件更新:编辑文本控制插件启用、停,以便应对异常时不能登录后。

2024年12月25日星期三

2024年12月21日星期六

西江里蚁穴

那是一个盛世,那是一个盛世,那是一个盛世...
只是谁成了那盛世血色下的尸骸,谁又是那盛世血色下的刽子手?是你,是我,是他,还是她,拟或是它...
记得也好,忘记也罢,流过的血,尝过的痛都是每一个你我活该付出的代价。
千里江堤,溃于蚁穴...

2024年12月3日星期二

typecho后台登录验证码

Plugin.php

<?php
namespace TypechoPlugin\LoginCaptcha;
use Typecho\Common;
use Typecho\Cookie;
use Typecho\Plugin\PluginInterface;
use Typecho\Widget\Helper\Form;
use Typecho\Widget\Helper\Form\Element\Select;
use Typecho\Request as HttpRequest;
use Typecho\Response as HttpResponse;
use Typecho\Widget\Request;
use Typecho\Widget\Response;
use Utils\Helper;
use Widget\Notice;
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
/**
* Typecho 后台登录页面增加验证码保护
*
* @package LoginCaptcha
* @authors
* Ryan
* Yaner
* @version 2.0.0
* @link https://doufu.ru
* https://typecho.com.mp
*/

class Plugin implements PluginInterface
{
public static function activate()
{
\Typecho\Plugin::factory('index.php')->begin = [__CLASS__, 'hookRoute'];
Helper::addRoute('login-captcha', '/login-captcha', Action::class, 'renderCaptcha');
\Typecho\Plugin::factory('admin/footer.php')->end = [__CLASS__, 'addCaptcha'];
}
public static function deactivate()
{
Helper::removeRoute('login-captcha');
}
public static function config(Form $form)
{
// 添加验证码类型选择配置
$captchaType = new Select(
'captchaType',
[
'alphabet' => '纯字母',
'numeric' => '数字加法',
'mixed' => '数字汉字加法',
'random' => '随机'
],
'numeric',
_t('选择验证码类型')
);
$form->addInput($captchaType);
}
public static function personalConfig(Form $form)
{
// 个人配置项
}
public static function hookRoute()
{
$request = new Request(HttpRequest::getInstance());
$response = new Response(HttpRequest::getInstance(), HttpResponse::getInstance());
$pathinfo = $request->getPathInfo();

// 确保会话已启动
if (session_status() == PHP_SESSION_NONE) {
session_start();
}

// 检查验证码
if (preg_match("#/action/login#", $pathinfo)) {
if (!isset($_SESSION['captcha']) || $_POST['captcha'] != $_SESSION['captcha']) {
Notice::alloc()->set(_t('验证码错误'), 'error');
Cookie::set('__typecho_remember_captcha', '');
$response->goBack();
}
}
}
public static function addCaptcha()
{
$request = new Request(HttpRequest::getInstance());
$pathinfo = $request->getRequestUri();
$loginPath = Common::url('login.php', defined('__TYPECHO_ADMIN_DIR__') ? __TYPECHO_ADMIN_DIR__ : '/admin/');
$secureUrl = Helper::security()->getIndex('login-captcha');
if (stripos($pathinfo, $loginPath) === 0) {
?>
<script>
(function () {
let _src = '<?php echo $secureUrl ?>';
const src = _src + (_src.includes('?') ? '&t=' : '?t=');
let pwd = document.getElementById('password');
pwd?.parentNode?.insertAdjacentHTML('afterend', `<p id="captcha-section">
<label class="sr-only" for="captcha"><?php _e("验证码"); ?></label>
<input type="text" name="captcha" id="captcha" class="text-l w-100" placeholder="<?php _e("填写答案"); ?>" required />
<img id="captcha-img" src="<?php echo $secureUrl ?>" title="<?php _e("点击刷新") ?>" />
</p>`);
let img = document.getElementById('captcha-img');
let timeOut;
img?.addEventListener('click', function () {
if (img.classList.contains('not-allow')) {
return;
}
img.classList.add('not-allow');
img.src = src + Math.random();
timeOut = setTimeout(() => {
img.classList.remove('not-allow');
}, 1000);
});
})()
</script>
<style>
#captcha-section {
display: flex;
}
#captcha {
box-sizing: border-box;
}
#captcha:invalid:not(:placeholder-shown) {
border: 2px solid red; /* 不符合模式时显示红框 */
}
#captcha:valid {
border: 2px solid green; /* 符合模式时显示绿框 */
}
#captcha-img {
cursor: pointer;
}
#captcha-img.not-allow {
cursor: not-allowed;
}
</style>
<?php
}
}
}
?>

Action.php

<?php
namespace TypechoPlugin\LoginCaptcha;
use Typecho\Widget;
use Utils\Helper;
use Widget\ActionInterface;
class Action extends Widget implements ActionInterface
{
private $captchaType;
public function __construct()
{
$options = Helper::options();
$this->captchaType = $options->plugin('LoginCaptcha')->captchaType;
}
// 渲染验证码
public function renderCaptcha()
{
Helper::security()->protect();
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
$captcha = $this->generateCaptcha();
$_SESSION['captcha'] = $captcha['code'];
header('Content-type: image/png');
imagepng($captcha['image']);
imagedestroy($captcha['image']);
exit;
}
// 生成验证码
private function generateCaptcha(): array
{
if ($this->captchaType === 'random') {
$types = ['alphabet', 'numeric', 'mixed'];
$this->captchaType = $types[array_rand($types)]; // 随机选择一种验证码类型
}
switch ($this->captchaType) {
case 'alphabet':
$code = $this->generateAlphabetCode();
break;
case 'numeric':
$code = $this->generateNumericCode();
break;
case 'mixed':
$code = $this->generateMixedCode();
break;
default:
$code = $this->generateNumericCode();
}
$width = 180;
$height = 40;
$image = imagecreatetruecolor($width, $height);
imagealphablending($image, false);
imagesavealpha($image, true);
$background_color = imagecolorallocatealpha($image, 255, 255, 255, 127);
imagefill($image, 0, 0, $background_color);
for ($i = 0; $i < 100; $i++) {
$noise_color = imagecolorallocate($image, rand(100, 255), rand(100, 255), rand(100, 255));
imagesetpixel($image, rand(0, $width), rand(0, $height), $noise_color);
}
for ($i = 0; $i < 5; $i++) {
$line_color = imagecolorallocate($image, rand(100, 255), rand(100, 255), rand(100, 255));
imageline($image, rand(0, $width), rand(0, $height), rand(0, $width), rand(0, $height), $line_color);
}
$x = 10;
$font_size = 20;
$font_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'hylxjt.ttf'; // 确保字体文件路径正确
// 将问题拆分为单个字符(包括=和?)
$question = implode('', $code['question']);
$chars = preg_split('//u', $question, -1, PREG_SPLIT_NO_EMPTY);
// 计算总宽度
$totalWidth = 0;
foreach ($chars as $char) {
$textbox = imagettfbbox($font_size, 0, $font_path, $char);
$totalWidth += ($textbox[2] - $textbox[0]) + rand(5, 10);
}
$x = ($width - $totalWidth) / 2;
$y = ($height + $font_size) / 2;
// 绘制问题字符串,每个字符随机颜色
foreach ($chars as $char) {
$char_color = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
imagettftext($image, $font_size, rand(-30, 30), $x, $y, $char_color, $font_path, $char);
$textbox = imagettfbbox($font_size, 0, $font_path, $char);
$x += ($textbox[2] - $textbox[0]) + rand(5, 10); // 字符之间的随机间隙
}
return array('image' => $image, 'code' => $code['code']);
}
// 生成纯字母验证码
private function generateAlphabetCode(): array
{
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
$code = substr(str_shuffle($chars), 0, 4);
return array('question' => str_split($code), 'code' => $code);
}
// 生成纯数字加法验证码
private function generateNumericCode(): array
{
$num1 = rand(0, 9);
$num2 = rand(0, 9);
$code = $num1 + $num2;
$question = "$num1 + $num2";
return array('question' => str_split($question), 'code' => $code);
}
// 生成数字和汉字加法混合验证码
private function generateMixedCode(): array
{
$num1 = rand(0, 9);
$num2 = rand(0, 9);
$code = $num1 + $num2;
$num1Chinese = $this->numberToChinese($num1);
$num2Chinese = $this->numberToChinese($num2);
$rand = rand(0, 2);
if ($rand == 0) {
$question = "$num1 + $num2Chinese";
} elseif ($rand == 1) {
$question = "$num1Chinese + $num2";
} else {
$question = "$num1Chinese + $num2Chinese";
}
return array('question' => str_split($question), 'code' => $code);
}
// 将数字转换为中文
private function numberToChinese($num)
{
$chineseNumbers = array('零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖');
return $chineseNumbers[$num];
}
public function action()
{
// 空
}
}
?>

增加了验证码类型选项,基本测试通过。
字体文件
hylxjt.zip

2024年10月31日星期四

如何删除多余的office授权信息

office有多个授权信息,同时显示授权和未授权的解决方案:
用管理员身份运行命令提示符窗口,通过以下命令按下enter键切换到相应目录:

cd C:\Program Files\Microsoft Office\Office16

接着输入下面命令按回车键获取office全部密钥:

cscript ospp.vbs /dstatus

获取密钥的界面,找到不需要版本的key:五位大写字符
使用如下命令清除:

cscript ospp.vbs /unpkey:*****

清除后office授权信息正常了

就不附图了

2023年12月30日星期六

2023

说,还是不说,是一个问题。离地球毁灭又近了一年,阿门!

2023年7月26日星期三

DELL one 2330 安装windows10

之前总是有一个问题,安装完成后,无论是用windows10自带的系统更新或是驱动软件安装显卡驱动,总是会有各种各样的问题。比如显卡风扇声音一阵一阵的非常大。经过偿试,在DELL官网下载windows 10 7650A显卡驱动。在安装完纯净的系统后,直接最先安装7650A显卡驱动。然后重启更新其余驱动。目前看来是最优解,当然也只是我自己的方法。每个人的方法可能不同,欢迎大家分享。

2023年5月26日星期五

2023年3月11日星期六

你非要让我在学校食堂吃,那我还不是只有饿...

一个小学生的心声,当奶奶要他在学校食堂吃午餐。他发出了标题的声音。
其实,家里的伙食也很一般,但是一个小学生发出这样的声音,是孩子的问题?还是...
这个孩子不是别人,正是犬子。

2023年2月20日星期一

AutoCAD 2014 注册激活教程

1.双击AutoCAD_2014_Simplified_Chinese_Win_64bit_dlm.sfx.exe 程序。

2.等待autodesk自解压完成。

3.点击安装在此计算机上。

4.点击国家或地区:China(选择中国)-->我接受-->下一步。

5.上面那块用蓝色圈着的,默认就可以,下面那块选择我有我的产品信息,输入安装序列号:系列号①666-69696969,系列号② 667-98989898, 系列号③400-45454545 这三个系列号任选其一, 输入密匙: 001F1 ,然后点击下一步

6.安装路径为默认的就可以,可自选合适的盘。点安装。

7.等待安装完成,需要几分钟。

8.初次安装已经完成,点击下一步。

9.点开开始菜单-->所有程序-->autodesk-->AutoCAD 2014 - 简体中文 (Simplified Chinese)-->点右键-->发送到桌面快捷方式。

10.双击左面图标AutoCAD 2014 - 简体中文(SimplifiedChinese),

11.autodesk许可-->勾选我接受-->我同意

12.点击激活,并选择我同意。

13.看到安全警报,点是。

14.看到产品许可激活选项,选择我具有AUTODESK提供的激活码,

15.打开网上下载的破解文件,xf-adsk64.exe,xf-adsk32.exe,看自己的电脑的需求。右键点击我的电脑-->属性-->系统属性:

16.我这边选择xf-adsk64.exe

17.将申请号复制黏贴到注册机里的request,点击patch然后再点击Generate。

18.将产生的activation ,激活码复制黏贴到输入框内。点击下一步。

19.破解成功了。点完成。

AutoCAD-2014.jpg

2023年1月1日星期日

2022记忆

2022年,就此走过,普通人有太多太多不同的记忆,人间冷暖,世态炎凉。 但是它们却只希望人们记住它们强加的“美好”!它们只希望人们的自主记忆就是一张白纸,不,白纸也不行……

HP P1606dn 打印机部分设置

重置打印机IP:关机状态下,长按两个功能键,然后按一下开机键,直到状态灯闪烁时,松开功能键,就可以完成机器初始化,并获得新的IP地址。 查看打印机配置:长按5秒机器上的打印键就能列印出相关信息了。