- Install Homebrew
- brew install postgres
- initdb /usr/local/var/postgres
- /usr/local/Cellar/postgresql//bin/createuser -s postgres
This file contains hidden or 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: 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) |
This file contains hidden or 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
[ | |
{ | |
"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" | |
} |
This file contains hidden or 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
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), |
This file contains hidden or 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: utf-8 -*- | |
import threading | |
import itertools | |
import time | |
import sys | |
class Signal: | |
go = True |
This file contains hidden or 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: utf-8 -*- | |
import signal | |
import sys | |
import asyncio | |
import aiohttp | |
import json | |
loop = asyncio.get_event_loop() | |
client = aiohttp.ClientSession(loop=loop) |
This file contains hidden or 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: utf-8 -*- | |
import logging | |
logging.basicConfig( | |
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', | |
level=logging.DEBUG, | |
filename="tail_log" | |
) |
This file contains hidden or 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
curl -s https://www.v2ex.com/ | grep -E -C 2 ">回复</span>" | grep -oE "\d{4,}" | xargs -I {} echo V2EX当前回复数 {} |
This file contains hidden or 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
作者:韦易笑 | |
链接: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#)是十分重要的查找命令 |
This file contains hidden or 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
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 (|) |