On repeat: Puscifer – Momma sed

photo by Sasa Lazic
Photo taken from Sasa Lazic’s portfolio on Art Limited

wake up son o’ mine
momma got somethin’ to tell you

changes come
life will have its way
with your pride, son
take it like a man

hang on son o’ mine
a storm is blowin’ up your horizon

changes come
keep your dignity
take the high road
take it like a man

listen up son o’ mine
momma got something to tell you
all about growin’ pains
life will pound away
where the light don’t shine, son
take it like a man

suck it up son o’ mine
thunder blowin’ up your horizon

changes come (changes come)
keep your dignity (keep your dignity)
take the high road (take the high road)
take it like a man (take it like a man)

momma said like the rain
(this too shall pass)
like a kidney stone
(this too shall pass)
it’s just a broken heart, son
this pain will pass away

Alternating with the original is the version from V is for Viagra – The Remixes: Momma Sed (Tandimonium Mix)… Can’t decide which is better.

Hackish HOWTO: migrating a (larger) running OpenX installation to a new machine

Disclaimer: It’s a hack, but it worked :) You’re doing this at your own risk! Copying raw Mysql database files may corrupt your data to the point of no return!

First, a little background information: we’ve been using OpenAds / OpenX even back in the days when it was called phpAdsNew.

Last fall (septmeber to be exact) we’ve launched a new website, that ran OpenAds, a Vbulletin forum, and a custom CMS / application for other parts of the site.

At the beginning a single server was able to handle it all. Recently, however, the site usage grew, and the OpenX database grew to around 1.5GB in size, serving around 7 million ad impressions per month.

A new server appeared and it was decided we’re gonna move OpenX to its own dedicated machine.

Trying to dump the database contents to .sql files was proven to not be doable (without taking the server down for maintenance, which we felt was not good for our users). We wanted to migrate it without taking the server down and users noticing anything (if possible).

So, another solution was to be found, and here’s how we hacked it, in case someone else finds themselves in a similar situation:

  • create a new empty database on the new server
  • scp the raw *.frm, *.myd and *.myi files from your old server’s mysql data dir to the newly created db’s data dir on the new server
  • chown the newly copied files to the appropriate user/group under which mysql is running on the new server (if different from the old one)
  • run mysqlrepair –database new_server_db_name –repair (see http://dev.mysql.com/doc/refman/5.1/en/mysqlcheck.html for more info and options)
  • scp the OpenX files over to the new server and chown/chmod appropriately
  • modify the OpenX config file in var/ if you’re changing the server’s public address and stuff like that

And that’s it. Everything worked after that.

After seeing that it all works, we upgraded to the latest OpenX release (2.4.7 at the time of writing) by just following the upgrade docs from the manual.

Once again, keep in mind that copying raw db files might cause MAJOR PROBLEMS, incompatibility issues, data inconsistencies etc.

You’re doing this at your own risk. Make sure that the Mysql versions are the same on both servers.

HRT vs BBC

HRT (Croatian National Television) redesigned their web site. One thing is certain: IT FAILS.

This post is just to make sure that the shame and evidence of blatant ripoff never go away or get forgotten. Seeing anyone do stuff like this in the year 2008 when (almost) everyone has Internet access is leaving me speechless:

hrt.hr-bbc.co.uk-ripoff

It goes without saying that:

  • the implementation sucks
  • it’s nowhere near the functionality or aesthetics of the original BBC version

I could go on and on about various technical stuff that sucks, but I just don’t have the strength to do it anymore. Resignation is slowly kicking in…

Mi3dot.org’s Plagiarism forum thread has the inside scoop on who’s responsible, who profited and whatnot. Aljoša’s post illustrates the similarities even more.

Some other (Croatian) sources:

Zend_Feed and RSS 1.0 RDF = shit out of luck

http://framework.zend.com/issues/browse/ZF-405

There’s a “workaround” available, if you’re keen on tainting your ZF install. Grab the zip file + diff from the above link and unzip inside the library/ folder.

Note: this gives you just Zend_Feed::import() functionality for those fugly rss 1.0 rdf feeds.

If you absolutely must create such feeds programatically, well, you’re shit out of luck as long as ZF is concerned. Try voting for the issue in the tracker (linked above) or dig in and patch the whole damn thing yourselves. Luckily, I needed just the import() functionality.

I don’t want a stinkin’ office building…

I’ve got everything I need (to get the job done) right here in the lovely city of Pag, back in the yard:

Working hard...

New Media Douchebags Explained

Oldie but goldie!

How I fixed my WP image/media uploader and general wp-admin problems in 2.5.1

After reading through a bunch of posts all over the internet, trying out every solution that worked for others, and still not getting results on my blog — it was time to roll up my sleeves.

A quick view-source on the wp-admin’s post page revealed this shiny gem:

autosaveL10n = {
    autosaveInterval: "AUTOSAVE_INTERVAL",
    ...
}

Well, hello there Mr. Classic Example Of An Undefined Constant!

A few quick greps against the current trunk showed that the constant AUTOSAVE_INTERVAL should be defined in wp-config.php (if you wish to override the default 60 second interval), or that it gets set to the default in wp-settings.php if it hasn’t been defined beforehand.

Opened up my curent wp-settings.php, ctrl+f, type in “autosave” — no match. It turns out that somewhere in the update process from 2.3.x to 2.5, stuff got mixed up: my (thought to be) latest wp-settings.php file was actually not the one from the 2.5.1 release, but, somehow, a different one (and not the one from 2.3.x either).

I have no idea how it happened, or the time right now to backtrack and figure it out. I did notice a weird thing on wordpress svn. The 2.5-tagged wp-settings.php is different from the 2.5-branch wp-settings.php — they could be using tags for different things though.

Aaaaaanywhooo, what I did to fix the issue: grabbed the latest 2.5.1 from wordpress.org and replaced my current wp-settings.php with the one from the newly downloaded ZIP file. Woot! It’s all good now: uploads working, no more autosave ajax requests happening every possible millisecond etc.

The second issue was the image/media uploader not working and just displaying “HTTP Error”. The culprit was mod_security, which i quickly got disposed of via some .htaccess directives inside the wp-admin directory:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

The above is only a quickfix to see if it is really mod_security or something else — once you’re sure it’s modsec, narrow down the directives to deal only with certain filenames, so you don’t expose your entire wp-admin directory to possible future exploits etc.

Damn comment spammers…

The amount of spam is just o_O

If you need to contact me, there’s an email address in the source files, or you can use my domain-at-gmail address — I’m turning off comments for now…

UPDATE: activated akismet… we’ll see how it goes

On truncating abstracts, descriptions, excerpts, whatever you want to call them…

TLDR version: You can not, must not — and hence — will not truncate any larger body of text in the middle of a word. Let the people read the whole sentence, or at least the whole word… God forbid you add an ellipsis indicating more stuff is there…

The scenario is pretty stupid (and unfortunately all too common these days): A web site decides to publish certain parts of their content in an RSS feed. The stupid part being that they decide to limit the amount of content in the feed in hopes of folks clicking the link and reading the whole thing on the site. OK — resistance is futile — that’s just the way it is.
[Yes, I know there are sites that have valid reasons for such an approach. We’re not talking about those here]

But, how stupid do you have to be to not realize that with code along the lines of:

$abstract = substr($body_of_text, 0, ABSTRACT_LENGTH_LIMIT);

you’re bound to end up with chopped up: words, sentences, dates, times, people’s names, god-knows-what-else?
[replace the above PHP code with any language you want, the principle is the same]

Does that thought never cross anyone’s mind? Is that an advanced concept people cannot grasp? If it is I need to find a way to make money of it…

Anyway, crap like that gets served to the “readers”. Worse yet, the web site proudly displays their RSS 2.0 (oh, look, 2.0!) badge on the footer of every page on the site (BTW, how hard is it to add a bloody autodiscovery <link>? You can slap a badge in the footer, but not in the <head>? I don’t get it.), the CMS generating that crap is happily adding a “generated by” comment in the feed itself… Pathetic.

Don\'t do this, please...

A PHP script for removing Thumbs.db, .DS_Store, MacOS hidden and other annoying files

Tired of explaining to others how to turn off thumbnail caching on Windows, how to install TinkerTool on Mac? Deleted your fair share of those damn files manually? Me too! Never again!

/**
* housekeeping.php
*
* Removes various annoying hidden and/or useless files leftover from
* different people doing different stuff on the filesystem using
* various OSes.
*/

Source: housekeeping.php (5KB, .phps file)

When and how you invoke the function (cron or scheduled tasks, manually, before/after/during some scm process, on login/logout…) is up to you.

Questions, comments, etc — use the form below. Enjoy nuking those files.