This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Explanation at | |
https://drive.google.com/open?id=1gDRoulcbWfh-T6KBLwvV8g_xb7dT3Erx | |
''' | |
from sage.all import * | |
mod = 2**128 | |
h0 = 144066263297769815596495629667062367629 | |
g = 2**88 + 315 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [7]: re.findall(r'(?i)yes', "Yes,yeS,yes") | |
Out[7]: ['Yes', 'yeS', 'yes'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding: utf-8 | |
from __future__ import print_function | |
import sys,os | |
#declare -A lcasekey | |
lcasekey = {} | |
#declare -A ucasekey | |
ucasekey = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import re | |
img_ = cv2.imread('./mistery_picture.bmp') | |
mi_ = ''.join([str(x) for x in (img_ % 2).reshape(-1)]) | |
for off_ in range(8): | |
mi_1 = mi_[off_:] | |
xxx = (''.join([chr(int(mi_1[8*i:8*(i+1)][::-1], 2)) for i in range(len(mi_1) // 8)])) | |
print(re.findall('(Iron[\s\S]{,66})', xxx)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: import numpy as np | |
In [2]: arr = np.array([1,2,3,4,5,6]) | |
In [3]: arr = arr.reshape(2,1,3) | |
In [4]: arr | |
Out[4]: | |
array([[[1, 2, 3]], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_img_name(img_dir, format="jpg"): | |
""" | |
获取文件夹下format格式的文件名 | |
:param img_dir: str | |
:param format: str | |
:return: list | |
""" | |
file_names = os.listdir(img_dir) # 列出当前目录下所有文件 | |
# 使用 list(filter(lambda())) 筛选出 jpg 后缀的文件 | |
img_names = list(filter(lambda x: x.endswith(format), file_names)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 调用join表示自身优先执行 | |
import threading | |
#定义线程要调用的方法,*add可接收多个以非关键字方式传入的参数 | |
def action(*add): | |
for arc in add: | |
#调用 getName() 方法获取当前执行该程序的线程名 | |
print(threading.current_thread().getName() +" "+ arc) | |
#定义为线程方法传入的参数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
pool = ThreadPoolExecutor(3) | |
task_list = set() | |
targets = [ | |
'http://xxx', | |
'http://xxx', | |
'http://xxx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 更新源 | |
yum update -y | |
yum upgrade -y | |
yum install glibc.i686 libstdc++.i686 libcurl.i686 vim screen -y | |
useradd steam | |
su steam | |
cd ~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useradd steam | |
passwd steam | |
# 修改 /etc/sudoers 文件 | |
chmod u+w /etc/sudoers | |
''' | |
即执行:vi /etc/sudoers |
OlderNewer