Sep 03

dnsproxy 命令行:

dnsproxy -l 127.0.0.1 -p 0 -s 8053 \
-u 8.8.8.8 -u 1.1.1.1 -f 9.9.9.11 \
--edns --edns-addr=202.62.222.220 \
--all-servers --cache --cache-size=10485760 --cache-optimistic \
-c fullchain.cer -k your.key

这里需要注意,如果不指定证书和密匙,dnsproxy 不会建立 HTTP/HTTPS 监听,也没有任何报错。

nginx:

         location /dns-query {
                proxy_pass       https://127.0.0.1:8053/dns-query;
                proxy_set_header Host      $host;
                proxy_set_header X-Real-IP $remote_addr;
        }

注意,nginx 原本网站配置该加载证书密匙还是保留加载,不需要改。


Feb 18

转自: https://www.chiphell.com/thread-1676546-1-1.html

零售3.5 SATA HDD汇总列表


Jan 15

Windows\Installer 占用空间比较大,有些无聊人比如我就会把它移去另外目录并且拉个目录连接点(Junctions)过去。这样会导致一个大问题,就是有些基于 MSI 的安装文件不能正常执行,会提示“系统无法打开指定的设备或文件”接 “Internal error 2755. 110, ********.msi”。

网上关于权限方面的解决方案对于这种情况是无效的。

正确解决办法是,删除所有盘根目录下下的 Config.Msi 目录,如果 Windows\Installer 下有这个目录也一并删除,用 Everything 全盘搜一下即可,注意这个目录是 系统/隐藏 属性。

0_1287761554kNg6.gif
0_128776156113LS.gif

参考: https://bugs.documentfoundation.org/show_bug.cgi?id=134103

:razz:


Jan 13

1. 改 "app\vendor\symfony\finder\Iterator\SortableIterator.php":

        } elseif (self::SORT_BY_NAME_NATURAL === $sort) {
            $this->sort = static function (SplFileInfo $a, SplFileInfo $b) use ($order) {
                return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());

忽略大小写的自然排序:

        } elseif (self::SORT_BY_NAME_NATURAL === $sort) {
            $this->sort = static function (SplFileInfo $a, SplFileInfo $b) use ($order) {
                return $order * strnatcasecmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());

2. 改 "app\views\components\file.twig"

<div class="ml-2">
<button
title="{{ translate('file.info') }}"
class="flex justify-center items-center rounded-full p-2 -m-1 md:invisible hover:bg-gray-400 hover:shadow group-hover:visible"
v-on:click.prevent="showFileInfo('{{ url(file.getPathname) | escape('js') }}')"
>
<i class="fas fa-info-circle"></i>
</button>
</div>

不显示 Hash 按钮:

<div class="ml-2">
<button
title="{{ translate('file.info') }}"
class="flex justify-center items-center rounded-full p-2 -m-1 md:invisible hover:bg-gray-400 hover:invisible group-hover:invisible"
v-on:click.prevent="showFileInfo('{{ url(file.getPathname) | escape('js') }}')"
>
<i class="fas fa-info-circle"></i>
</button>
</div>

:roll:


Jan 04

简而言之如果你的 Windows 10 是 10.0.19042.685 版本(既 20H2)并且安装在固态硬盘上,在升级 KB4592438 后如果运行过 CHKDSK C: /F ,则有极大几率出现系统重启后蓝屏无法进入系统的现象!

解决办法就是进入恢复模式或者 PE,重新执行 CHKDSK C: /F,然后重启。

进阶脚本,特别适配了 Windows 10 新一代的 CHKDSK 参数:

ScanDisk.bat C: D: E: ... (指定扫描修复,最多接 9 个盘符)

:: BatchGotAdmin 
:-------------------------------------
@echo off
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%system32cacls.exe" "%SYSTEMROOT%system32configsystem"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%getadmin.vbs"

    "%temp%getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%temp%getadmin.vbs" ( del "%temp%getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
    @echo on
:--------------------------------------

:: WindowsVersionChecker (detect OS) 
:--------------------------------------
@ECHO off
REM https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832.aspx
REM 10.0 -- Win 10, Win Server 2016 TP2
REM 6.4 -- Win 10 TP, Win Server 2016 TP1
REM 6.3 -- Win 8.1, Win Server 2012 R2
REM 6.2 -- Win 8, Win Server 2012
REM 6.1 -- Win 7, Win Server 2008 R2
REM 6.0 -- Win Vista, Win Server 2008
REM 5.2 -- Win Server 2003, Win Server 2003 R2, Win XP 64-Bit Edition
REM 5.1 -- Win XP
REM 5.0 -- Win 2000

FOR /f "tokens=4,5,6 delims=[]. " %%a IN ('ver') DO (
    SET WVer=%%a.%%b.%%c
    SET WMajor=%%a
    SET WMinor=%%b
    SET WRev=%%c
)
:--------------------------------------

:: ScanDisk All::PrintInfo  (c) 2015 BSD-Clause 3
:--------------------------------------
@echo off
echo.
echo == ScanDisk All ==
echo   (C) 2014-2015 "" BSD-Clause 3
echo.
echo   This program will run CHKDSK on selected drives in an unattended manner.
echo   CHKDSK will be done in a two-steps way for safer execution.
echo   Supports:
echo     * NTFS
echo     * New generation CKHDSK commands (/scan /perf ...)
echo     * Special treatment of SYSTEM drive (C: as default).
echo       - Includes "sfc /scannow" for check system files integrity.
echo.
echo   Notice that if you system drive is not C:, you MUST change the line:
echo     SET SYSTEM_DRIVE=C:
echo.
echo   Press ANY KEY to continue...
echo.
pause>nul
:--------------------------------------

:: ScanDisk All 
:--------------------------------------
@echo off
REM The System Drive must be specially treated.
SET SYSTEM_DRIVE=C:

REM check Win8+ capabilities (requires WindowsVersionChecker)
if 62 LEQ %WMajor%%WMinor% (set CHKDSK_NG=1) else (set CHKDSK_NG=0)
if %CHKDSK_NG% == 1 (echo Info chkdsk: new capabilities enabled)

REM ^, -- ^ is the escape character for declarations  between '
for %%a in (%*) do (
    echo.
    echo ________________________________________
    if "%%a" == "%SYSTEM_DRIVE%" (
        if %CHKDSK_NG% == 1 (
            echo ### Read-Only ScanDisk of System Drive %%a
            chkdsk /scan /perf /forceofflinefix %%a
            echo ### Run System File Checker on System Drive %%a
            sfc /scannow
        ) else (
            echo Set ### System Drive %%a as dirty to force boot-scandisk scan
            fsutil dirty set %%a
        )
    ) else (
        echo ### Two-steps ScanDisk of unit %%a
        if %CHKDSK_NG% == 1 (
            REM http://www.minasi.com/newsletters/nws1305.htm (chkdsk Win 8+ features)
            chkdsk /scan /perf /forceofflinefix %%a
            chkdsk /X /offlinescanandfix %%a
        ) else (
            REM Old scan (backward compatibility              chkdsk /F /X %%a
            chkdsk /F /X /R /B %%a
        )
    )
)
:--------------------------------------

:: Power off routine 
rem :--------------------------------------
rem @echo off
rem echo Preparing to shutdown..."
rem shutdown /s /t 120
rem echo Press enter to abort shutdown
rem pause > nul
rem shutdown /a
rem echo Shutdown aborted
rem pause
rem :--------------------------------------

ScanDiskAll.bat (扫描修复机器上所有检测到的硬盘,可选扫描后重启)

:: BatchGotAdmin 
:-------------------------------------
@echo off
REM  --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%system32cacls.exe" "%SYSTEMROOT%system32configsystem"

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%getadmin.vbs"
    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%getadmin.vbs"

    "%temp%getadmin.vbs"
    exit /B

:gotAdmin
    if exist "%temp%getadmin.vbs" ( del "%temp%getadmin.vbs" )
    pushd "%CD%"
    CD /D "%~dp0"
    @echo on
:--------------------------------------

:: WindowsVersionChecker (detect OS) 
:--------------------------------------
@ECHO off
REM https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832.aspx
REM 10.0 -- Win 10, Win Server 2016 TP2
REM 6.4 -- Win 10 TP, Win Server 2016 TP1
REM 6.3 -- Win 8.1, Win Server 2012 R2
REM 6.2 -- Win 8, Win Server 2012
REM 6.1 -- Win 7, Win Server 2008 R2
REM 6.0 -- Win Vista, Win Server 2008
REM 5.2 -- Win Server 2003, Win Server 2003 R2, Win XP 64-Bit Edition
REM 5.1 -- Win XP
REM 5.0 -- Win 2000

FOR /f "tokens=4,5,6 delims=[]. " %%a IN ('ver') DO (
	SET WVer=%%a.%%b.%%c
	SET WMajor=%%a
	SET WMinor=%%b
	SET WRev=%%c
)
:--------------------------------------

:: ScanDisk All::PrintInfo  (c) 2015 BSD-Clause 3
:--------------------------------------
@echo off
echo.
echo == ScanDisk All ==
echo   (C) 2014-2015 "" BSD-Clause 3
echo.
echo   This program will run CHKDSK on all drives in an unattended manner.
echo   CHKDSK will be done in a two-steps way for safer execution.
echo   The computer will be shutdown after finishing, but can be aborted
echo   by pressing enter.
echo   Supports:
echo     * NTFS
echo     * FAT32
echo     * New generation CKHDSK commands (/scan /perf ...)
echo     * Special treatment of SYSTEM drive (C: as default).
echo       - Includes "sfc /scannow" for check system files integrity.
echo.
echo   Notice that if you system drive is not C:, you MUST change the line:
echo     SET SYSTEM_DRIVE=C:
echo.
echo   Press ANY KEY to continue...
echo.
pause>nul
:--------------------------------------

:: ScanDisk All 
:--------------------------------------
@echo off
REM The System Drive must be specially treated.
SET SYSTEM_DRIVE=C:

REM check Win8+ capabilities (requires WindowsVersionChecker)
if 62 LEQ %WMajor%%WMinor% (set CHKDSK_NG=1) else (set CHKDSK_NG=0)
if %CHKDSK_NG% == 1 (echo Info chkdsk: new capabilities enabled)

REM ^, -- ^ is the escape character for declarations  between '
for /f "skip=1 tokens=1,2 delims= " %%a in ('wmic logicaldisk get caption^,filesystem') do (
	echo.
	echo ________________________________________
	if "%%a" == "%SYSTEM_DRIVE%" (
		if %CHKDSK_NG% == 1 (
			echo ### Read-Only ScanDisk of System Drive %%a
			chkdsk /scan /perf /forceofflinefix %%a
			echo ### Run System File Checker on System Drive %%a
			sfc /scannow
		) else (
			echo Set ### System Drive %%a as dirty to force boot-scandisk scan
			fsutil dirty set %%a
		)
	) else if "%%b" == "NTFS" (
		echo ### Two-steps ScanDisk of %%b unit %%a
		if %CHKDSK_NG% == 1 (
			REM http://www.minasi.com/newsletters/nws1305.htm (chkdsk Win 8+ features)
			chkdsk /scan /perf /forceofflinefix %%a
			chkdsk /X /offlinescanandfix %%a
		) else (
			REM Old scan (backward compatibility  			chkdsk /F /X %%a
			chkdsk /F /X /R /B %%a
		)
	) else if "%%b" == "FAT32" (
		echo ### Two-steps ScanDisk of %%b unit %%a
		chkdsk /F /X %%a
		chkdsk /F /X /R %%a
	)
)
:--------------------------------------

:: Power off routine 
rem :--------------------------------------
rem @echo off
rem echo Preparing to shutdown..."
rem shutdown /s /t 120
rem echo Press enter to abort shutdown
rem pause > nul
rem shutdown /a
rem echo Shutdown aborted
rem pause
rem :--------------------------------------

参考:

https://borncity.com/win/2020/12/18/windows-10-20h2-chkdsk-damages-file-system-on-ssds-with-update-kb4592438-installed/


[3/59]  < 1 2 3 4 5 6 7 8 9 10 > ... »