Blogging in Baia Mare

Well, well, well… What do you know?

For a while me, myself and I was the only one I knew (isn’t that a bit selfish?) that was blogging from this God forsaken city. In fact for a while I was bloggin’ from Baia Sprie (even more God forsaken). And now, look! There are a myriad of weblogs based in Baia Mare (and powered by Blogger) and as I understand there was even a conference and a workshop held one of these weeks at UBM (North University of Baia Mare) about blogging. The (main) speaker was Gabriela Avram of Prinsea, RoBlogs and Gabrielia fame and the organizer was professor Mircea Lobontiu. It looks like this world is truly small, but I’m still sad I heard / read nothing about the event before it actually happened and as such I couldn’t attend. Well, that’s what happens when you ignore the FeedDemon icon on your desktop for weeks…

Anyway: go, go, go Baia Mare!

Living with mad men

If anyone could trace or knows the forum where this guy initially posted these memories (in Romanian) and would share the URL with me I would be sooo glad! Basically it’s a 34 page MS Word document with recollections about sharing an appartment with a mad man. And when I say ‘mad’ I mean proper mad, with the “red stripe” and everything. The author has a really nice writing style that reminds me of, well, Ion Creanga and reading the .doc entertained me for almost a whole afternoon. I Googled text parts and everything but found nothing and I’m intrigued because maybe he posted new chapters as in the last message / chapter he says something about the year’s end…

I found the .doc browsing the RLUG’s (Romanian Linux Users Group) humor list archives.

UPDATE Thanks to Vlad (Bits of Reality) I now have the URL of the original forum thread where the stories contained in the .doc were posted and so I can keep an eye out for any new “episodes”. Muchos gracias!

Hey, look what I stepped on!

Whoops! I stepped on Maggi!

OK, I admit this was staged. But I think I’ll print the “alternative campaign’s” sticker soon and I might even post it in my window because this damn campaign is really starting to drive me nuts. I’m far from being alone, but I won’t give any links because I didn’t check my newsreader for a while and I don’t want to omit anyone who posted about this.

UPDATE Here’s something extra for those of you who want a cool avatar. Just make sure you don’t get your ass banned from those family friendly boards.

MT-Keystrokes

Hey spammers, bite my shiny metal… MT-Keystrokes. Wow! I could almost say that this is the best invention since sliced bread! It’s based on such a simple ideea but it proves to be really effective in practice.

I saw the plugin a while ago, but when I tried to install it back then instead of my dynamically generated individual entry pages I saw errors because the plugin had no support for them. But yesterday after deleting about 30 notification e-mails MT-Blacklist sent me I got a little fed up and I decided that I’d better save myself from this kind of crap and revert to static individual entry pages just to be able to put MT-Keystrokes to work. But when I visited the project’s homepage I noticed that it now supports dynamic pages. Oh JOY!

Installation was a breeze and consisted of uploading 2 files and editing one template. And it works perfectly judging from the fact that since yesterday it blocked well over 100 junk comments.

Blog life is pink now. At least for a while…

PHP protected file downloads for your site's members

Hey, look! I just made a Google friendly entry title… And I did it because I want people to learn from the mistakes I made.

Suppose you have a website and you want to have some downloads available only to the members. Maybe you’ll manually approve each member to protect your bandwidth and so on… What do you do? You’ll most likely set up a members system in PHP (or integrate your downloads page with your exisiting members system) and then you’ll write a script to check if the user is authenticated and / or has download rights and if yes pass him the file via the script. You do this “via the script” passing instead of a header redirect to the real location of the file because advanced users could note the real location of the file thus circumventing the protection.

If you have big files to protect (relative to your server’s memory) don’t make the same mistake I did. Do not use any PHP function that loads the file into the memory and than passes it on to the user. You’ll expose the server your pages are hosted on to unwanted DoS (Denial of Service) risks. My client had some nice guy coming through an open proxy from Cambodia who hammered the server with 5 to 10 requests per second for software-download.php?id=435. What happened was that PHP tried to load 10 * 85 megs per second and I’ll let you do the math and figure out how much it took it to run out of memory… I caught the bastard by activating Apache’s mod_status module and watched what was happening in real time.

I’m still thinking about an easy solution for this problem, except splitting up the huge files with RAR or banning more than 1 connection from one user in an X minute interval which creates some database overhead.