Skip to content

Instantly share code, notes, and snippets.

View zeruns's full-sized avatar

zeruns zeruns

View GitHub Profile
@zeruns
zeruns / Python计算字符串或文件的MD5或SHA的值.py
Created August 4, 2020 09:54
Python calculates the MD5/SHA value of a string or file
# Python计算字符串或文件的MD5/SHA值
import time
import os
import hashlib
# 计算文件的MD5/SHA值
def file(path, algorithm):
global start, end # 声明全局变量
start = time.time() # 获取当前时间,用于记录计算过程的耗时
@zeruns
zeruns / tcp.sh
Created July 12, 2020 12:47
bbr一键安装脚本
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================
# System Required: CentOS 6/7,Debian 8/9,Ubuntu 16+
# Description: BBR+BBR魔改版+BBRplus+Lotserver
# Version: 1.3.2
# Author: 千影,cx9208
# Blog: https://www.94ish.me/
@zeruns
zeruns / Python多种方法求某个范围内的所有素数.py
Last active January 28, 2020 14:53
Python多种方法求某个范围内的所有素数
#方法1
def primeNUM(min,max):
if min==1:
print('')
min += 1
for i in range(min, max+1):
for j in range(2, i + 1):
if i % j == 0: #判断i能不能被整除
break #退出for循环
if j == i: #若j等于i,说明i是素数