-
遇到一个有趣的C语言习题,题目很好地考察了数据在内存中的存储方式以及函数调用时的stack管理。题目如下:
-
按照之前写的Build A Website With Python and Nginx一文中的方法,在树莓派中搞了一个website,通过ssh反向隧道的方法,将校园网内网中的树莓派与公网中的一台VPS建立ssh连接,并建立反向隧道。将公网80端口映射到树莓派的某端口,从而可以直接从外网访问内网中的树莓派。地址为raspi.hejunjie.net,23:30-6:30由于断电会无法访问。
-
作死買了個樹莓派(Raspberry Pi),宿舍不能用路由器,入手之後就想把它當路由器用。於是買了個USB無線網卡EDUP EP-N8508GS。下面是配置過程
-
Backup your neteasy blog entries to a sqlite3 database.
Only Created time,title and content are stored.
Usage:
neteasy.py <username>
The
<username>
is your blog name which appears in your blog domain. Just like "junjie.blog.163.com", in which "junjie" is the<username>
If everything is normal, the output will be like this:
-
我們使用Nginx作爲前端反向代理服務器,一些靜態資源可以直接通過
Nginx
訪問。對於動態資源,Nginx
將請求轉發到後端的Gunicorn服務器,Gunicorn
負責調用後端的Python
代碼,進行動態處理。上面,我們說道,
nginx
將動態請求轉發到本地的9000
端口,Gunicorn
正是監聽此端口。Nginx
可以直接作爲服務進程啓動,但是Gunicorn
還不行,因此我們使用Supervisor。Supervisor
是一个管理进程的工具,可以随系统启动而启动服务,它还时刻监控服务进程,如果服务进程意外退出,Supervisor可以自动重启服务。同時,我們安裝gevent,它是一個把Python同步代码变成异步协程的库;
-
Assignment statements in Python do not copy objects, they create bindings between a target and an object. For collections that are mutable or contain mutable items, a copy is sometimes needed so one can change one copy without changing the other.