Skip to content

Instantly share code, notes, and snippets.

@hacosta
Last active April 13, 2016 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hacosta/5d71ef77660f54aa1fe41b25ac9232f1 to your computer and use it in GitHub Desktop.
Save hacosta/5d71ef77660f54aa1fe41b25ac9232f1 to your computer and use it in GitHub Desktop.
#!/usr/bin/python2
from __future__ import division
from datetime import date
import re
with open('/var/log/pacman.log') as f:
first = f.readline()
y, m, d = [int(c, 10) for c in first[1:11].split('-')]
days = (date.today() - date(y, m, d)).days
print('days since install %d' % days)
syutimes = len(re.findall(r'pacman -Syu', f.read()))
print('pacman -Syu ran: %d times' % syutimes)
print(syutimes / days)
@hacosta
Copy link
Author

hacosta commented Apr 13, 2016

Now with 100% more output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment