Povi Päris Pythoni Progremise Päevad
Povi õpetab Pythonit progema! Kooliõpilastele-õpetajatel?e ja Povisse praktikale tulevatele üliõpilastele tasuta!
Day #1: My solutions
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'Ando'
print "Apache log analyzer"
lines = 0
os = {'win': 0,
'linux': 0,
'mac': 0,
'unknown': 0
} # 3 major OS-s
percentages = {'win': 0,
'linux': 0,
'mac': 0,
'unknown': 0
} # Holds the percentages
fail = '/var/log/apache2/access.log'
print "Logfile is ", fail
for line in open(fail, 'r').readlines():
if (line.find('Linux') != -1):
os['linux'] += 1
elif (line.find('Windows') != -1):
os['win'] += 1
elif (line.find('Mac') != -1):
os['mac'] += 1
else:
os['unknown'] += 1
lines += 1
print "Number of log entries:", lines
print ""
for name in os:
if (os[name] > 0 and lines > 0):
percentages[name] = (os[name]*1.0 / lines*1.0) * 100
print name.upper() + ', %i times, %f%%' % (os[name], percentages[name])
print "nEND"
SMS-gateway
Tele2 pakub kuumaksuga e-mail-to-SMS gateway teenust. Vägev! Kusjuures öeldi, et kõik SMS-d on tasuta, maksta tuleb ainult kuumaksu eest.
Oleks mul vaid virtuaal-privaatserver kuskil pilves…saaks häkkerdada selliste asjadega nagu ITK-Notifier
New mail in inbox!
Since the invention of e-mail, geeky people have found various creative and sometimes annoying ways to notify themselves of a new mail in their inbox.
Say, for example, that you have a roomie who left his laptop locked and the volume up and it just so happens that he had a very vocal Indian dude announcing his full inbox every 3 minutes.
This would be my remixed reply to that.


Ando “David” Roots is a college student and a software developer from Kunda, Estonia. Living, working and studying in Tallinn, he hopes to get his bachelor degree from the Estonian Information Technology College on IT Systems Development. 