Skip to content

Instantly share code, notes, and snippets.

View laixintao's full-sized avatar
📟
I live in the terminal.

laixintao

📟
I live in the terminal.
View GitHub Profile
# -*- coding: utf-8 -*-
from urllib3 import HTTPConnectionPool
pool = HTTPConnectionPool('blog.csdn.net', maxsize=1) # ip: 47.95.47.253
def send_http():
for _ in range(5):
r = pool.request('GET', '/a', redirect=False)
[
{
"id": "feed/http://feeds2.feedburner.com/thenextweb",
"title": "The Next Web",
"website": "https://thenextweb.com",
"categories": [
{
"id": "user/6fcf957b-f267-472c-8167-f61b10d926f0/category/Tech",
"label": "Tech"
}
@laixintao
laixintao / starcounter.js
Created February 11, 2018 05:48 — forked from yyx990803/starcounter.js
Count your total stars!
var https = require('https'),
user = process.argv[2],
opts = parseOpts(process.argv.slice(3))
request('/users/' + user, function (res) {
if (!res.public_repos) {
console.log(res.message)
return
}
var pages = Math.ceil(res.public_repos / 100),
# -*- coding: utf-8 -*-
import threading
import itertools
import time
import sys
class Signal:
go = True
# -*- coding: utf-8 -*-
import signal
import sys
import asyncio
import aiohttp
import json
loop = asyncio.get_event_loop()
client = aiohttp.ClientSession(loop=loop)
# -*- coding: utf-8 -*-
import logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.DEBUG,
filename="tail_log"
)
@laixintao
laixintao / v2ex_count.sh
Created March 8, 2018 09:31
V2EX 帖子数量
curl -s https://www.v2ex.com/ | grep -E -C 2 ">回复</span>" | grep -oE "\d{4,}" | xargs -I {} echo V2EX当前回复数 {}
作者:韦易笑
链接:https://www.zhihu.com/question/27249253/answer/339373732
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
- 永远不要用 CTRL-C 代替 <ESC> 完全不同的含义,容易错误中断正在当前脚本
- 很多人使用 CTRL-[ 代替 <ESC>,左右小指 CTRL,右手小指 [ 熟练后很方便
- SecureCRT 中使用 Vim 8 内嵌终端如看到奇怪字符,使用 :set t_RS= t_SH= 解决
- SecureCRT 中使用 NeoVim 如看到奇怪字符,使用 :set guicursor= 解决
- * 和 # (以及 g*/g#)是十分重要的查找命令
  1. Install Homebrew
  2. brew install postgres
  3. initdb /usr/local/var/postgres
  4. /usr/local/Cellar/postgresql//bin/createuser -s postgres
Symbol Meaning
> Output redirection, (see File Redirection)
>> Output redirection (append)
< Input redirection
* File substitution wildcard; zero or more characters
? File substitution wildcard; one character
[ ] File substitution wildcard; any character between brackets
`cmd` Command Substitution
$(cmd) Command Substitution
| The Pipe (|)