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| """ | |
| S3 Uploader for Python 3 | |
| Colton J. Provias | |
| Usage: | |
| f = open('sample.png', 'rb') | |
| contents = f.read() | |
| response, url = upload_to_s3('AWSKEY', 'AWSSECRET', 'mybucket', 'image.png', contents, 'image/png') | |
| """ |
| { | |
| {I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It | |
| is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as | |
| you did, the {internet|net|web} will be {much more|a lot more} | |
| useful than ever before.| | |
| I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!| | |
| {I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} | |
| your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any? | |
| {Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe. | |
| Thanks.| |
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| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| WSGI middleware to record requests and responses. | |
| """ | |
| from __future__ import print_function, unicode_literals | |
| import logging |
| import gi | |
| gi.require_version('Gst', '1.0') | |
| from gi.repository import GObject, Gst | |
| Gst.debug_set_active(True) | |
| Gst.debug_set_default_threshold(3) | |
| GObject.threads_init() | |
| Gst.init(None) |
This object is available since 7.5.3. It permits to specify parameters for the main message queue. Note that only queue-parameters are permitted for this config object. This permits to set the same options like in ruleset and action queues. A special statement is needed for the main queue, because it is a different object and cannot be configured via any other object.
Note that when the main_queue() object is configured, the legacy $MainMsgQ... statements are ignored.
main_queue(
queue.size="100000" # how many messages (messages, not bytes!) to hold in memory
queue.type="LinkedList" # allocate memory dynamically for the queue. Better for handling spikes
| from decorator import decorator | |
| from line_profiler import LineProfiler | |
| @decorator | |
| def profile_each_line(func, *args, **kwargs): | |
| profiler = LineProfiler() | |
| profiled_func = profiler(func) | |
| try: | |
| profiled_func(*args, **kwargs) | |
| finally: |
| #!/bin/bash | |
| # | |
| # git-mv-with-history -- move/rename file or folder, with history. | |
| # | |
| # Moving a file in git doesn't track history, so the purpose of this | |
| # utility is best explained from the kernel wiki: | |
| # | |
| # Git has a rename command git mv, but that is just for convenience. | |
| # The effect is indistinguishable from removing the file and adding another | |
| # with different name and the same content. |
| from scrapy.selector import HtmlXPathSelector | |
| from scrapy.spider import BaseSpider | |
| from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
| from scrapy.utils.url import urljoin_rfc | |
| from scrapy.http import Request | |
| class MySpider(BaseSpider): | |
| name = ’test’ | |
| allowed_domains = [’xxxx.com’] | |
| start_urls = [ |
| # current tty's PIDs | |
| ps -fu `whoami` | grep 'pts/`tty | cut -d/ -f4`' | |
| # capture ip traffic | |
| ngrep -q -d any -W none ip | |
| # mitm proxy | |
| socat -v TCP-LISTEN:<port>,fork TCP:localhost:<port> | |
| # reverse tunnel |