Labels

css (1) jQuery (7) linux (38) mac (70) php (29) python (1) svn/git (9) trac (4) ubuntu (1) virtualbox (6) vista (2) windows (14)

Saturday, 31 January 2009

The Truth is out there!


The truth is out there! Google may harm your computer! They say so themselves...
Ok seriously I'm just joking but the image is real, google just screwed up and now is showing all sites as "This site may harm your computer"...how long will it last? XD

Wednesday, 28 January 2009

Thunderbird niggle

Just a little niggle I have with thunderbird, by default it sets the cursor under the previous message when replying to an email.

To make it go to the top do the following.

Click "tools" then "account settings" choose your account, click "composition and addressing" then where it says "automatically quote the original message when replying" there is a drop down box, set it to "start my reply above the quote" and press "ok" then the cursor will start at the top :)
Sent from my BlackBerry® wireless device

Tuesday, 27 January 2009

Google Checkout & Ensim/Parallels Pro

Ok this is part rant part useful information.

Firstly this is what I've been tasked to do.

Integrate google checkout with a site running on a shared host with Parallels Pro as the control panel (formally ensim pro).

Parallels pro runs a virtual file system but not everything is virtual it seems, i.e. apache runs on the host but php runs on the virtual file system (great huh?).

Google checkout uses basic http authentication which you should verify when it sends you xml responses.

Now since the php installation is configured as cgi php doesn't pic up the authorization variables...so we have to use .htaccess files to check the authorization...here comes the nightmare.

I set up a .htaccess with the path to the .htpasswd file like this

AuthType Basic
AuthName "Google Checkout Authorization"
AuthUserFile /home//.htpasswd

<Files "googlecheckout.php">
Require valid-user
</Files>


Then set up the .htpasswd file with a test user and password, but ack! This doesn't work...after some mooching around in the ensim control panel I find their directory password protection tool, so I give it a go and what do I find...

This is the path to the .htpasswd file

/home/virtual//fst/var/www/.htpasswd

Now as an afterthought this does make sense since the apache installation is on the root box but for god sake why couldn't someone tell me this earlier >.> and to top it off even more, they don't use the standard http encryption the passwords are..well weird.

[/end rant]

Monday, 26 January 2009

First issue with suhosin

I run suhosin on my servers and this is the first time I've found a problem, I was trying to post several large arrays...and whoops it only managed half.

Checking the suhosin logs I saw this ALERT - configured POST variable limit exceeded ahhhh not a surprise really solution..

Increase
suhosin.request.max_vars
and
suhosin.post.max_vars

In the php.ini settings note you must increase both if you don't it won't work since request and post are classified as the same thing. (well actually request is everything)

Thanks to this post for help!

(anyone noticed it's a blog day?)

Sunday, 25 January 2009

Civ4 and gamespy

Ok so I go to play civ4 over gamespy for the first time...I try logging in with my details it says "Invalid username"...um what? I've had a gamespy account for years and years...so as usual quick google and I found this turns out you have to create a new account inside civ4 using the same info as your gamespy account, then it works fine.

Mac Firefox Open With Download Location

One irritating think about firefox on OSX is that when you choose "open with" in firefox it downloads it to your default download location, normally the downloads folder.

Now I've read places that changing the default download location in safari to wherever you want (in my case /tmp) would fix this, I tried it but it didn't work.

Then I found this if you download camino go into the preferences and change the download location to /tmp (access this by pressing cmd+shift then typing /tmp) it will then close down camino and restart firefox it will download "open with" files to the /tmp folder which OSX clears regularly.

PHP & Sendmail return path problems

I was just cleaning my email accounts and noticed I have 400mb of "undeliverable" bounced emails (not surprising since DH gets oodles of people using fake emails) the odd thing was where they were, I'd set the "from" headers to go to general at dragon hearts dot net but they were ending up in the default mailing address that the php pages were running under, after a quick google I found this which brought me to ...this which basically in short says.

"If you're on a unix/linux web server when using the mail() function alter it to something like this

$fromemail='youremail@domain.com';
$to="na@na.com";
$subject="this is an email";
$headers = 'MIME-Version: 1.0' . "\r\n".'Content-type: text/html; charset=iso-8859-1' . "\r\n".'From: '.$fromemail."\r\n" .
$headers .= "Reply-To: ".$fromemail."\r\n";
$headers .= "Return-Path: ".$fromemail."\r\n";
$extra='-r
'.$fromemail;
mail($to,$subject,$message,$headers,$extra);



The $extra tells sendmail which php uses to..send mail..to add a -r flag which sets the return-path (the place bounced emails go) to your email, it's a good idea to set the return path in the headers too just in case.


Saturday, 17 January 2009

Vista Hibernation and removing hiberfil.sys

If like me you don't have oodles of disk space (I'm on a laptop) and you're using windows vista, you may have notice that hiberfil.sys is the same size as your ram in my case 3GB which is a fair bit nearly a DVD's worth. How do you disable it? Well you can try going into control panel > power options > advanced > sleep > hibernate after never. But that didn't work for me, thanks to this post i found out that if you open an admin command window and type powercfg -h off it disables it. W00t!

Thursday, 15 January 2009

Drupal Updater

I have created a new shell script to update drupal installations easier version 0.1 can be found here.

RAIDing my pc

Bad title I know. Anyway this is more for me in case I have to do it again.
First take a backup using acronis.
Second install the raid drives.
Third in the bios ensure hard drive boot is enabled and that the raid array is first.
Fourth use a bart pe cd with the win xp 32 bit drivers on to restore the backup.

Alternative way that may work is install 2nd hard drive non-raided and clone 1st hard drive over, then raid the two without clearing data.

Wednesday, 14 January 2009

Smart SVN 5 and SASL

Thanks to Alexander at Smart SVN I can now connect to svn using SASL with encryption enabled.
The problem was the default application version of java on mac osx is 5 with JDK 1.5 for the encryption it needs version 6 JDK 1.6.

To change it do the following go into Applications > Utilities > Java > Java Preferences
Then drag Java 6 (64bit) to the top in both boxes.
Now start Smart SVN and voila it works!

Tuesday, 13 January 2009

Mac Merging Folders

An annoying thing about macs finder is that it doesn't merge folders only replaces if they have the same name, now you can use the terminal mv command but another solution comes with xcode if you check this post you can use file merge to merge folders.

Saturday, 10 January 2009

iDVD Multiplexing Error

I've recently been trying out apples iDVD on my mac mini. When burning a disk image (the mac mini doesn't have a dvd burner) it would get to the end and say "Multiplexing Error". Very odd. The problem, for some reason it doesn't like making a dvd if the media is on an external hard drive, I copied what I was turning into a dvd onto the mini's main hard drive and voila! It works!

AppFresh - Mac Software Updater

In the modern world of oodles of 3rd party software, keeping it all up to date can be a pain...for windows I use secunia now for mac I've found AppFresh! It's still in beta but I've had a go and it works wonders, it keeps everything up to date :)