This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
| ⌘T | 前往文件 |
| ⌘⌃P | 前往项目 |
| ⌘R | 前往 method |
| ⌘⇧P | 命令提示 |
This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
| ⌘T | 前往文件 |
| ⌘⌃P | 前往项目 |
| ⌘R | 前往 method |
| ⌘⇧P | 命令提示 |
Using Python to check if remote port is open and accessible.
Taken from http://snipplr.com/view/19639/test-if-an-ipport-is-open/
Usage:
| #!/bin/sh | |
| ## | |
| # Install autoconf, automake and libtool smoothly on Mac OS X. | |
| # Newer versions of these libraries are available and may work better on OS X | |
| # | |
| # This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html | |
| # | |
| export build=~/devtools # or wherever you'd like to build |
| # GIT heart FZF | |
| # ------------- | |
| is_in_git_repo() { | |
| git rev-parse HEAD > /dev/null 2>&1 | |
| } | |
| fzf-down() { | |
| fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@" | |
| } |
| import asyncio | |
| import time | |
| def timeit(func): | |
| async def process(func, *args, **params): | |
| if asyncio.iscoroutinefunction(func): | |
| print('this function is a coroutine: {}'.format(func.__name__)) | |
| return await func(*args, **params) | |
| else: |
| 1) Generate RSA key: | |
| $ openssl genrsa -out key.pem 1024 | |
| $ openssl rsa -in key.pem -text -noout | |
| 2) Save public key in pub.pem file: | |
| $ openssl rsa -in key.pem -pubout -out pub.pem | |
| $ openssl rsa -in pub.pem -pubin -text -noout | |
| 3) Encrypt some data: |
| async def main(): | |
| coroutine1 = do_some_work(1) | |
| coroutine2 = do_some_work(2) | |
| coroutine3 = do_some_work(4) | |
| tasks = [ | |
| asyncio.ensure_future(coroutine1), | |
| asyncio.ensure_future(coroutine2), | |
| asyncio.ensure_future(coroutine3) | |
| ] |
| [program:_appname_] | |
| command = /home/_username_/.pyenv/versions/venvname/bin/gunicorn -w 1 -b 127.0.0.1:8000 --pythonpath=. --reload wsgi:application | |
| directory=/home/_username_/sites/_appname_/ | |
| environment=PATH="/home/_username_/.pyenv/versions/venvname/bin:/home/_username_/.pyenv/shims:/home/_username_/.pyenv/bin:",DJANGO_SETTINGS_MODULE="_appname_.settings",HOME="/home/_username_" | |
| user=_username_ | |
| autostart=true | |
| autorestart=true | |
| redirect_stderr=true | |
| stopsignal=QUIT | |
| stderr_logfile=/home/_username_/log/_appname_-stderr.log |