Based on:
$ sudo apt-get install python-software-properties
| --type-add=css=.sass,.less,.scss | |
| --type-add=ruby=.rake,.rsel,.builder,.thor | |
| --type-add=html=.haml,.html.erb,.html.haml | |
| --type-add=js=.js.erb,.coffee | |
| --type-set=cucumber=.feature | |
| --type-set=c=.c,.cpp,.ino,.pde,.h | |
| --ignore-dir=vendor | |
| --ignore-dir=log | |
| --ignore-dir=tmp | |
| --ignore-dir=doc |
Based on:
$ sudo apt-get install python-software-properties
| from multiprocessing.process import Process | |
| import time | |
| import redis | |
| def pub(myredis): | |
| for n in range(10): | |
| myredis.publish('channel','blah %d' % n) | |
| time.sleep(5) | |
| def sub(myredis, name): |
| import uwsgi | |
| from uwsgidecorators import timer | |
| from django.utils import autoreload | |
| @timer(3) | |
| def change_code_gracefull_reload(sig): | |
| if autoreload.code_changed(): | |
| uwsgi.reload() |
| # Reference: http://www.gentoo.org/doc/zh_cn/gentoo-x86-quickinstall.xml | |
| ########################################################################## | |
| ##### part 1: boot with gentoo minimal ##### | |
| # boot | |
| gentoo | |
| # config network | |
| net-setup eth0 | |
| ifconfig |
| _bundler_complete() | |
| { | |
| if [[ ! `which bundle` ]]; then | |
| return | |
| fi | |
| local cur prev commands | |
| commands="help install update package exec config check list show outdated console open viz init gem platform" | |
| cur="${COMP_WORDS[COMP_CWORD]}" | |
| prev="${COMP_WORDS[COMP_CWORD-1]}" |
| # admin.py: admin action definition | |
| def make_copy(self, request, queryset): | |
| form = None | |
| if 'apply' in request.POST: | |
| form = CopyPageForm(request.POST) | |
| if form.is_valid(): | |
| issue = form.cleaned_data['issue'] |
| *.tex diff=tex | |
| *.bib diff=bibtex | |
| *.c diff=cpp | |
| *.h diff=cpp | |
| *.c++ diff=cpp | |
| *.h++ diff=cpp | |
| *.cpp diff=cpp | |
| *.hpp diff=cpp | |
| *.cc diff=cpp | |
| *.hh diff=cpp |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000