http://www.virtualbox.org/wiki/Downloads
wget http://files.vagrantup.com/packages/476b19a9e5f499b5d0b9d4aba5c0b16ebe434311/vagrant_i686.deb
vi ~/.bashrc PATH=$PATH:/opt/vagrant/bin
| #!/usr/bin/env python | |
| # -*- encoding: utf-8 -*- | |
| # Created on 2015-10-21 10:27:30 | |
| # Project: douban_zufang | |
| import re | |
| from pyspider.libs.base_handler import * | |
| class Handler(BaseHandler): |
| { counters: | |
| { 'statsd.bad_lines_seen': 3, | |
| 'statsd.packets_received': 17, | |
| 'window.performance.navigation.redirectCount': 0, | |
| 'window.performance.navigation.type.navigate': 1 }, | |
| timers: | |
| { 'view.listing.views.list_view.GET': [ 1993 ], | |
| 'view.listing.views.GET': [ 1993 ], | |
| 'view.GET': [ 1993 ], | |
| 'window.performance.timing.domComplete': [ 7273 ], |
| <?php | |
| /** | |
| * A simple PHP web scraper | |
| * >> php -f scraper.php | |
| */ | |
| //echo "Hello World!"; | |
| /** | |
| * Fire a get request |
| <html> | |
| <head> | |
| <script type="text/javascript"> | |
| var adQueue = []; | |
| var OA_show = function(position, output) { | |
| // queue the function call and create a place holder | |
| adQueue.push([position, output]); | |
| document.write("<div id='_"+position+"'></div>"); | |
| } | |
| </script> |
| def export(request, **kwargs): | |
| qs = get_queryset(**kwargs) | |
| response = HttpResponse(mimetype='text/csv') | |
| response['Content-Disposition'] = 'attachment; filename=foo.csv' | |
| writer = csv.writer(response, dialect=csv.excel) | |
| for i in qs: | |
| writer.writerow([i.foo, i.bar, i.baz, ...]) |
| #!/usr/bin/env python | |
| _alphabet = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789" | |
| _base = len(_alphabet) | |
| def encode(n): | |
| """ | |
| Encode a number using the alphabet above |
| if timeout: | |
| cache_key = learn_cache_key(request, response, timeout, self.key_prefix, cache=self.cache) | |
| # Ensure the template is literally rendered. Cause if you are using TemplateResponse. The rendering doesn't happen | |
| # Until it reach the bottom of response middleware | |
| # Actually it happens in django wsgi handler which lives at django/core/handlers/base.py | |
| if hasattr(response, 'render') and callable(response.render): | |
| response.add_post_render_callback( | |
| lambda r: self.cache.set(cache_key, r, timeout) | |
| ) | |
| else: |
http://www.virtualbox.org/wiki/Downloads
wget http://files.vagrantup.com/packages/476b19a9e5f499b5d0b9d4aba5c0b16ebe434311/vagrant_i686.deb
vi ~/.bashrc PATH=$PATH:/opt/vagrant/bin
| export VENV=$VIRTUAL_ENV | |
| mkdir $VENV/packages && cd $VENV/packages | |
| curl -O http://oligarchy.co.uk/xapian/1.2.8/xapian-core-1.2.8.tar.gz | |
| curl -O http://oligarchy.co.uk/xapian/1.2.8/xapian-bindings-1.2.8.tar.gz | |
| tar xzvf xapian-core-1.2.8.tar.gz | |
| tar xzvf xapian-bindings-1.2.8.tar.gz | |
| cd $VENV/packages/xapian-core-1.2.8 |
| # django-markitup settings | |
| # The MARKITUP_FILTER setting defines how markup is transformed into HTML on your site. | |
| # This setting is only required if you are using MarkupField or MarkItUp! AJAX preview. | |
| MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': False, 'enable_attributes': True}) | |
| # MarkItUp! allows the toolbar button-set to be customized in a Javascript settings file. | |
| MARKITUP_SET = 'markitup/sets/markdown' | |
| # MarkItUp! skins can be specified in a similar manner. |