标签: Windows10

  • Windows10 WSL2限制cpu和内存

    Windows10 WSL2限制cpu和内存

    按下Windows + R 键,输入 %UserProfile% 并运行进入用户文件夹,新建文件 .wslconfig,文件内容格式如下

    [wsl2]
    memory=2048MB # 限制最大使用内存
    swap=2G # 限制最大使用虚拟内存
    processors=1 # 限制最大使用cpu个数
    localhostForwarding=true

    然后运行cmd,输入 wsl --shutdown 来关闭当前的子系统,重新运行bash进入子系统

  • Windows下wsl更新到wsl2适用于 Linux 的 Windows 子系统安装指南 (Windows 10)

    Windows下wsl更新到wsl2适用于 Linux 的 Windows 子系统安装指南 (Windows 10)

    刚好将本机的WSL升级到WSL2,下面给出官方的文档地址,适用于 Linux 的 Windows 子系统安装指南 (Windows 10)

    https://docs.microsoft.com/zh-cn/windows/wsl/install-win10

  • Win10右键添加在此处打开powershell

    Win10右键添加在此处打开powershell

    你想要的效果可能就是这个吧?但是找了好久没有找到方法?哈哈,大家都一样,实际上,不需要修改任何东西,

    解决方法

    在文件夹空白处,按住shift同时鼠标右击,发现没??发现没!!!!

    如果安装了wsl的话,输入bash也是可以的。

  • windows下如何设置pip源为国内 图文教程

    windows下如何设置pip源为国内 图文教程

    在这里我使用清华源来做示范

    win+R 打开用户目录%HOMEPATH%,在此目录下创建 pip 文件夹,在 pip 目录下创建 pip.ini 文件, 内容如下,

    在pip文件夹里新建的pip.ini代码如下

    [global]
    timeout = 6000
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    trusted-host = pypi.tuna.tsinghua.edu.cn

    另外还有一些其他国镜像

    阿里云  http://mirrors.aliyun.com/pypi/simple/ 
    中国科技大学   https://pypi.mirrors.ustc.edu.cn/simple/ 
    豆瓣(douban)  http://pypi.douban.com/simple/ 
    清华大学  https://pypi.tuna.tsinghua.edu.cn/simple/ 
    中国科学技术大学  http://pypi.mirrors.ustc.edu.cn/simple/

  • Windows10 Docker Mariadb InnoDB: Write to file ./ibdata1 failed

    Windows10 Docker Mariadb InnoDB: Write to file ./ibdata1 failed

    错误描述

    通过容器日志查到错误信息如下:

    2020-01-05 13:06:14 0 [Warning] InnoDB: Retry attempts for writing partial data failed.

    2020-01-05 13:06:14 0 [ERROR] InnoDB: Write to file ./ibdata1 failed at offset 0, 1048576 bytes should have been written, only 0 were written. Operating system error number 22. Check that your OS and file system support files of this size. Check also that the disk is not full or a disk quota exceeded.

    2020-01-05 13:06:14 0 [ERROR] InnoDB: Error number 22 means ‘Invalid argument’

    2020-01-05 13:06:14 0 [ERROR] InnoDB: Could not set the file size of ‘./ibdata1’. Probably out of disk space

    2020-01-05 13:06:14 0 [ERROR] InnoDB: Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.

    2020-01-05 13:06:15 0 [ERROR] Plugin ‘InnoDB’ init function returned error.

    2020-01-05 13:06:15 0 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.

    2020-01-05 13:06:15 0 [ERROR] Unknown/unsupported storage engine: InnoDB

    2020-01-05 13:06:15 0 [ERROR] Aborting

    windows10 + Docker 安装 mariadb 时,一安装老是出现以上错误。创建命令如下:

    docker run -d -p 3307 --name jmysql -v D:\MysqlData\:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=jjjjjj mariadb

    解决办法

    使用以下命令进行创建

    docker run -d -p 3307:3306 --name jmysql -v D:\MysqlData\:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=jjjjjj mariadb --innodb-flush-method=fsync

    创建时需要添加:

    –innodb-flush-method=fsync

    注:重新创建时需要将 d:\MysqlData 目录清空并重新建立容器。

  • Docker Windows 版本拉取镜像错误 no matching manifest

    Docker Windows 版本拉取镜像错误 no matching manifest

    问题描述

    在 docker 拉取镜像时出现错误

    > docker pull mysql
    Unable to find image ‘mysql:latest’ locally
    latest: Pulling from library/mysql
    C:\Program Files\Docker\Docker\Resources\bin\docker.exe: no matching manifest for windows/amd64 10.0.18362 in the manifest list entries.

    windows 10 x64安装版本需要开启Hyper-V

    Docker镜像拉取错误码:

    docker pull mysql

    Pulling from library/mysql
    no matching manifest for unknown in the manifest list entries

    解决方法:

    experimental 设置为 true 即可.

  • Docker.For.Win – Install fails on installationmanifest.json

    Docker.For.Win – Install fails on installationmanifest.json

    问题描述

    Docker升级出现 Installation Failed:

        Text from error:
        Installing Docker for Windows 
        Docker for Windows 
        Installation failed 
        x 
        17.06.O-rc2-ce-win14 
        Could not find file 'C:\Program Files\Docker\Docker\installationmanifest.json'. 
        at System.lO._Error.WinlOError(lnt32 errorCode, String maybeFullPath) 
        at System.lO.FileStream.lnit(String path, FileMode mode, FileAccess access, Int32 rights, Boolean 
        useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String 
        msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) 
        at System.lO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 
        bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean 
        checkHost) 
        at System.lO.StreamReader..ctor(String path, Encoding encoding, Boolean 
        detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) 
        at System.lO.File.lnternalReadAllText(String path, Encoding encoding, Boolean checkHost) 
        at Lightweightlnstaller.UninstallWorkflow.<ProcessAsync>d_7.MoveNext() 
        End of stack trace from previous location where exception was thrown 
        at System. Runtime. ExceptionServices. Exception Dispatchl nfo. Throw()

    解决办法

    1. Kill the installer process if it’s still running.
    2. Run Regedit.
    3. Run a quick backup of the registry by selecting File > Export (It is recommended that you set the export range to All.)
    4. Navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
    5. If there is a Docker for Windows entry, delete key and all subkeys.
    6. Relaunch the installer, and you should no longer be prompted to update. The installer should proceed as a fresh install from this point.

    1、关闭所有的安装进程

    2、运行注册表(WIN+r), 在运行中输入:regedit

    3、打开注册表 Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    4、找到 Docker for Windows

    5、将右侧的支点全部删除。

    可以将Docker恢复到最初的状态,然后可以重新安装或升级。

  • Windows 10启用Linux子系统(WSL) 图文教程

    Windows 10启用Linux子系统(WSL) 图文教程

    Windows Subsystem for Linux(简称WSL)是一个为在Windows 10上能够原生运行Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,目标是使纯正的Ubuntu 14.04 “Trusty Tahr”映像能下载和解压到用户的本地计算机,并且映像内的工具和实用工具能在此子系统上原生运行。

    启用Linux子系统

    在“程序和功能” – 启用或关闭Windows功能 – 勾选适用于Linux的Windows子系统,然后点击确定等待Windows自动安装。

    安装完毕后需要重启一次才会生效,重启后打开Windows应用商店,搜索“Debian”或者“Ubuntu”,然后进行安装。

    使用Linux子系统

    这里老季安装的是Debian,首次启动WSL的时候会要求设置一个账号、密码,根据提示完成设置即可。

    注意上面设置的用户是没有root权限的,我们可以通过sudo su -来切换root用户,或者在某些需要root权限运行的条件下加上sudo命令即可。

    总结

    Windows 10子系统(WSL)可以原生运行Linux命令,但遗憾的是窗口不支持多标签运行,不过好在很多第三方软件已经支持设置WSL作为终端,比如Putty可以将终端设置为WSL,这样就可以在MobaXterm 环境下多标签使用WSL了。


  • 2003到2016各版服务器操作系统ms17-010补丁直链地址

    特别提醒:

    1、确保135,137,139,445端口已通过路由器、端口策略,防火墙封闭的,或者其他安全工具(比如360NSA武器库免疫工具:http://dl.360safe.com/nsa/nsatool.exe)补丁过的,可以不打微软补丁,但若不清楚或者不确定的,请务必打上微软的补丁

    2、2008和2003、XP必打,现在均有漏洞批量利用工具
    2012和2016好一些没有大面积被黑,但是都建议打上对应补丁,因为没有批量利用工具做出来,不代表这个漏洞是无法利用的,有可能只是工具还没开发出来而已


    20170513微软发布了Windows XP和Windows 2003的ms17-010特别补丁,详情请看以下链接

    https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/

    ——————————-
    winxp特别补丁 – KB4012598
    ——————————-
    winxp3 32位 Security Update for Windows XP SP3 (KB4012598)

    http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-custom-chs_dca9b5adddad778cfd4b7349ff54b51677f36775.exe

    winxp2 64位 Security Update for Windows XP SP2 for x64-based Systems (KB4012598)

    http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-enu_f24d8723f246145524b9030e4752c96430981211.exe

    ——————————-
    win2003特别补丁 – KB4012598
    ——————————-
    2003SP2 32位 Security Update for Windows Server 2003 (KB4012598)

    http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x86-custom-chs_b45d2d8c83583053d37b20edf5f041ecede54b80.exe

    2003SP2 64位 Security Update for Windows Server 2003 for x64-based Systems (KB4012598)

    http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-chs_68a2895db36e911af59c2ee133baee8de11316b9.exe

    ——————————-
    2008R2补丁 KB4012212、KB4012215
    ——————————-
    March, 2017 Security Only Quality Update for Windows Server 2008 R2 for x64-based Systems (KB4012212)

    http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.1-kb4012212-x64_2decefaa02e2058dcd965702509a992d8c4e92b3.msu

    March, 2017 Security Monthly Quality Rollup for Windows Server 2008 R2 for x64-based Systems (KB4012215)

    http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/03/windows6.1-kb4012215-x64_a777b8c251dcd8378ecda(论坛关键词屏蔽,请去掉我)fa81aefbe7f9009c72b.msu

    ——————————-
    win7补丁 KB4012212、KB4012215
    ——————————-
    win7 32位
    March, 2017 Security Only Quality Update for Windows 7 (KB4012212)

    http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.1-kb4012212-x86_6bb04d3971bb58ae4bac44219e7169812914df3f.msu

    March, 2017 Security Monthly Quality Rollup for Windows 7 (KB4012215)

    http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/03/windows6.1-kb4012215-x86_e5918381cef63f171a74418f12143dabe5561a66.msu

    win7 64位
    March, 2017 Security Only Quality Update for Windows 7 for x64-based Systems (KB4012212)

    http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.1-kb4012212-x64_2decefaa02e2058dcd965702509a992d8c4e92b3.msu

    March, 2017 Security Monthly Quality Rollup for Windows 7 for x64-based Systems (KB4012215)

    http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/03/windows6.1-kb4012215-x64_a777b8c251dcd8378ecda(论坛关键词屏蔽,请去掉我)fa81aefbe7f9009c72b.msu

    ——————————-
    win10 1607补丁 KB4013429
    ——————————-
    win10 1607 32位
    Cumulative Update for Windows 10 Version 1607 (KB4013429)

    http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/03/windows10.0-kb4013429-x86_8b376e3d0bff862d803404902c4191587afbf065.msu

    win10 1607 64位
    Cumulative Update for Windows 10 Version 1607 for x64-based Systems (KB4013429)

    http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/03/windows10.0-kb4013429-x64_ddc8596f88577ab739cade1d365956a74598e710.msu

    ——————————-
    2012R2补丁 KB4012213、KB4012216
    ——————————-
    March, 2017 Security Only Quality Update for Windows Server 2012 R2 (KB4012213)

    http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/02/windows8.1-kb4012213-x64_5b24b9ca5a123a844ed793e0f2be974148520349.msu

    March, 2017 Security Monthly Quality Rollup for Windows Server 2012 R2 (KB4012216)

    http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/03/windows8.1-kb4012216-x64_cd5e0a62e602176f0078778548796e2d47cfa15b.msu

    ——————————-
    2016补丁 KB4013429
    ——————————-
    Cumulative Update for Windows Server 2016 for x64-based Systems (KB4013429)

    http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/03/windows10.0-kb4013429-x64_ddc8596f88577ab739cade1d365956a74598e710.msu

  • 升级了#Windows10#系统后XAMPP #Apache#不能启动 解决方案 图文教程

    前几天刚刚升级了win10系统,折腾了一阵总算是弄利索了,用起来还是蛮好的,就是担心以后一些软件上未必能完美兼容,尤其是一些建站的朋友们,可能对环境的稳定性要求会高些。

    今天鄙人就遇到这个问题,因为弄一些网站的事情,需要用到XAMPP的建站集成包,自从升级了Win10系统后XAMPP中Apache不能启动了

    如下图所示:

    升级了Win10系统后XAMPP中Apache不能启动的解决办法

    相信很多使用win10系统的建站朋友也会遇到这个问题,其实也不算什么问题,如果的确不知道怎么解决的,那请继续看下去。本站会分享一下Win10系统XAMPP中Apache不能启动的解决办法。

    第一步:检查Apache的端口是否被占用

    因为Apache使用的是80端口,从上面的图片可以看到。所以一把思路就是想检查端口是否有占用或者冲突等。

    方法是:快捷键”win+R”,打开运行,然后进入dos窗口,接着输入“netstat -aon | findstr :80”回车运行。如图所示:

    升级了Win10系统后XAMPP中Apache不能启动的解决办法

    Win10系统80端口被System占用 造成Apache不能启动的解决办法

    从上面的dos窗口中能看出,pid是4的进程占用着80端口,这还是一个系统进程,且不好kill掉。

    第二步:修改注册表参数

    1、打开注册表:regedit。

    方法:快捷键”win+R”,打开运行输入“regedit”回车即可。如下图:

    win10打开regedit的方法

    2、找到:HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesHTTP

    3、在右边找到Start这一项,选中后右键“修改”将“数值数据”“3”改为:0,如图所示:

    Win10系统80端口被System占用 造成Apache不能启动的解决办法

    4、重启系统,System进程不会占用80端口

    重启之后,再启动Apache,看到Running就可以了。如图所示:

    升级了Win10系统后XAMPP中Apache不能启动的解决办法

    注:本方法鄙人试过是有效的,因为win10系统尚有很多未知兼容性问题,不保证所有人的情况都绝对一样。

WeChat