通过wget实现静态页面的拷贝

需求

我是看到tango with django的1.7版本经常国内访问不到,而自己又需要参考来编程,所以,自己先把网页拷贝下来,已备以后使用。

如何做?

由于tangowithdjango这本书都是静态页面

可以通过wget的命令把别人的整个网页copy过来。而我自己本身有一个nginx的服务器跑着,所以只需要下载相应的网址到我的主机就是了。

步骤

  1. 在VPS的终端中输入:

sudo wget -r –no-parent http://www.tangowithdjango.com/book17/

http://www.tangowithdjango.com/book17/ 是1.7版本的URI

-r代表递归,所以就是说这个URI中的所有资源都需要wget下来;平时需要慎用此命令。

–no-parent代表不要追溯到父目录

  1. 如果有VPS, 将文件夹的owner改为www-data(nginx), www(apache)

另外记得把网址更改了。

log

在发起wget命令之后,VPS会自动递归获取http://www.tangowithdjango.com/book17/此文件夹中的文件。   –2016-05-14 03:31:32–  http://www.tangowithdjango.com/book17/ Resolving www.tangowithdjango.com (www.tangowithdjango.com)… 50.19.109.98 Connecting to www.tangowithdjango.com (www.tangowithdjango.com)|50.19.109.98|:80… connected. HTTP request sent, awaiting response… 200 OK Length: 44861 (44K) [text/html] Saving to: ‘www.tangowithdjango.com/book17/index.html’   100%[======================================>] 44,861      –.-K/s   in 0.1s       2016-05-14 03:31:32 (335 KB/s) – ‘www.tangowithdjango.com/book17/index.html’ saved [44861/44861] …… –2016-05-14 03:31:32–  http://www.tangowithdjango.com/book17/_static/pygments.css Reusing existing connection to www.tangowithdjango.com:80. HTTP request sent, awaiting response… 200 OK Length: 3932 (3.8K) [text/css] Saving to: ‘www.tangowithdjango.com/book17/_static/pygments.css’   100%[======================================>] 3,932       –.-K/s   in 0s         2016-05-14 03:31:32 (661 MB/s) – ‘www.tangowithdjango.com/book17/_static/pygments.css’ saved [3932/3932] ……

Reference

http://linuxtools-rst.readthedocs.io/zh_CN/latest/tool/wget.html

https://www.quora.com/Where-can-I-download-Tango-with-Django

http://www.tangowithdjango.com/book17/

Supervisord不能够启动进程的问题

今天在启动某应用的时候,发现supervisord会报错「spawn error」,开始以为是进程问题,后面直接通过python启动时发现没有问题,所以锁定应该是supervisord的问题,经过查supervisord的配置文件/etc/supervisord.conf,查到配置文件地址在/tmp,所以去/tmp看日志

看报错

root@localhost:/tmp# more ss-manyuser-stderr---supervisor-BLAHBLAH.log 
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned
supervisor: couldn't setuid to 0: Can't drop privilege as nonroot user
supervisor: child process was not spawned

分析

可能是没有权限,查阅google,得到同样的答案。

所以,将配置文件的user改为root

[supervisord] user=root

善后

注意在启动supervisord的时候,需要加上-c /etc/supervisord.conf指定配置文件地址。同样的,如果需要开机启动,/etc/rc.local中也需要加上。

TMF Frameworx初探

TMF Frameworx初探

Frameworx是a collection of frameworks的简称,包含了eTOM, SID, TAM, Integration Framework.

三大Framework(eTOM, SID, TAM)中的每个framework均有7个domain。这样在进行Frameworks mapping的时候很有用。

各个Framework的名称和含义

TMF定义的frameworks主要有三大金刚:

  1. The Business Process Framework(eTOM/BPF)

    与BP相关的framework。定义电信领域的业务的流程与parties,与BPMN有关。BPF的core process是lvl2的process。而lvl3, lvl4的process都属于task process。

  2. The Information Framework(SID/InfF)

    定义了信息存储的方式,可以理解为数据库的定义。消除vendor和carrier之间的信息鸿沟。

    基本概念有Business Entity,例如customer就是一个BE,而跟customer相关的account, credit profiles等等,可以合起来组成一个ABEAggregated Business Entity

  3. The Application Framework(TAM/AF)

    理解为功能的定义。如何将电信领域的商业流程,转换为可以实现的业务流程,是TAM需要关心的。同时对于vendor,这个跟产品的functions最能够对应上。

Frameworks之间的联系

  1. 三大Framework中的每个framework均有7个domain。并且三大frameworks的七个domain都是一样的,这样定义了电信领域涉及到的具体领域。
  • Market/Sales
  • Product
  • Customer
  • Service
  • Resource
  • Engaged_Party
  • Enterprise
  1. 三大Framework需要通过Integration Framework结合起来。
  2. Frameworx之间的mapping关系很重要
  3. 在建立好模型之后,还需要用参数度量。参数分为3个domains: Revenue and Margin(RM), Customer Experience(CE), Operational Efficiency(OE). 针对5种不同的Process:General(G), Customer Management(CM), Fulfillment(F), Assurance(A), Billing(B).