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| sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan |
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| # snippet is placed into public domain by | |
| # anatoly techtonik <[email protected]> | |
| # http://stackoverflow.com/questions/8151300/ignore-case-in-glob-on-linux | |
| import fnmatch | |
| import os | |
| import re | |
| def findfiles(which, where='.'): |
| #!/bin/bash | |
| export FOO=100 | |
| python - <<END | |
| import os | |
| print "foo:", os.environ['FOO'] | |
| END |
| import StringIO | |
| from flask import Flask, Response | |
| @app.route('/some_dataframe.csv') | |
| def output_dataframe_csv(): | |
| output = StringIO.StringIO() | |
| some_dataframe.to_csv(output) |
| license: gpl-3.0 | |
| redirect: https://observablehq.com/@mbostock/world-tour |
| from celery import chain | |
| from django.core.management.base import BaseCommand | |
| from . import tasks | |
| class Command(BaseCommand): | |
| def handle(self, *args, **kwargs): |
| def bytesto(bytes, to, bsize=1024): | |
| """convert bytes to megabytes, etc. | |
| sample code: | |
| print('mb= ' + str(bytesto(314575262000000, 'm'))) | |
| sample output: | |
| mb= 300002347.946 | |
| """ | |
| a = {'k' : 1, 'm': 2, 'g' : 3, 't' : 4, 'p' : 5, 'e' : 6 } |
| # Unofficial brew formula for proxychains 4 | |
| # Instruction: | |
| # $ git clone git://gist.github.com/3792521.git gist-3792521 | |
| # $ brew install --HEAD gist-3792521/proxychains4_formula.rb | |
| # | |
| # The default config file will be located in /usr/local/etc/proxychains.conf | |
| # | |
| require 'formula' | |
| class Proxychains < Formula |
| #!/bin/sh | |
| setup_brew () { | |
| if ![-f "/usr/local/bin/brew"]; then | |
| /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" | |
| fi | |
| } | |
| setup_ipython () { | |
| brew install readline |