Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)| import java.util.*; | |
| import java.io.*; | |
| import java.security.*; | |
| public class ChangePassword | |
| { | |
| private final static JKS j = new JKS(); | |
| public static void main(String[] args) throws Exception | |
| { |
| #!/usr/bin/env perl | |
| use Mojolicious::Lite; | |
| use Mojo::JSON 'j'; | |
| use Mojo::Asset::Memory; | |
| use File::Spec; | |
| helper send_ready_signal => sub { | |
| my $self = shift; | |
| my $payload = { ready => \1 }; |
| #!/usr/bin/env perl | |
| # | |
| # htpasswd.pl | |
| # | |
| # Copyright (c) 2013, Gelu Lupas <[email protected]> | |
| # | |
| # Permission to use, copy, modify, and/or distribute this software for any | |
| # purpose with or without fee is hereby granted, provided that the above | |
| # copyright notice and this permission notice appear in all copies. | |
| # |
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(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| from flask import Flask as DefaultFlask | |
| class Flask(DefaultFlask): | |
| def create_jinja_environment(self): | |
| self.jinja_options = dict(self.jinja_options) | |
| if 'JINJA_CACHE_SIZE' in self.config: | |
| self.jinja_options['cache_size'] = self.config['JINJA_CACHE_SIZE'] | |
| return super(Flask, self).create_jinja_environment() |
| from jinja2.environment import create_cache | |
| # blah blah blah | |
| app.jinja_env.cache = create_cache(1000) | |
| # blah blah blah | |
| app.run() |
| fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=microcache:10m max_size=1024m inactive=15m; | |
| map $http_cookie $cache_uid { | |
| default nil; # hommage to Lisp :) | |
| ~SESS[[:alnum:]]+=(?<session_id>[[:alnum:]]+) $session_id; | |
| } | |
| map $request_method $no_cache { | |
| default 1; | |
| HEAD 0; | |
| GET 0; |
Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.
The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from