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
129.24.51.99 21320 | |
24.158.231.6 80 | |
54.161.139.184 5555 | |
46.38.166.124 80 | |
192.121.107.107 80 | |
177.91.192.116 8080 | |
1.0.138.14 8080 | |
107.150.29.157 3128 | |
98.145.71.245 21320 | |
68.195.17.204 21320 |
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
// ==UserScript== | |
// @name 找券 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http*://item.taobao.com/item.htm* | |
// @match http*://detail.tmall.com/item.htm* | |
// @require https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js | |
// @grant GM_xmlhttpRequest |
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 is_leap_year1(y): | |
return (y % 4 == 0 and y % 100 != 0) or (y % 400 == 0) | |
def is_leap_year2(y): | |
return (y % 400 == 0) or (y % 4 == 0 and y % 100 != 0) | |
def is_leap_year3(y): | |
return (y % 4 == 0) and (y % 400 == 0 or y % 100 != 0) |
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
#coding:utf8 | |
def is_leap_year(y): | |
"""闰年判断 这样最快""" | |
return (y % 4 == 0) and (y % 100 != 0 or y % 400 == 0) | |
def leap_count(year): | |
"""从0年开始的闰年数量(不包含0年)""" | |
return year // 4 - year // 100 + year // 400 |
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
#coding:utf8 | |
import sys | |
## prepare | |
d_arr = ( | |
(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31), | |
(0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31) | |
) | |
ds_arr = ( | |
(None, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365), |
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
FROM python:2-alpine | |
RUN sed -i "s|dl-cdn.alpinelinux.org|mirrors.tuna.tsinghua.edu.cn|g" /etc/apk/repositories && \ | |
apk add -U tzdata && \ | |
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && \ | |
apk add -U -t xxbuild gcc g++ musl-dev | |
ADD requirements.txt /tmp/requirements.txt | |
RUN pip install --no-cache-dir -r /tmp/requirements.txt | |
RUN apk del xxbuild | |
ADD app.py /code/main.py |
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
package main | |
import ( | |
"context" | |
"io" | |
"os" | |
"github.com/docker/docker/api/types" | |
"github.com/docker/docker/api/types/container" | |
"github.com/docker/docker/api/types/mount" |
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
latestkernel=`ls -t /boot/vmlinuz-* | sed "s/\/boot\/vmlinuz-//g" | head -n1` | |
echo $latestkernel | |
kexec -l /boot/vmlinuz-${latestkernel} --initrd=/boot/initramfs-${latestkernel}.img --append="`cat /proc/cmdline`" | |
kexec -e | |
# 备注,其实和重启没啥两样, uptime也会清零重算,唯一的好处就是比重启要快一点点 | |
# remove old kernels on centos 8 | |
dnf remove --oldinstallonly --setopt installonly_limit=1 kernel |
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
package main | |
import ( | |
"path" | |
"github.com/gin-gonic/gin" | |
) | |
type oauthApp struct { | |
Prefix string |
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
FROM python:3.8.1-slim | |
ADD ./requirements.txt /tmp/requirements.txt | |
RUN set -xe \ | |
&& pip install -i https://mirrors.aliyun.com/pypi/simple --no-cache -r /tmp/requirements.txt | |
ADD app.py /code/app.py | |
WORKDIR /code | |
CMD ["gunicorn", "-w4", "-b0.0.0.0:8000", "app:app"] |
OlderNewer