From medical journal TheLancet:
"Mass privatisation programmes were associated with an increase in short-term adult male mortality rates of 12·8%"
(via Astrit Dakli, who translates that percentage to real numbers: 1 million dead.)
From medical journal TheLancet:
"Mass privatisation programmes were associated with an increase in short-term adult male mortality rates of 12·8%"
(via Astrit Dakli, who translates that percentage to real numbers: 1 million dead.)
My wife's desktop machine died a couple of days ago, and now Windows won't boot for some reason. After a few unsuccessful attempts at reviving it, I decided that it would be better to simply move her stuff to a spare machine we had laying around (which actually has better specs, but I digress).
So I duly connected the old disk to the new machine, and tried to copy across a few files. Windows said "Access is denied". Apparently, the account names between old and new machine where different, so Windows would show her files as belonging to an unknown account, and refusing access even to an Administrator.
I could have worked around this by booting a Knoppix livecd and taking over, but that would have been slow; I thought that surely there was a pure-Windows solution, some "admin command-line magic", that would fix things. And so the googling started...
There are basically two main elements in Windows file security: the Owner account, and the Access Control Lists (ACL) applied to the object (or inherited). So the first step was taking ownership of all the objects; I accomplished this with a simple script using WMI:
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colFolders = objWMIService.ExecQuery("Select * From Win32_Directory Where Name LIKE 'F:%'")
For Each objFolder in colFolders
' Add the input parameters.
Set objInParam = objFolder.Methods_("TakeOwnerShipEx")._
inParameters.SpawnInstance_()
objInParam.Properties_.Item("Recursive") = true
objFolder.TakeOwnershipEx
wscript.echo objFolder.Name
Next
The script uses a WQL query to retrieve all the directory objects, then takes ownership of them, using the Recursive option in order to take over all files included in the directory as well. I ran this from the command line with "cscript myfile.vbs" and it worked. (I have to say that for some reason this script failed on a few directories under "Program Files", but I simply ignored them.)
Now I could open any directory and set permissions on any object, but I still could not copy several files; this was because the ACL on these objects were set to refuse access to everyone but the old user. Unfortunately, I didn't know how to do that with WQL (I honestly don't know whether it's even possible); so I used SubInACL instead. This is a little tool you can download from Microsoft; it "enables administrators to obtain security information about files, registry keys, and services, and transfer this information from user to user, from local or global group to group, and from domain to domain." Exactly what I needed!
subinacl.exe /subdirectories "F:\*" /grant=Administrators=F
This one-liner simply grants Full (F) rights to any object under the F drive. A few minutes later, and I was finally able to copy the files.
And they say Unix is complicated? If this was an ext2 drive, I could simply have mounted the drive as root to do whatever I wanted. Windows administration is really a bitch.
Note to search engines: the PingFire extension for Firefox doesn't work when NoScript is also installed. Check the official PingFire support thread for more info.
Update: I removed PingFire and replaced it with a simple bookmark-in-sidebar hack:
This is one of the very few occasions in which I found the Firefox sidebar quite useful.
Planet Jupiter moves to the Aquarius sector in 2009, and this is supposed to be a good thing for people born (like me) between 21th January and 19th February. Or so my mother says, in her crazy Italian way where "everybody knows" these things are b*llocks but they still believe them "just in case" (exactly like they do with Catholicism and Hell, by the way).
It certainly won't be an easy year for me, with the new "cryware/nappieware" scheduled for release around July. Things will get pretty hectic, I guess.
On a less personal note, lots of people said 2008 was "The Year of Obama", "The Year of the Crisis" or even "The Year of YouTube". They are Wrong. Sorry Barack, 2008 was "The Year of ABBA".
See you in 2009, perverts.
Giulio (through his feed on Delicious.com) pointed me to a nice post from "benevolent Python-dictator" Guido van Rossum. The essay describes a few general rules for improving performance of Python programs, and it also reminds us of "an odd corner of Python", the array module. Go and read it, it's worth it.
It also made me discover "an odd corner" of the Python website: the collection of Guido's essays. As demonstrated by the original post, this page is much more interesting than Guido's own blog, and so it's very disappointing that it doesn't have a feed to monitor. Mmhh... Edit: well, stuff there looks a bit stale, I guess Guido doesn't use it very much anymore. Still, it's the sort of thing that should have a feed. Maybe python.org should move to django? ;)