Skip to content

Instantly share code, notes, and snippets.

PS C:\Program Files\Microsoft Office\Office16> cscript.exe .\OSPP.VBS /dstatus
Microsoft (R) Windows Script Host Version 5.812
版权所有(C) Microsoft Corporation。保留所有权利。
---Processing--------------------------
---------------------------------------
PRODUCT ID: 00413-50000-00000-AA773
SKU ID: 52c4d79f-6e1a-45b7-b479-36b666e0a2f8
LICENSE NAME: Office 19, Office19ProPlus2019R_Grace edition
LICENSE DESCRIPTION: Office 19, RETAIL(Grace) channel
#虚拟机迁移平台之后无法启动进入dracut模式
#光驱启动进入救援模式
#先chroot进入原系统(一般是/mnt/sysimage)然后执行以下命令
initramfs: dracut -v /boot/initramfs-$(uname -r).img $(uname -r)
#然后退出chroot重启即可
@luxin88
luxin88 / huawei
Last active March 11, 2020 10:07
AR1220C-S 使用网页登录管理界面提示 ERR_SSL_SERVER_CERT_BAD_FORMAT
undo http secure-server ssl-policy
@luxin88
luxin88 / generate_dhparam.sh
Created August 30, 2019 01:57
生成dhparam.pem文件
openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096 #常规做法,非常慢
openssl dhparam -dsaparam -out /etc/ssl/certs/dhparam.pem 4096 #这个速度比较快,原因还没有去研究
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyPdf import PdfFileReader, PdfFileWriter
out = PdfFileWriter()
for i in range(1, 165):
src_pdf = u"/path/to/pdfs/" + str(i) + u".pdf"
pdf = PdfFileReader(file(src_pdf, 'rb'))
#!/usr/bin/env python
# -*- coding: utf-8 -*-
with open(fileName, 'wb') as f:
f.write(pdf.content)
@luxin88
luxin88 / postData.py
Created May 3, 2017 02:10
requests post数据
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
allList = []
for i in range(1, 23):
listPayload = dict(action="loadvoteoptionbypage", guid="2cdb51ca-ef8a-f83d-9fc6-28341591d747",
tpldiyfile="viewvotewx.tpl", page=i)
r = requests.post(u'http://m138082.nofollow.ax.mvote.cn/op.php', data=listPayload)
@luxin88
luxin88 / downloadPicture.py
Last active May 3, 2017 01:27
下载链接图片
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
from PIL import Image
from io import BytesIO
url = u'http://grs.a.mvote.net/imgsource/global_AB7481EF-358F-0B95-F2FD-3C43CA06CE94.png'
r = requests.get(url)