((lambda (x) (x x)) (lambda (x) (x x)))

Friday, January 30, 2009

Func Users Module v0.4 is released!

A new version of the func users & groups management module has been released for public use, testing or review. The updated module can be found here: Func Users Module v0.4.


New Features:

- Password alteration method added.
- Pluralized methods for all applicable singular methods.


Other Changes:

- General API cleanup.


Planned for version 0.5:

As nearly all core functionality for day to day user and group management is at this point complete, release 0.5 is expected to be a candidate for final release and integration with the project's main branch.

One feature remains: GECOS field manipulation methods: Currently, the GECOS field can only be manipulated as a single unit. Version 0.5 will fill in this remaining gap in functionality by providing getter/setter methods for all subfields of the GECOS field.


The updated project page is here.

Thursday, January 22, 2009

Getting the hang of Python.

So, I've been practicing a little more with Python, and kind of think I'm getting the hang of it.

But as far as the language's supposed 'readability', I offer the following counterexample...

AccessTable.py
# Usage: head -60 /var/log/apache2/access.log | python AccessTable.py
# Effect: Produces a spiffy HTML page containing the contents of your Apache access log in a table.

from fileinput import input as OO
O=[(lambda o,oo,ooo:[o]if(oo=="")else[o+oo[0],oo[1:]]if(oo[0]==ooo)else(O[0](o+oo[0],oo[1:],ooo))),(lambda o,oo:[o]if(((O[0]("",o,oo[0])if(not(o==""or(oo==[])))else[o,""])[0]and(not(O[0]("",o,oo[0])if(not(o==""or(oo==[])))else[o,""])[1]))or(o==""))else[(O[0]("",o,oo[0])if(not(o==""or(oo==[])))else[o,""])[0]]+[(O[0]("",o,oo[0])if(not(o==""or(oo==[])))else[o,""])[1]]if(not(oo[1:]))else[(O[0]("",o,oo[0])if(not(o==""or(oo==[])))else[o,""])[0]]+O[1]((O[0]("",o,oo[0])if(not(o==""or(oo==[])))else[o,""])[1],oo[1:])),""+chr(60)+"/b"+chr(62)+""+chr(60)+"/u"+chr(62)+"",(lambda o,oo:""if(oo=="")else(oo[0])if((oo[0]!=o)and(not(oo[1:])))else(oo)if(oo[0]!=o)else(O[3](o,oo[1:]))),(lambda o,oo:""if(oo=="")else(oo[0])if((not(oo[1:])))else(O[3](o,(oo)if(oo[-1]!=o)else(O[4](o,oo[:-1]))))),["IP Address","Date","Time","Method","URL","Protocol Version","Error Code","Bytes","URL 2","Client"],(lambda o:""+chr(60)+"html"+chr(62)+"\n\t"+chr(60)+"body"+chr(62)+"\n"+'\t\t'+chr(60)+'table border="1"'+chr(62)+"\n"+"\n".join(["\t\t\t"+chr(60)+"tr"+chr(62)+"\n"+line+"\t\t\t"+chr(60)+"/tr"+chr(62)+""for(line)in[''.join(o)for(o)in[["\t\t\t\t"+chr(60)+"td"+chr(62)+""+word+""+chr(60)+"/td"+chr(62)+"\n"for(word)in(line)]for(line)in(o)]]])+"\n\t\t"+chr(60)+"/table"+chr(62)+"\n"+"\t"+chr(60)+"/body"+chr(62)+"\n"+chr(60)+"/html"+chr(62)+""),""+chr(60)+"b"+chr(62)+""+chr(60)+"u"+chr(62)+"",(lambda s:[(o)for(o)in[(lambda o:O[4]("\n",O[4](":",O[4]("]",O[4]('"',O[4](" ",o))))))(o)for(o)in(O[1](s,[" ","[",":","]",'"'," "," ",'"'," "," "," "," "]))]if(o)not in[" ",'"',"","- - ["]])]
print(O[6]([[O[7]+o+O[2]for(o)in(O[5])]]+[O[8](o)for(o)in(OO())]))





Just a little something I came up with this evening. Feel free to try it out - it works with the default log format in the version of Apache installed on my (somewhat outdated) Ubuntu 6.06 webserver. If the format gets messed up in the blog, a copy is on the web at 'http://matrix.senecac.on.ca/~gjmasseau/AccessTable.py'.

Tuesday, January 20, 2009

Observations on the installation of FreeBSD

Differences in installation between FreeBSD and Linux:

During installation the differences between FreeBSD and Linux are not particularily pronounced: the installer's interface and usage bear quite a significant resemblence to those used in many Linux distributions, Debian and Slackware being two particularly notable examples. While the overall experience is quite similar to installing one of these distributions of Linux, there are a few particular areas that are clearly a little bit different.

The first difference one is likely to notice is that the FreeBSD version of the fdisk utility uses some terminology that may be unfamiliar - instead of referring to primary partitions, it refers to slices - in fact, they are the same thing, and merely the terminology has been changed. FreeBSD requires one slice on which to be installed. Meanwhile, after the boot manager has been installed, the FreeBSD DiskLabel Editor will launch, and you may notice that the word 'parititons' has been repurposed - in FreeBSD, the word 'partition' is used not to refer to physical disk partitions , but rather refers to an additional layer of storage abstraction implemented on top of the physical slices on may create on their storage devices (e.g., harddrives, flash media, etc). Many configuration files found in /etc look quite similar to their Linux counterparts, such as fstab, while a few, such as freebsd-update.conf, are clearly new. Additionally, the structure of the rc files is significantly different, with all startup script code contained in a small set of rc.* files located in the /etc/ directory itself, rather than a distinct folder for each level -- indeed, runlevels themselves are absent!

Things I liked about the FreeBSD installer:

The installation experience was simple, to the point, and straightforwards, while providing a fairly wide set of options to customize your installation. The straightforwards, simple user interface was refreshingly uncluttered compared to the GUI installers that have grown popular in some distributions, and I must confess it elicited some nostalgia with the memory of installing Slackware many times (though never more than once on a given machine! How's that for stable?) back in the good old days.

Things I did not like about the FreeBSD installer:

So far, I haven't really found anything to dislike - maybe something will come up later on, during use, but I have no issues with the installer.