Author Archives: alesk
Ad Hoc file sharing with SimpleHTTPServer
This is just a short memo about handy python module, called SimpleHTTPServer. Sometimes I need a way to quickly share some files with co-worker, without copying and/or creating shared folder. All I need is a quick way to allow someone read-only access to a specific folder. Let’s say that security is of no concern to me in such situation, since I’m talking about giving access to publicly available files anyway, such as drivers, installation files etc.
One neat way is to use python module SimpleHTTPServer.
All that is needed is this one-liner:
T:\Download>python -m SimpleHTTPServer Serving HTTP on 0.0.0.0 port 8000 ... alesk.domain.com - - [02/Feb/2009 18:13:49] "GET / HTTP/1.1" 200 - alesk.domain.com - - [02/Feb/2009 18:14:03] "GET /Accton/ HTTP/1.1" 200 - alesk.domain.com - - [02/Feb/2009 18:14:13] "GET /Accton/EN1207DTXv133.zip HTTP/1.1" 200 -
And the files will be available at http://yourhost:8000. Simply close the console after you’re done and http server will stop serving.
Last final note: be extremely careful that you cd to directory of interest, thus limiting access to only a particular directory. Remember that anyone with network access to your machine can access those files without authentication.
History of Python
Guido van Rossum recently started to blog about history of Python. Guido will write a series of articles, explaining how python was developed in the last 19 years (yes, time really flies – believe it or not, python is 19 years old). Python is today one of the most popular dynamic programming languages in the field with steadily growing community of new programmers. I’m looking forward to read the series of articles at History of Python.
Data Quality Institute
Last week I joined a small team of my colleagues at work to attend a one day seminar held by a small (non-profit) start up company called “Data Quality Institute (DQI)”, more precisely by Dejan Sarka and Uroš Godnov. The topic was an introduction to “Data Quality” from organizational and practical (technical) point of the view.
I think I first met Dejan Sarka at his course covering MS SQL Server 6.5 Administration in 1996 (or perhaps 1997?). And since then I always thought `what a pity that he took a MS SQL Server career path instead of Oracle´ :-). Of course, he’s best known as a top MS SQL Server expert, but nowadays I think his main obsession is development and application of different mathematical algorithms to achieve better quality of data stored in our relational database management systems. All demos he showed us were more or less pure SQL statements (with some helper functions written in C#) executed on MS SQL Server and the data mining methods where demonstrated with MS Analysis Services, thought it’s quite possible to recode everything for Oracle RDBMS. At present DQI doesn’t have a prepackaged product with a shiny user interface to demonstrate the power of their methodology, but this is really not their main objective at present (I think!?).
Anyway, it was a mind-boggling day for IT part of our team, that clearly showed us how weak our knowledge about Data Quality really is. Hopefully, with researches and companies like DQI things on this (often neglected) field can only get better and at the same time for the right price as well – a bad news for those overpriced software package vendors out there, I’m afraid. If you care about data quality then make sure you put DQI on your radar. We certainly did.
Windows Search – enabling search in .sql files
It’s one of those little annoyances working with Windows that I encounter now and then, when Microsoft disables something, without giving us a user friendly way of overriding their choice. Someone on the public forum complained about Windows Search because he could not find some Oracle supplied sql script that is responsible for particular object creation. Of course, files with extension .sql are excluded from the Windows Search by default.
Out of the box (Windows XP/2003) an attempt to find some string in .sql scripts will not reveal anything (see example in the picture).
Microsoft knowledge base article KB309173 describes two methods to enable search in files that are by default excluded by Windows Search (such as .log, .sql, .xml, …). I prefer method 1, enabling search for particular extension (such as .sql, .log, .xml) instead of turning off completely the restriction.
In short:
1) open registry editor and navigate to HKEY_CLASSES_ROOT\.sql or another extension of your choice, such as .log, .xml,…
2) since we know that we’re dealing with plain text in those files we can add Plain Text handler by adding key named PersistentHandler with the default value {5e941d80-bf96-11cd-b579-08002b30bfeb}.
3) After log off / logon Windows search should find the string in .sql files
My essential Python toolbox
Since Python 3.0 was released I’m regularly checking essential python packages that I currently use. And since I’m visiting more or less the same sites on a regular basis I decided to write down my list of packages that I use with the flag [python 3=Y, x86=Y|N, x64=Y|N] if there is at least support for Python 3 on Windows:
-
Essential packages:
- Python interpreter [python 3.1=Y, x86=Y, x64=Y]
- Python Extensions for Windows [python 3.1, x86=Y, x64=Y]
- cx_Oracle [python 3.1=Y, x86=Y, x64=Y]
- PyQt4 – GPL version [python 3.1=Y, x86=Y, x64=N]
- Py2exe [python 3.1=N]
- cx_freeze [python 3.1=Y, x86=Y, x64=Y]
- matplotlib
- MySQL for Python
- ActiveState recipe – Colorize Python source [N/A]
- ReportLab Toolkit (pdf library)
And some less often used modules:
[Note: Last update on February 16, 2010]


You must be logged in to post a comment.