zzp's blog


  • 首页

  • 分类

  • 归档

  • 搜索

ipv6-windows10-无网络权限

置顶 | 发表于 2019-11-05 | 分类于 windows | 阅读次数

校园网IPV6, windows10无法自动登录,显示无网络权限

问题:校园网IPV6, windows10无法自动登录,显示无网络权限

(可能原因:动态ipv6分配与网络账号登陆的不一致性)

网上的解决方法包括命令行,官方脚本,修改注册表,通通无用

手动重新勾选网络适配器中的ipv6协议可以解决此问题

自动脚本

enable_ipv6.ps1

1
2
3
Disable-NetAdapterBinding -Name Wi-Fi -ComponentID ms_tcpip6

Enable-NetAdapterBinding -Name Wi-Fi -ComponentID ms_tcpip6

enable_ipv6.bat

1
2
3
cd C:\xxx\
PowerShell.exe -ExecutionPolicy Bypass -file enable-ipv6.ps1
pause

此外由于权限问题,可以通过新建bat脚本的快捷方式,并修改为管理员权限执行即可解决

linux tools

置顶 | 发表于 2018-09-12 | 分类于 linux | 阅读次数

trash-cli

1
sudo apt install trash-cli

Usage

1
2
3
4
5
6
#alias rm!="/bin/rm -vi"
#alias rm=trash
alias t=trash
alias lt=trash-list
alias rt=restore-trash
alias et=trash-empty
命令 用途
trash-put/trash 文件或目录移入回收站
trash-empty 清空回收站
trash-list 列出回收站中的文件
restore-trash 还原回收站中的文件
trash-rm 删除回收站中的单个文件
阅读全文 »

bridge-photo-downloader-save-settings

发表于 2020-05-19 | 阅读次数

Bridge2020 10.0.4.xxx 相机图片下载器导出设置无法保存

解决方法,新建如下文件夹:
C:\Users\xxx\AppData\Roaming\Adobe\Bridge CC 2019

然后导出成功一次之后,导出设置会自动保存在上述文件夹的APDPreferences.xml文件中

ffmpeg

发表于 2020-05-13 | 阅读次数

简单的合并相同长度的音频和视频

ffmpeg -i audio1.mp4 -i video.mp4 -vcodec copy -acodec copy out.mp4

m3u8-firefix-windows

发表于 2020-05-09 | 分类于 windows | 阅读次数

windows10上访问手机浏览器可以访问的m3u8视频的方法

下载插件:

  1. HLS.js Playback
  2. User-Agent Switcher and Manager

虽然显示缺乏视频支持格式等问题而不能直接播放,

但可以直接复制m3u8链接到新窗口即可播放视频

wsl-备份与导入

发表于 2020-05-01 | 分类于 windows | 阅读次数

wsl备份

wsl --export Ubuntu wsl.tar

wsl导入

wsl --import Ubuntu c:\wsl path\wsl.tar

requests-socks5

发表于 2020-01-03 | 分类于 python | 阅读次数

Example 1

pip install requesocks

import requests

session = requests.session()
session.proxies = {‘http’: ‘socks5://127.0.0.1:9050’,
‘https’: ‘socks5://127.0.0.1:9050’}
resp = session.get(‘https://api.github.com', auth=(‘user’, ‘pass’))
print(resp.status_code)
print(resp.headers[‘content-type’])
print(resp.text)

Python (Python-3.X) library for connection via SOCKS5-proxy

Example 2

PySocks

pip install PySocks

import socket
import socks
import requests

socks.set_default_proxy(socks.SOCKS5, “127.0.0.1”, 9050)
socket.socket = socks.socksocket
print(requests.get(‘http://ifconfig.me/ip').text)

windows-report

发表于 2019-10-29 | 分类于 windows | 阅读次数

win+R

检查windows错误
rundll32.exe werconcpl.dll,LaunchErcApp -updatecheck

查看windows错误详情
control.exe /name Microsoft.ActionCenter /page pageSignoff

win+R, cmd

wifi报告(管理员)
netsh wlan show wlanreport

电池报告
powercfg /batteryreport

gas-station

发表于 2019-05-31 | 分类于 algorithm , leetcode | 阅读次数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
https://leetcode.com/problems/gas-station/

Input:
gas = [1,2,3,4,5]
cost = [3,4,5,1,2]

Output: 3

Explanation:
Start at station 3 (index 3) and fill up with 4 unit of gas. Your tank = 0 + 4 = 4
Travel to station 4. Your tank = 4 - 1 + 5 = 8
Travel to station 0. Your tank = 8 - 2 + 1 = 7
Travel to station 1. Your tank = 7 - 3 + 2 = 6
Travel to station 2. Your tank = 6 - 4 + 3 = 5
Travel to station 3. The cost is 5. Your gas is just enough to travel back to station 3.
Therefore, return 3 as the starting index.
"""

class Solution:
def canCompleteCircuit(self, gas, cost):

N = len(gas)

def delta(gas, cost):
for i in range(2):
for i, j in zip(gas, cost):
yield i - j
s = 0
start = 0
idx = 0
for d in delta(gas, cost):
s += d
if s < 0:
s = 0
start = idx + 1
else:
if idx - start == N:
return start
idx += 1
return -1

class Solution2:
def canCompleteCircuit(self, gas, cost):

delta = [i-j for i, j in zip(gas, cost)] * 2
s = 0
start = 0
for i in range(len(delta)):
s += delta[i]
if s < 0:
s = 0
start = i + 1
else:
if i - start == len(gas):
return start
return -1


if __name__ == '__main__':
s = Solution()
gas = [1, 2, 3, 4, 5]
cost = [3, 4, 5, 1, 2]
assert s.canCompleteCircuit(gas, cost) == 3

create-maximum-number

发表于 2019-05-31 | 分类于 algorithm , leetcode | 阅读次数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
"""
https://leetcode.com/problems/create-maximum-number/
"""
class Solution(object):
def maxNumber(self, nums1, nums2, k):
"""
:type nums1: List[int]
:type nums2: List[int]
:type k: int
:rtype: List[int]
"""
def getMax(nums, t):
ans = []
size = len(nums)
for x in range(size):
while ans and len(ans) + size - x > t and ans[-1] < nums[x]:
ans.pop()
if len(ans) < t:
ans.append(nums[x])
return ans

# 网上的版本
def merge2(nums1, nums2):
ans = []
while nums1 or nums2:
if nums1 > nums2:
ans.append(nums1[0])
nums1 = nums1[1:]
else:
ans.append(nums2[0])
nums2 = nums2[1:]
return ans

# 修改后更快点的版本,避免了大量数组重写
def merge(nums1, nums2):
if len(nums1) == 0:
return nums2
if len(nums2) == 0:
return nums1
ans = []
i, j = 0, 0
while True:
if nums1[i:] > nums2[j:]:
ans.append(nums1[i])
i += 1
else:
ans.append(nums2[j])
j += 1
if i == len(nums1):
ans.extend(nums2[j:])
break
if j == len(nums2):
ans.extend(nums1[i:])
break
return ans

len1, len2 = len(nums1), len(nums2)
res = []
for x in range(max(0, k - len2), min(k, len1) + 1):
# nums1中选取x个,k>len2时,至少选取k-len2个
tmp = merge(getMax(nums1, x), getMax(nums2, k - x))
res = max(tmp, res)
return res

if __name__ == '__main__':
s = Solution()
nums1 = [3, 4, 6, 5]
nums2 = [9, 1, 2, 5, 8, 3]
k = 5
assert s.maxNumber(nums1, nums2, k) == [9, 8, 6, 5, 3]
nums1 = [6, 7]
nums2 = [6, 0, 4]
k = 5
assert s.maxNumber(nums1, nums2, k) == [6, 7, 6, 0, 4]
nums1 = [3, 9]
nums2 = [8, 9]
k = 3
assert s.maxNumber(nums1, nums2, k) == [9, 8, 9]
nums1 = [8,6,9]
nums2 = [1,7,5]
k = 3
assert s.maxNumber(nums1, nums2, k) == [9, 7, 5]
nums1 = [6,6,8]
nums2 = [5,0,9]
k = 3
assert s.maxNumber(nums1, nums2, k) == [9, 6, 8]
nums1 = [9, 9]
nums2 = [8, 7, 6,5,4]
k = 5
assert s.maxNumber(nums1, nums2, k) == [9, 9, 8, 7, 6]

nums1 = [8,9]
nums2 = [3,9]
k = 3
assert s.maxNumber(nums1, nums2, k) == [9, 8, 9]
nums1 = [2,5,6,4,4,0]
nums2 = [7,3,8,0,6,5,7,6,2]
k = 15
assert s.maxNumber(nums1, nums2, k) == [7,3,8,2,5,6,4,4,0,6,5,7,6,2,0]
12…9
ningning

ningning

86 日志
9 分类
GitHub
© 2018 - 2020 ningning
本站访客数 人次