Build your own docker hub with blackjack and hookers

A kit for building your own docker.io:

https://github.com/ekristen/docker-index

https://github.com/ekristen/docker-index-cli

https://github.com/dotcloud/docker-registry

This was posted 1 month ago. It has 0 notes.
Mount directories into docker containers on Mac OS X
This was posted 1 month ago. It has 0 notes.
Art of Intel x86 Assembly
This was posted 1 month ago. It has 0 notes.

Copy many files over ssh

$ cd /path/to/dest/dir 
$ ssh -C username@hostname "cd /path/to/source/dir; tar cf - ." | tar xf - 
This was posted 10 months ago. It has 0 notes.
Book: Build & Launch
This was posted 1 year ago. It has 0 notes.

Tornado with unix sockets

import tornado.ioloop
import tornado.web
from tornado.options import options, define
 
class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")
 
application = tornado.web.Application([
    (r"/", MainHandler),
])
 
define('listen_address', group='webserver', default='127.0.0.1', help='Listen address')
define('listen_port', group='webserver', default=8888, help='Listen port')
define('unix_socket', group='webserver', default=None, help='Path to unix socket to bind')
 
if __name__ == "__main__":
    if options.unix_socket:
        server = HTTPServer(application)
        socket = bind_unix_socket(options.unix_socket)
        server.add_socket(socket)
    else:
        application.listen(options.listen_port, address=options.listen_address)
    tornado.ioloop.IOLoop.instance().start()
This was posted 1 year ago. It has 0 notes.

Python one-line servers

Serve content from current directory: 

$ python -m SimpleHTTPServer

STMP Server stub, will print every message it receives

$ python -m smtpd -n -c DebuggingServer localhost:2025

This was posted 1 year ago. It has 0 notes.

Digest #2

Collaboration

  • ascii.io – Record and share your terminal sessions
  • codassium.com – WebRTC based video chat + code editor for awesome interviews

Books

This was posted 1 year ago. It has 0 notes.

Digest #1

AngularJS – superheroic JavaScript framework

Experience exchange

Books

This was posted 1 year ago. It has 0 notes.

Make tornado keep blank values in request arguments

Tornado filters querystring and body arguments by omitting arguments that have empty values, which is pretty nice from first look and almost cant be noticed, until you dont need to get list of all arguments(even empty) that request has.

So I’ve stumbled into this, when I was implementing OAuth 1.0 signature base string calculation we need to get all request parameters:

parameters = dict() 
for k in request.arguments.iterkeys():
    parameters[k] = self.get_argument(k, strip=False)

Some times it worked fine, and sometimes it didnt, causing errors in basestring check, and it was caused by lack of empty parameters in request querystring or body, which were omitted by tornado.

Looking into tornado source code, and github repo I’ve found pull request addressed to this problem, but that patch covers only querystring parametrs and leaves request body without changes, so I’ve came up with my own hack.

This was posted 1 year ago. It has 0 notes.