使用公钥私钥来登陆而不是账号密码,公钥私钥需要简单的在本地生成一下。Github 的生成 SSH 公钥私钥的教程:Generating SSH keys
可能需要使用 -i 参数选择一下本地的私钥,一个示例的 ssh 连接如下:
| """ | |
| Python Singleton with parameters (so the same parameters get you the same object) | |
| with support to default arguments and passing arguments as kwargs (but no support for pure kwargs). | |
| And implementation for MongoClient class from pymongo package. | |
| """ | |
| from pymongo import MongoClient | |
| import inspect | |
| # Pass the env-vars to MYCOMMAND | |
| eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
| # … or ... | |
| # Export the vars in .env into your shell: | |
| export $(egrep -v '^#' .env | xargs) |
| from collections import OrderedDict | |
| class OrderedSet: | |
| """ | |
| A set which keeps the ordering of the inserted items. | |
| Currently backs onto OrderedDict. | |
| """ | |
| def __init__(self, iterable=None): |
| #!/usr/bin/env python | |
| from Foundation import NSUserNotification | |
| from Foundation import NSUserNotificationCenter | |
| from Foundation import NSUserNotificationDefaultSoundName | |
| from optparse import OptionParser | |
| def main(): | |
| parser = OptionParser(usage='%prog -t TITLE -m MESSAGE') |
使用公钥私钥来登陆而不是账号密码,公钥私钥需要简单的在本地生成一下。Github 的生成 SSH 公钥私钥的教程:Generating SSH keys
可能需要使用 -i 参数选择一下本地的私钥,一个示例的 ssh 连接如下:
| ## Sublime Text 3 Serial key build is 3103 | |
| —– BEGIN LICENSE —– | |
| Michael Barnes | |
| Single User License | |
| EA7E-821385 | |
| 8A353C41 872A0D5C DF9B2950 AFF6F667 | |
| C458EA6D 8EA3C286 98D1D650 131A97AB | |
| AA919AEC EF20E143 B361B1E7 4C8B7F04 | |
| B085E65E 2F5F5360 8489D422 FB8FC1AA |
| ALTER TABLE xxxxxx | |
| ADD created_at TIMESTAMP DEFAULT '0000-00-00 00:00:00', | |
| ADD updated_at TIMESTAMP DEFAULT '0000-00-00 00:00:00'; | |
| CREATE TRIGGER xxxxxx_create BEFORE INSERT ON `xxxxxx` | |
| FOR EACH ROW SET NEW.created_at = NOW(), NEW.updated_at = NOW(); | |
| CREATE TRIGGER xxxxxx_update BEFORE UPDATE ON `xxxxxx` | |
| FOR EACH ROW SET NEW.updated_at = NOW(), NEW.created_at = OLD.created_at; |
| from pymongo import Connection | |
| class MongoCon(object): | |
| __db = None | |
| @classmethod | |
| def get_connection(cls): | |
| if cls.__db is None: | |
| cls.__db = Connection() | |
| return cls.__db |