Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
| #!/usr/bin/env python2 | |
| import SimpleHTTPServer | |
| import SocketServer | |
| import logging | |
| PORT = 8000 | |
| class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): |
| #!/bin/bash | |
| hostname=$(hostname) | |
| # Run top twice, first output is cached | |
| top_out=$(top -bn2 -d0.1) | |
| cpu=$(echo "${top_out}" | grep "Cpu(s)" | sed -E "s/.*,\s*([0-9\.]+)\%id.*/\1/" | awk '{print 100 - $1}' | sed -n 2p) | |
| memory_total=$(echo "${top_out}" | grep "Mem:" | awk {'print $2'} | sed s/k// | sed -n 2p) |
| # -*- coding: utf8 -*- | |
| # 下载速度很慢, | |
| import urllib2, urllib | |
| import sys | |
| import os | |
| import socket | |
| import re | |
| import socks |
| #!/usr/bin/env python | |
| """ | |
| How to use it: | |
| 1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID` , The Tornado Web Server Will shutdown after process all the request. | |
| 2. When you run it behind Nginx, it can graceful reboot your production server. | |
| 3. Nice Print in http://weibo.com/1682780325/zgkb7g8k7 | |
| """ |
| def shutdown(graceful=True): | |
| """Shut down the application. | |
| If a graceful stop is requested, waits for all of the IO loop's | |
| handlers to finish before shutting down the rest of the process. | |
| We impose a 10 second timeout. | |
| """ | |
| ioloop = tornado.ioloop.IOLoop.instance() | |
| def final_stop(): |
| RAILS_ENV=production rake db:setup | |
| # produces the error below.....hmmm.....it's a no-worky | |
| psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory | |
| # hstore postgresql extension needs to be installed, so.... | |
| sudo apt-get install postgresql-contrib | |
| # now your extension should be available to enable so log in with psql | |
| psql -d yourproject_production -U yourdbuser -W |
| class ProtocolBufferMixin(object): | |
| """Protocol Buffer support for RequestHandler objects.""" | |
| MIMETYPE = 'application/x-protobuf' | |
| def read_protobuf(self, message_type, data): | |
| """Attempts to parse a protocol buffer message from the given data.""" | |
| # Create the message object and attempt to parse the data into it. | |
| try: | |
| message = message_type() |