MXOXW

Life always finds a way.

EFB使用webhook模式

| Comments

添加配置

1
2
3
4
5
6
7
eh_telegram_master = {
"flag": {
"webhook_url": "http://example.com",
"port": 5000
},
"token": "12345678:QWFPGJLUYarstdheioZXCVBKM",
...

修改polling_from_tg

1
2
3
4
5
6
7
8
9
10
11
12
13
# self.bot.start_polling(timeout=10)
webhook_url = self._flag('webhook_url', '')
port = self._flag('port', 80)
if webhook_url != '':
token = getattr(config, self.channel_id)['token']
if not webhook_url.endswith('/'):
webhook_url += '/'
webhook_url += token
self.bot.start_webhook('127.0.0.1', port, token)
self.bot.bot.setWebhook(webhook_url=webhook_url)
# self.logger.critical("webhook_url: %s" % webhook_url)
else:
self.bot.start_polling(timeout=10)

修改nginx配置

转发回调请求到http://127.0.0.1:5000

bandwagonhost vps

| Comments

6.38%优惠码:BWH34QMFYT2R
力度还是不错的。

aff链接
镜像站链接

现在的搬瓦工,只有KVM类型的VPS了。而且性价比方面比之前低了。
但相对来说,线路方面还是不错了。现在开始走高端路线,一些促销的VPS在使用上,数据中心选择空间相对少一些。

git多账户

| Comments

1
2
3
ssh-keygen -t rsa -C "[email protected]"    // 添加key

Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): XXX //修改默认名称

.ssh目录添加config文件
修改内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Host *.a.com
IdentityFile ~/.ssh/id_rsa
User WWW

Host github.com
IdentityFile ~/.ssh/github
User YYY

Host git.coding.net
IdentityFile ~/.ssh/coding
User XXX

// Host github2
// HostName github.com
// IdentityFile ~/.ssh/github
// User YYY
// 使用方式:
// git clone github2:YYY/Mywork.git
// git clone git@github2:YYY/Mywork.git

参考:

http://www.cnblogs.com/BeginMan/p/3548139.html
http://www.tuicool.com/articles/7nMBVf