pyinstaller.exe -F 文件路径/要打包的文件.py
查看 Windows 电脑已经连接过wifi 信息
开始运行, cmd
for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @echo %j | findstr -i -v echo | netsh wlan show profiles %j key=clear
删除WSL

打开cmd,输入wslconfig
对 Windows 上的 Linux 子系统进行操作管理
用途:
/l, /list [/all]
列出已注册的分发版。
/all - 有选择地列出所有分发版,包括
当前正在安装或卸载的分发版。
/s, /setdefault <DistributionName>
将该分发版设为默认。
/t, /terminate <DistributionName>
终止分发。
/u, /unregister <DistributionName>
取消分发版注册。
/upgrade <DistributionName>
将分发版升级至 WslFs 文件系统格式。
C:\Users\user>wslconfig /l
Windows Subsystem for Linux Distributions:
kali-linux (Default)
Ubuntu
C:\Users\terry.gu>wslconfig /s Ubuntu #设置ubuntu 为默认wsl
在使用Zabbix 时出现,图表中的文字无法正常显示。
在使用Zabbix 时出现,图表中的文字无法正常显示。
在查阅后,得出需要检查的地方有两个:
- /usr/share/zabbix/fonts/ 这个地方时存放zabbix前台显示的字体文件的,文件以ttf为后缀。
- /usr/share/zabbix/include/defines.inc.php 这个文件是zabbix 的配置文件。
define('ZBX_GRAPH_FONT_NAME', '字体文件名'); // font file name define('ZBX_FONT_NAME', '
字体文件名
')
pip 安装库时设置代理服务器
设置代理
一次性
pip install --proxy="user:password@server:port" yourpackage
指定安装的源
pip install mysqlclient -i http://http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Openpyxl 格式xls文件
PS快速解锁AD 账号
查找账号: get-aduser -f {name -like ‘*santa*’} | format-list name,samaccountname
1.查询账号是否被锁定
Get-ADUser sean.shen -Properties * | Select-Object lockedout
2. 解锁账号
Unlock-ADAccount -Identity sean.shen
MDT 客户端载入镜像出错
今天我们的小伙伴在使用MDT 装机的时候遇到个问题,无法载入vim 启动镜像
查询很多文档后发现,是由于TFTP的验证出现问题,未能找到根本原因。
不过发现在WDS中,选择服务器,查看属性取消验证后,可以正常使用。
在TFTP中选择把”Enable Variable Windows Extension”前面的勾取消。
然后重启服务器,再次尝试,正常
PING命令的各类反馈信息
1、Reply from 75.44.24.253: bytes=32 time=3ms TTL=254
C:\>ping 75.44.24.253
Pinging 75.44.24.253 with 32 bytes of data:
Reply from 75.44.24.253: bytes=32 time=3ms TTL=254
Reply from 75.44.24.253: bytes=32 time=3ms TTL=254
Reply from 75.44.24.253: bytes=32 time=3ms TTL=254
Reply from 75.44.24.253: bytes=32 time=3ms TTL=254
Ping statistics for 75.44.24.253:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 3ms, Average = 3ms
表示收到从目标主机75.44.24.253返回的响应数据包,数据包大小为32Bytes,发送数据包数为4个,返回数据包4个,丢包率为0,最小响应时间3ms,最大响应时间3ms,平均响应时间3ms,TTL为255,这个结果表示您的计算机到目标主机之间连接正常。
2、Request timed out
a.对方已关机,或者网络上根本没有这个地址,都会得到超时的信息。
b.对方与自己不在同一网段内,通过路由也无法找到对方,但有时对方确实是存在的,当然不存在也是返回超时的信息。
c.对方确实存在,但设置了ICMP数据包过滤(比如防火墙设置)
3、Destination host Unreachable
表示目标主机无法到达。
对方与自己不在同一网段内,而自己又未设置默认的路由。
网线出了故障。
这里要说明一下“destination host unreachable”和 “time out”的区别,如果所经过的路由器的路由表中具有到达目标的路由,而目标因为其他原因不可到达,这时候会出现“time out”,如果路由表中连到达目标的路由都没有,那就会出现“destination host unreachable”。
4、Bad IP address
这个信息表示您可能没有连接到DNS服务器,所以无法解析这个IP地址,也可能是IP地址不存在。
5、Source quench received
这个信息比较特殊,它出现的机率很少。它表示对方或中途的服务器繁忙无法回应。
6、Unknown host——不知名主机
这种出错信息的意思是,该远程主机的名字不能被域名服务器(DNS)转换成IP地址。故障原因可能是域名服务器有故障,或者其名字不正确,或者网络管理员的系统与远程主机之间的通信线路有故障。
7、No answer——无响应
这种故障说明本地系统有一条通向中心主机的路由,但却接收不到它发给该中心主机的任何信息。故障原因可能是下列之一:中心主机没有工作;本地或中心主机网络配置不正确;本地或中心的路由器没有工作;通信线路有故障;中心主机存在路由选择问题。
8、no rout to host:网卡工作不正常。
9、transmit failed,error code:10043网卡驱动不正常。
10、unknown host name:DNS配置不正确。
修改 WSL Ubuntu 18.04 默认源为阿里云镜像
Win10 Windows Store 中下载的 WSL Ubuntu 18.04 默认的源 apt install 下载速度异常缓慢,想替换成国内阿里云的镜像源。
确认默认源
首先查看默认的源的地址
sudo vim /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://archive.ubuntu.com/ubuntu/ bionic universe
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates universe
...
修改默认源
首先将原配置文件备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.20181013
然后 VIM 打开,替换
:%s/security.ubuntu/mirrors.aliyun/g
:%s/archive.ubuntu/mirrors.aliyun/g
更新
sudo apt update
再使用 apt install 速度就快多了