… give me samba, please!

I’ve recently been fighting windows file servers. They run on totally oversized hardware (P4-HT, 8 SATA drives in a 7-active-1-hotspare RAID-5 set) but still don’t perform reasonably. (2.5 MB/s write performance is really bad, read performance is somewhat okay, though)

And then it’s so easy to confuse windows… seems like Windows can’t handle directories ending with a dot. But you can easily create such folders over the network with SMB… name a folder “foo.” and windows can’t handle it any more. Or “...”. Windows can’t delete or rename it. And I’m talking NTFS, not plain old legacy FAT.

So if you’re going to hide data on a windows box, just store it using SMB in such a folder. And if you want to be really evil, write a script that autodiscovers writeable network shares around you and creates “You suck.” folders there. Windows users will start running around screaming, but obviously you can’t be the culprit, since you can’t access Windows shares, can you?

I’ve also been porting a python app to Windows. Python is so nice, and PyGTK works like a charm on windows. Now if Windows just wouldn’t suck as much… for example, it doesn’t have os.fork(). And it’s I/O charset semantics are a complete mess. Once you don’t use only 7-bit ASCII you’re likely to go crazy. Seems like the console on Windows always uses codepage 437. The filesystem probably cp 1252. Windows internally claims to use 16-bit unicode.

So if you want a python script to run on windows:

  • Use string.decode(sys.getfilesystemencoding()) on any string you get from functions such as os.walk, that might depend on the filesystems character encoding
  • Write your app in a fashion you can redirect your output easily to a logfile, because the console on windows is totally borked… “print” just can’t print your filenames… or I havn’t found the right magic yet.

I can recommend python for cross-platform coding however. The PyGTK GUIs are really nice, much nicer than all that java stuff out there. And these “issues” with windows aren’t really Pythons fault, but Windows.