sudo systemctl disable vsftpd.service
sudo systemctl disable redis-server.service
sudo systemctl disable privoxy.service
sudo systemctl disable mysql.service
sudo systemctl disable mongodb.service
sudo systemctl disable memcached.service
sudo systemctl disable docker.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| from sqlalchemy import * | |
| from sqlalchemy.orm import create_session | |
| from sqlalchemy.ext.declarative import declarative_base | |
| Base = declarative_base() | |
| engine = \ | |
| create_engine("postgresql://...") | |
| metadata = MetaData(bind=engine) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a = u'中国' | |
| print repr(a) # u'\u4e2d\u56fd' | |
| b = '\u4e2d\u56fd' | |
| print b.decode('raw_unicode_escape') # 中国 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('CHARS_D', '0123456789'); | |
| define('CHARS_LL', 'abcdefghijklmnopqrstuvwxyz'); | |
| define('CHARS_LU', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'); | |
| define('CHARS_L', CHARS_LL . CHARS_LU); | |
| define('CHARS_COMMON', CHARS_D . CHARS_L); | |
| function gen_random_str($length = 3, $chars = null) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import logging | |
| import time | |
| import types | |
| from tornado import ioloop | |
| logging.basicConfig(level=logging.DEBUG, format='%(asctime)s [%(levelname)s] %(message)s') | |
| DEFAULT_TIMEOUT = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import txaio | |
| txaio.start_logging(level='debug') | |
| from twisted.python import log | |
| observer = log.PythonLoggingObserver(loggerName=__name__) | |
| observer.start() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| logging.basicConfig(level=logging.INFO, | |
| format='%(asctime)s [%(levelname)s] %(message)s, %(module)s:%(lineno)d', | |
| datefmt='%Y/%m/%d %H:%M:%S') | |
| LOG = logging.getLogger(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 获取/设置《Fatkun图片批量下载》的设置 | |
| * 作者:胡昂 | |
| */ | |
| (function(){ | |
| var keys = [ | |
| 'savePathType', 'fixedName', | |
| 'min_height', 'min_width', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
Github Todo
- hello
- world
hello world
NewerOlder