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 python2.7 | |
| import os | |
| import json | |
| import argparse | |
| import math | |
| def convert_size(size_bytes): | |
| if (size_bytes == 0): | |
| return '0B' |
| import mailbox | |
| import csv | |
| writer = csv.writer(open("mbox-output.csv", "wb")) | |
| for message in mailbox.mbox('file.mbox/mbox'): | |
| writer.writerow([message['message-id'], message['subject'], message['from']]) |
| # Dirty command line used to scan each gitlab repository and extract some stats | |
| # in this case : foreach commit > 2014-01-01 get the number of commmits, number of line added, deleted grouped by users | |
| rm /tmp/stats2014.csv; find /home/git/repositories -name .git -prune -o -name '*.git' -print | while read directory; do cd $directory; git log --after="2014-01-01" --format='%aN' |sort -u | while read name; do echo -en "Project\t$directory\t" >> /tmp/stats2014.csv; echo -en "Author\t$name\t" >> /tmp/stats2014.csv; git log --after="2014-01-01" --after="2014-01-01" --author="$name" --pretty=format:%ae | gawk -- '{ ++c; } END { printf "Number of commits\t%s\t",c; }' >> /tmp/stats2014.csv; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "Added lines\t%s\tRemoved lines\t%s\tTotal lines\t%s\n", add, subs, loc }' >> /tmp/stats2014.csv; done; done; | |
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