pip 安装库时设置代理服务器

设置代理

一次性

pip install --proxy="user:password@server:port" yourpackage

指定安装的源

pip install mysqlclient -i http://http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
more ...

Openpyxl 格式xls文件

由于原始文件室XLS需要利用win32com.client进行转换

然后利用循环将所有的单元格格式化。

并保存为当前日期的文件名。

more ...

PS快速解锁AD 账号

查找账号: get-aduser -f {name -like '*santa*'} | format-list name,samaccountname

1.查询账号是否被锁定

Get-ADUser sean.shen -Properties * | Select-Object lockedout
  1. 解锁账号

    Unlock-ADAccount -Identity sean.shen

more ...

MDT 客户端载入镜像出错

今天我们的小伙伴在使用MDT 装机的时候遇到个问题,无法载入vim 启动镜像

image1

查询很多文档后发现,是由于TFTP的验证出现问题,未能找到根本 …

more ...

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 …

more ...

修改 WSL Ubuntu 18.04 默认源为阿里云镜像

Win10 Windows Store 中下载的 WSL Ubuntu 18.04 默认的源 apt install 下载速度异常缓慢,想替换成国内阿里云的镜像源。

确认默认源

首先查看默认的 …

more ...

powershell 批量更新用户账号属性

命令:

Import-Csv 'd:\phone.csv' | % { Set-ADUser -identity $_.'samaccountname' -mobilephone $_.'mobilephone' -OfficePhone $_.officephone }

phone.csv 内容如下:

samaccountname,MobilePhone,officephone
account,(86) 21 1234567 ,(86) 098765454331
more ...

Powershell 添加ad 组成员

Add-ADGroupMember -Identity <Groupname> -Members <useraccount>,<useraccount>,<useraccount>

参考地址:https://technet.microsoft.com/zh-cn/library/hh852331.aspx

more ...

GLPI 启用AD LDAP认证

点击设置---身份验证--LDAP目录添加认证。

image1

输入名称: 域的名称

默认服务器:输入域控制器的IP地址

激活: 选择是

链接过滤器:  输入:

more ...

Centos7 安装第三方源

  1. 启用安装

    yum install epel-release

  2. 安装相关的源

    rpm -Uvh xxxx.rpm

more ...

Centos7 安装最新版本的mariadb

参考地址:https://downloads.mariadb.org/mariadb/repositories/#mirror=shanghai-university

1. 选择操作系统centos7

2.创建repo文件

输入内容;
# MariaDB 10.3 CentOS repository list - created 2018-06-05 06:27 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http …
more ...

Centos7 firewall

添加开放8080端口

firewall-cmd --zone=public --add-port=8080/tcp --permanent

(--permanent永久生效,没有此参数重启后失效)

批量开放端口
firewall-cmd --permanent --zone=public --add-port=100-500/tcp
firewall-cmd --permanent --zone=public --add-port=100-500/udp

重新载入配置

firewall-cmd …

more ...

Powershell 删除ad 组成员

Remove-ADGroupMember -Identity "CN-SHAFNP2-FS-ADM-RW" -Members "lzhang" -Confirm:$false
"CN-SHAFNP2-FS-ADM-RW"组名字
"lzhang" 要删除的用户名
-Confirm:$false 确认删除参数,不加的话每次都弹出来问你是否确认。
more ...

HP DL360E GEN8 centos raid 驱动

昨天对一台HPE DL360 gen8的机器重装centos7,
在raid 做完之后开始进行安装系,但是等到磁盘分区的界面时,发现系统无法识别之前建好的raid,还是只 …
more ...

Powershell 命令获取AD 组信息

Poweshell 命令获取AD 组信息

Get-ADGroup -Filter * -SearchBase "ou=Distribution,ou=Groups,ou=CN,ou=Centralized,dc=automotive,dc=ald,dc=socgen"

获取组成员:

Get-ADGroupMember -identity "GROUPNAME" -Recursive | Get-ADUser -Property DisplayName | Select Name,ObjectClass,DisplayName,SamAccountName,mail

常用属性:

SamAccountName登录名

Displayname显示名称 …

more ...

PST 文件损坏

可以使用 SCANPST.exe 进行修复。

可以在C:\Program Files (x86)\Microsoft Office\Office15
找到,直接运行
image1

选择出错的PST 文件

不过通常修复时间需要4个小时左右

more ...

Powershell 更新指定语言的help文档

因为本身的操作系统是英文的

image1

可以看到界面CurrentUICulture : en-US为英语

参考微软的文档:

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/update-help?view=powershell-5.1

要使用中文的,可以 …

more ...

Outlook 无法打开超链接

今天打开outlook中的链接出现如下提示:

image1

修改注册表:定位到HKEY_CURRENT_USER\Software\Classes\.html。在默认项上点右键,选择修改,将Htmlfile粘贴到输入框,点确定。然后点退出。重新打开office

原因:卸载了之 …

more ...

Firefox 提示:此链接不安全,信息可能被盗取

Date 2017-10-16(Mon) By terry Category Work.

image1

Firefox 打开https 链接时会提示,此"链接不安全",有时候会直接造成部分网页无法开。

我们可以选择关闭安全警告提示

  1. 打开firefox 配置 …
more ...

Word发布博客

Date 2017-10-13(Fri) By terry Category Work.
  1. image1
  2. image2
  3. 点击注册,选择"WordPress"
  4. image3
  5. 点击发布
more ...