Archive for the ‘Internet’ Category

Error in PayPal NVP ExpressCheckout with Zend Framework

If you are using classes from Zend Framework Laboratory for PayPal integration (which is somewhat unfinished) you probably will have an error when trying

Zend_Service_Paypal::setExpressCheckout();

The error has strange description ‘Security header is not valid’ and not listed in PayPal documentation.

To fix the error you’ll have to change line in Zend/Service/PayPal.php (in Laboratory tree)

const SERVICE_URI = 'https://api-3t.sandbox.paypal.com/nvp';

to

const SERVICE_URI = 'https://api-3t.paypal.com/nvp';

Friday, October 3rd, 2008

Not working HTTPS queries with Curl

If you can work with usual http queries using PHP Curl, but have problems with https you can try to include this option:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

Tuesday, July 22nd, 2008

Converting openssh key from seahorse to putty

If you want to use your key generated in Seahorse in Putty you’ll have to convert it. The process is clear – make export of private key in Seahorse and import it to Puttygen. However one extra step is required – you have to delete everything before —–BEGIN DSA PRIVATE KEY—– mark. Otherwise Puttygen won’t recognise private key.

Saturday, May 31st, 2008

Shared hosting and SSH

I was surprised. I get used to the fact that most hosting providers has SSH off by default for their customers. I think it’s normal. It’s ok when you have to write them email/post a ticket/whatever. You have to explain why do you need ssh access, you have to prove them that you aren’t criminal, you aren’t going to spam/hack/whatever. And finally you’ll get an access. It’s ok, I can wait three days untill I receive ssh so I can work comfortable.

But this time I was asked for scan of photo ID. Not even asked, the upload form was built into cPanel. I think it’s kind of idiotism. I’m not going to send over all internet my ID just to have possibility to extract archives or quickly edit files right on server. And nobody will protect such hosters from somebody who’ll write small shell.pl or shell.php, which will just exec() what it receives from request. Isn’t it easier to setup proper chroot?

Friday, February 15th, 2008

Recursive ftp upload/download

Today we have to upload the whole directory tree to our site. How we can do it? If you use regular ftp command, this task becomes tedious and exhaustive job. You have to recreate each directory, change to each directory locally and remotely and perform mput or mget. If you have complex directory structure it is almost impossible to do that without a mistake. Solution? – Use lftp instead. It has mirror feature which allows to copy entire directory tree. To upload, use -R switch.

Wednesday, September 12th, 2007

Firefox word selection without trailing space

I hated long time that when I double click word in Firefox, it’s being selected together with a space. I hated it so much, that one day I entered into Firefox configuration editor (about:config) and found configuration value that is responsible for this behavior. Here it is – layout.word_select.eat_space_to_next_word, just change it to false and enjoy.

Friday, July 13th, 2007