This process has one critical flaw and you probably don't want to use it. git-svn is simpler.
You need:
- svn-all-fast-export (from the Debian/Ubuntu package of the same name;
#!/usr/bin/env python3 | |
# See http://stackoverflow.com/questions/3581031/backup-mirror-github-repositories/13917251#13917251 | |
# You can find the latest version of this script at | |
# https://gist.github.com/4319265 | |
import os | |
import sys | |
import json | |
import urllib.request | |
import subprocess |
#!/usr/bin/python | |
""" | |
Usage: watchpos {filename|pid fd} | |
Watches the file pointer of an opened file on Linux. Use it to provide a | |
progress bar to a command that doesn't have one, assuming the program reads | |
this file from start to end without jumping around. | |
Copyright (c) 2011 Marius Gedminas <[email protected]> |
#!/usr/bin/python3 | |
""" | |
Show recent requests on a timeline | |
Parses a ZServer trace.log file. The format is documented at | |
https://pypi.python.org/pypi/zc.zservertracelog | |
""" | |
import json | |
import re |
#!/bin/sh | |
# update dynamic files in /var/www/zope3.pov.lt/py3/ | |
# /opt/ztk-py3-status/ is a checkout of https://github.com/mgedmin/ztk-py3-status | |
# /opt/ztk-py3-status/*.py require python3 | |
# sponge requires moreutils | |
# convert requires imagemagick | |
# dot and neato require graphviz | |
cache_dir=/stuff/pypi-cache |
class CustomFormatter(logging.Formatter): | |
def formatException(self, ei): | |
"""Format and return the exception information as a string. | |
This adds helpful advice to the end of the traceback. | |
""" | |
import traceback | |
sio = StringIO.StringIO() | |
traceback.print_exception(ei[0], ei[1], ei[2], file=sio) | |
return sio.getvalue() + "... Don't panic!" |
in/python | |
# -*- coding: UTF-8 -*- | |
""" | |
Usage: | |
strace-process-tree filename | |
Read strace -f output and produce a process tree. | |
Recommended strace options for best results: |
= Problem =
timeit.timeit()
doesn't let you pass local vars to the code to be timed.
= Solution =
(pdb) !import sys, timeit
(Pdb) !dv = (lambda sys=sys: (lambda **kw: setattr(sys.modules['__main__'], 'VARS', kw)))()
(Pdb) !tt = lambda s, sys=sys: sys.stdout.write('%.3g ms\n' % timeit.timeit(s, 'import sys; self = sys.modules["__main__"].SELF', number=10)/10.*1000)
#!/usr/bin/python3 | |
import json | |
import os | |
import subprocess | |
import urllib.request | |
import sys | |
from operator import itemgetter | |