Svilen's Tech Blog

Friday, June 13, 2008

In an absolute world

It's the first and last time I am playing blogger games ever and it's because Petya challenged me.

Hmm... let me see what should an absolute world be.

- only MAC computers available
- no managers/team leaders with unworkable requests all the time
- women with no timeframe restrictions for having sex
- free Mazda RX-8 with a full tank on every corder
- unrestricted joint and coffee shops (Deen Haag's affect ... )

And now it's my turn - Evgeni, Genadi show me your worlds. :)

Thursday, May 15, 2008

SWFUpload & Sessions

Have you tried SWFUpload?
It's cool flash uploader which is ideal for uploading big files (over 5-10MB) and having visual status about how much it's left.

Everything seems fine from the demos, etc. but! Yeah there is one clause that I figured out by myself while trying to use the tool in Drupal.
If you want to use the SWFUpload in restricted areas with scripts that require sessions (e.g. cookie sessions) you will fall into the hole.
For solving the issue add session read from $_GET also cause under Safari/Firefox/MAC OS X; Firefox/Linux the SWFUploader won't pass any cookies the the "upload.php" script.

Example solution for drupal:

if (isset($_GET['fmauthsessid']) {
if ($_GET['fmauthsessid']) {
$_COOKIE[session_name()] = $_GET['fmauthsessid'];
$key = $_GET['fmauthsessid'];
}
}
else {
if (!isset($_COOKIE[session_name()])) {
$user = drupal_anonymous_user();
return '';
}
}

Put this in the beginning of sess_read() in includes/session.inc

More experience lessons will be comming these days.

Wednesday, March 12, 2008

Wanna send email to Hotmail.com from PHP mail()? SUX...

Hello everyone,

I know you've noticed that I am not quite often blogging, but I am and will try to post interesting tech stuff here.

Today's topic: Sending email to Hotmail account from PHP.

Sounds easy. Some of will say "just use PHP's mail() function with correct headers". Yeah, but not. :)
I read almost all posts on this topic around the net with no success. So finally I started trying and trying ... after the 5th or 6th hour (God bless I started in the morning of the day else I would probably throw my MacBook out of the window) I managed to send emails to Hotmail successfully!

Hints:
1) Do NOT put any "a href" tags in the email
2) Put ONLY email address in the TO: and FROM: headers of the email
If you do one of the above your email won't even be in the Junk!
3) Do NOT send email from address like: no_reply@domain.com or noreply@domain.com
or it will go to Junk! folders in Hotmail accounts

That's it! Enjoy! :)

Ouh, I forgot to mention that I wanted to send HTML emails. ;-)

Friday, January 11, 2008

Looking for Dedicated Hosting Provider?

As many of you may know I do use dedicated server for 3 years by now. I started with MegaNetServe and I was satisfied till the previous year (2007) when they started to have frequently network downtimes with no reason or at least they didn't gave one.

Now I moved to Aplus and I can strongly recommend you them. Becides a value dedicated server you can get Plesk Control Panel with licence for 30 domains for no additional costs, which is great!
Plesk can save you a lot of time configuring the whole machine's services.

No, I haven't experienced a long term partnership with them by guys from MySQL Performance Blog are very pleased with Aplus for years.

Try them - www.aplus.net! ;-)

You will thank me later. :)

Thursday, December 20, 2007

Why not Microsoft?

It's simple. Because of this. :))

Very nice M$ car indeed.

Tuesday, November 20, 2007

PHP advice

As a PHP developer some of the important things in my work are tools. Yeah, tools read more about them here.

Then you might want to take a look at these PHP optimization tips. Believe me you won't regret. :)

Wednesday, November 14, 2007

How to play .flac files in iTunes

Everybody that knows me personally is aware that I am an Apple fan, expecially Mac OS X one.
I bought my first Mac laptop 2 years ago and an year ago I had a need to play FLAC music files on my laptop.
Yes it was possible, but as much as I searched for a good OS X music player I couldn't find one better than iTunes. That's why I needed iTunes to play FLAC files.

Finally I found it! :) Although Apple are not going to make it cause they want us to use their ALAC format.

So here's how you can make it work for you:

1. Exit all iTunes and Quicktime applications
3. Drag XiphQT.component (xiph-qt-0.1.8.dmg) to /Library/Components/
4. Drag FLACImport.component (flac_import_0.5b1_p0.1.dmg) to /Library/QuickTime/
5. Drag Clear OggS.app and Set OggS.app (set-OggS-0.1.dmg) to your Applications folder
6. Drag you FLAC files and drop them on Set OggS.app. A window will popup to show that all FLAC files have been "converted".
7. Add your "converted" FLAC files to you iTunes
8. Enjoy! :)

Hope it will work for you, too. :)