bat 中启动进程并隐藏窗口

这几天在将产品移植到 Windows 过程中需要需要启动很多服务进程, 但是需要这么多 console 窗口很难看,所以需要在启动的过程中隐藏 console 窗口,后来在 stackoverflow 上找到了cmdow 这个东东(关键协议还是 MIT),可以通过一下方式启动进程并隐藏窗口。

1
cmdow /run /hid <process_to_start>

Mac OS X下安装gevent

(请确保xcode command line tools已经安装)

直接使用 =pip install= 会出现 =event.h= 找不到:

1
2
3
4
5
6
7
   clang: warning: argument unused during compilation: '-mno-fused-madd'
    In file included from gevent/core.c:253:
    gevent/libevent.h:9:10: fatal error: 'event.h' file not found
    #include "event.h"
             ^
    1 error generated.
    error: command 'clang' failed with exit status 1

这个时候需要安装 =libevent=:

1
brew install libevent

然后安装 =gevent=

1
sudo pip install gevent

安装成功之后,测试一下发现会出错:

1
2
3
4
5
>>> import gevent
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/gevent/__init__.py", line 40, in <module>
ImportError: cannot import name core

原来是因为没有安装 =cython=, 安装之

1
sudo pip install cython

并重新安装 =greenlet= 和 =gevent=

1
2
3
4
sudo pip uninstall gevent
sudo pip uninstall greenlet
sudo pip install greenlet
sudo pip install gevent

用travis-ci自动生成hexo

测试一下

感谢jkeylu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Deploy hexo site by travis-ci
# https://github.com/jkeylu/deploy-hexo-site-by-travis-ci
# LICENSE: MIT
#
# 1. Copy this file to the root of your repository, then rename it to '.travis.yml'
# 2. Replace 'YOUR NAME' and 'YOUR EMAIL' at line 29
# 3. Add an Environment Variable 'DEPLOY_REPO'
#     1. Generate github access token on https://github.com/settings/applications#personal-access-tokens
#     2. Add an Environment Variable on https://travis-ci.org/{github username}/{repository name}/settings/env_vars
#         Variable Name: DEPLOY_REPO
#         Variable Value: https://{githb access token}@github.com/{github username}/{repository name}.git 
#         Example: DEPLOY_REPO=https://6b75cfe9836f56e6d21187622730889874476c23@github.com/jkeylu/test-hexo-on-travis-ci.git

language: node_js

node_js:
- 0.1

branches:
  only:
  - master

before_install:
- npm install -g hexo

install:
- npm install

# Notice: Replace 'YOUR NAME' and 'YOUR EMAIL'
before_script:
- git config --global user.name 'Chen, Zai-Chun'
- git config --global user.email 'chenzaichun@gmail.com'
# - git clone git://github.com/heroicyang/hexo-theme-modernist.git themes/modernist

script:
- hexo generate

after_success:
- mkdir .deploy
- cd .deploy
- git clone --depth 1 --branch master --single-branch $DEPLOY_REPO . || (git init && git remote add -t master origin $DEPLOY_REPO)
- rm -rf ./*
- cp -r ../public/* .
- git add -A .
- git commit -m 'Site updated'
- git branch -m master
- git push -q -u origin master

是不是很简单