Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import itertools
import collections
import random
def cut(nums, k):
def cut_from_0():
s = 0
for num in nums:
@cainiaocome
cainiaocome / vps_init.sh
Last active August 18, 2020 04:37
vps init
# disable autoupdate
systemctl mask apt*
apt update
wget https://github.com/sharkdp/bat/releases/download/v0.15.4/bat_0.15.4_amd64.deb
dpkg -i bat_0.15.4_amd64.deb
apt-get install -y --no-install-recommends bat ifstat make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
# 批量注册
## 特征
* 业务(hostname)
* 用户名
* 头像
* 昵称
@cainiaocome
cainiaocome / README.md
Created November 11, 2015 05:26 — forked from hwdsl2/.MOVED.md
IPsec L2TP VPN Auto Install Script for Ubuntu 14.04 & 12.04 and Debian 8
#!/usr/bin/env python
"""
A pure Python "ping" implementation, based on a rewrite by Johannes Meyer,
of a script originally by Matthew Dixon Cowles. Which in turn was derived
from "ping.c", distributed in Linux's netkit. The version this was forked
out of can be found here: https://gist.github.com/pklaus/856268
The versions this script derived from are licensed under GPL v2, this makes
mandatory that this is licensed under the same terms as well. If it were up