Python: Check that your projects are still alive
I wrote the following Python script to solve my need to verify all my projects are still up and running. The program itself is simple: given a list of URL-s check that all of them return HTTP status code 200 (OK). On any other status (mainly 500) send a report to the admin.
Best used via crontab every… minutes.
Install: Copy both files to a directory (~/bin works well) and check that dependencies (imports) are satisfied. Configure via http_check.yaml, optionally adding custom actions to http_ok() and http_error() functions inside the main script file.
Link to the source (GitHub)
Time-coded email service
Spy movies sometimes include a clever fail-save someone set up to activate in the event of their capture and/or death.
My recent idea (while not a new one, but a quick googling didn't turn anything similar up) is just that.
A service that lets you prepare an e-mail and then lies in wait for the moment to send it. Sending the e-mail is delayed as long as the individual keeps regular check-ins with the system.
The project has only the GUI at the moment, I'm planning on writing the backend in Python (GAE), because Heroku's e-mailing limitations look too complex and I want to try something different from PHP.
Link to GitHub
Update:
I started writing the backend code in Python. An unfortunate surprise was how messy type juggling was in Python. Maybe I'm not doing it right, but I expected more elegance.
Anyhow, the "live" version is at http://afterileave.appspot.com/
Automaatne sotsialiseerimine
Otsustasin kirjutada programmijupi, mis minu eest ”viisakalt” MSN-is juttu räägiks.
Kasutasin Ubuntut, Pidgin’it ja Python’it. Pidgini plussiks on mitme protokolli toetus ja dBus, mis asja võimalikuks teeb.
Tekstide genereerimisega aitas http://solvangud.ee, sealt sai vastused tekstifaili salvestatud. Uue sõnumi saabudes valib Python tekstifailist sobiva vastuse (tegin isegi veidi semi-semantilist võrdlemist lähtetekstiga) ning vastab minu nimel.
Idee: kasutada tekstifaili asemel suvalist lähtekoodifaili. Kood pole põhjalikult testitud.
Enne käivitamist tuleb samasse kausta teha fail solvangud.txt ning igale reale paigutada üks lause, mida robot vastama hakkab.
eki-otsing
Programmi veebiversioon asub eki-otsing.appspot.com
Minu uusim projekt. Tegu on Pythoni ja Google Appengine peal jooksva tööriistaga, mida saab kasutada eestikeelsete sõnade leidmiseks, kui ei ole teada kõik sõnas esinevad tähed. Mõeldud kasutamiseks eelkõige poomismängus (“Mõista, mõista: P_D_L”) ja ristsõnade lahendamisel. Koodis on probleeme täpitähtedega.
Programmi lähtekood (kasutamisel palun viidata autorile).
Poomismängu ja ristsõna lahendamine Pythoni ja ÕS-i abil
Vana postitus. Uus sisestus on siin.
Tegin Pythonis programmi EKI ÕS-ist sõnade pärimiseks. Programm aitab lahendada ristsõnu ja poomismänge (hangman).
Otsingu alustamiseks tuleb sisestada sõna, asendades puuduvad tähed küsimärkidega või *-ga (suvaline arv tähti). Lähemalt vaata kiirspikkrist
Poomismängu režiim üritab välja praakida sõnu, mis vastuseks ei sobiks (kui otsing on kal?, siis kala ei sobi, sest “a” tähte on juba pakutud)
Windowsi kasutajatele: vajalik on paigaldada arvutisse Python.
Juhend Linuxile: kopeeri allpool olev kood tekstiredaktorisse ning salvesta nimega ‘poomine.py’. Anna failile käivitusõigused (parem hiireklikk -> omadused), või käivita käsuga python /home/kasutajanimi/faili-asukoht/poomine.py
Programmi lähtekood:
Talky-AI
This script makes two AI-s have a conversation with eachother. Things can go quite out of hand. Thanks to the xgoogle library it's also possible to have the text translated. A logfile is automatically generated with all the spoken text. Robots and API provided by www.pandorabots.com. There are some bugs (like missing punctuation when trimming the text), comments on those are welcome.
Example conversations:
Enter a topic: catsGetter: Yes I love them.Mihkel: Ah. You love them. What do you like about it so much?Getter: Ah hah. Sometimes I think love is just a biological urge. Other times it seems like a spiritual quality. Love, unlike energy or matter, seems limitless. The melodramatic touch.Mihkel: GoodGetter: Thanks for the compliment.Mihkel: Oh don't mention it.Getter: Yay. The pleasure was all mine.Mihkel: I'm glad your impressed, . I like you because are so polite.
Enter a topic: cookiesGetter: ?? ????????????????Mihkel: ? ?? ???? ?? ? ??? ??? ???????????????. ? ????? ??????? ??? ??.Getter: ?? ?????? ?????? ? ?? ??????????????. ?? ?????? ???????, ???? ??? ? ???????? ?????????? ?????????????? ??????????.Mihkel: ??, ??????????, ???????? ???. ?????, ?? ?? ????????? ??, ??? ??? ? ???? ? ????, ?? ?????Getter: ??????? ?? ??????? ??????Mihkel: ??? ???????.Getter: ?????? ?? ???? ?????????Mihkel: ???? ??????? ???????.
Enter a topic: Romans are brave.Getter: Kas sulle meeldib olla number üks?Mihkel: Hmm, ma ei ole kindel, kas ma tahan olla number üks, et palju. Mis see on?Getter: Kas te olete kunagi olla kindelMihkel: Olen sama kindel kui ma saan olla.Getter: Sa kõlad väga enesekindel.Mihkel: Mil moel saan tunduda, et?Getter: Esimene neist, arvan ma.Mihkel: Mis oli teine?Getter: Ma ei mõtle enam kui ühe sekundi jooksul.Mihkel: Võibolla mõtted on vaid elektri impulsid.






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. 