bat设置不显示隐藏的文件文件夹或驱动器

参考: https://www.howtogeek.com/283251/how-do-you-show-or-hide-windows-hidden-files-with-a-command-line-toggle/

正常设置方法

Image

隐藏:

reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v ShowSuperHidden /t REG_DWORD /d 0 /f

reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v Hidden /t REG_DWORD /d 2 /f

显示

reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v ShowSuperHidden /t REG_DWORD /d 1 /f

reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced” /v Hidden /t REG_DWORD /d 1 /f

内容保存成bat, 执行即可。

wordpress 离线升级

aabite.com 不知道是被谁盯上了,被黑了。服务器懒得折腾,换到了virmach,结果,昨天收到邮件说,IO 超了,vps被shutdown。

今天去看了一下,重启vps,就又可以访问了,可是,刚起来Apache,就一大堆的访问,觉得是不是被当成中间代理了。

把aabite.com 下线,充Apache disable

然后下载了最新的wordpress 包,原wordpress里面,删除wp-admin和wp-includes,然后,从新的wordpress里面拷贝过来,

wordpress根目录下的文件,全部替换成最新的。

查看一下wp-config-sample.php,确认没什么更新的

重新启用aabite.com

访问时,发现wp-admin页面进不去

log 发现

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 3958207 bytes) in /var/www/aabite.com/wp-includes/wp-db.php on line 2066

解决办法:

参考 https://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/

即 

define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

重新访问即可。

hostodo ip 被墙

一场倒墙风波过后,我不怎么使用的vps ip也都被ban了,包括hostodo和vultr。

简单的检测方法:ping.chinaz.com

如果国内都不通,国外的通,很明显了。

解决办法:

hostodo 发了个service ticket,说vps cannot access via ssh

当天晚上就发mail,给了个新ip。

服务还是不错的。

vultr 需要新创建实例,然后把旧实例数据restore过去就好。

wordpress 数据库链接失败

今天访问网站,才发现直接提示数据库链接失败

查看mysql的

2019-01-21T03:23:15.998898Z 15638 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed
2019-01-21T03:23:15.999066Z 15638 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed
2019-01-21T03:23:22.791382Z 15639 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed
2019-01-21T03:23:22.791579Z 15639 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed
2019-01-21T03:23:22.791753Z 15639 [ERROR] /usr/sbin/mysqld: Table ‘./mybacc_wordpress/wp_options’ is marked as crashed and last (automatic?) repair failed

参考:https://stackoverflow.com/questions/8843776/mysql-table-is-marked-as-crashed-and-last-automatic-repair-failed

 

server上用mysql 连接server

repair table wp_options' <table_name>;

image

刷新网站,搞定。

babun 访问gitlab 每次弹出用户名密码

问题:

使用babun自带的git,因为工作项目是放在gitlab上,但是每次git pull,都会弹出询问用户名密码,设置了ssh key也是如此。

解决方案:

http://stackoverflow.com/a/36721316/4377192

Get the GCMW’s latest release, download the zip file (not the installer), extract it’s contents (only .dll and .exe files are needed) to C:\cygwin\usr\libexec\git-core\ for 32-bit Cygwin, or C:\cygwin64\usr\libexec\git-core\ for 64-bit Cygwin. Reference

To tell git to use GCMW, execute: git config --global credential.helper manager

To get GUI prompts for credentials, execute: git config --global credential.modalprompt true

If you want this to be a per-repository setting, remove the --global option.

来源: https://github.com/Microsoft/Git-Credential-Manager-for-Windows/issues/146

下载gcmw的zip包,把里面的EXE,DLL文件都拷贝到babun的git-core 目录下

%Profile%\.babun\cygwin\usr\libexec\git-core\

然后设置

git config –global credential.helper manager

如果只是单项目的,移除–global即可

整合的babun下载:

http://www.odrive.tk/?/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/babun-1.2.0-dist.zip

win10 分辨率1080p时显示虚化

win10,连接到外置的显示器,1080p,如果设置缩放100%,字体太小,看的累,

如果设置125%,字体虚,模糊

参考:https://www.zhihu.com/question/34304515

你只需要Windows 10 DPI blurry fix这个小工具。顾扯淡的回答在点上,但是治标不治本。

链接贴在下面。

http://windows10_dpi_blurry_fix.xpexplorer.com/

cba41ebf-a3c4-479f-9202-3b8b0abf1271

DPI 按照设置内的推荐值设置即可。
如果现在是 100,尝试 125

重启之后OK。

Windows替换任务管理器

实现方法:这里其实是使用了一个非常著名的IFEO调试器方法,它可以在某个程序运行的状态下,直接使用注册表中添加的程序信息对其进行替换和调试。在
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe

子键下。只要在其右侧,直接添加“Debugger”字符串值,并手工指定其调试用程序路径,就可以替换已有程序。”C:\PORTABLE\PROCESSEXPLORER\PROCEXP64.EXE”


替换回来:
删除debuger选项