Ontem, minha esposa e eu estávamos sentados na sala, falando das muitas coisas da vida.
Estávamos falando de viver ou morrer.
Eu lhe disse:
- Nunca me deixe viver em estado vegetativo, dependendo de uma máquina e líquidos. Se você me vir nesse estado, desliga tudo o que me mantém vivo, por favor !!!
Ela se levantou, desligou a televisão e jogou minha cerveja fora.
DIMENSÕES DE CADA UM
October 6th, 2009Como abraçar um bebê
August 31st, 20091. Primeiro, ah… encontre um bebê ![]()

Encontre o bebê
2. Segundo, tenha certeza que o objeto encontrado seja mesmo um bebê, utilize a técnica do faro.

tenha certeza que o objeto encontrado seja mesmo um bebê, utilize a técnica do faro.
3. A seguir amacie o bebê antes de começar o processo do abraço.

amacie o bebê antes de começar o processo do abraço.
4. ‘A técnica do deslize de patas’: Deslize as patas em volta do bebe e se prepare para o close.

Deslize as patas em volta do bebe e se prepare para o close.
5.. Finalmente, pegue a câmera fotográfica, e execute a difícil arte de abraçar, sorrir e inclinar ao mesmo tempo, para conseguir a melhor foto!

Finalmente, pegue a câmera fotográfica, e execute a difícil arte de abraçar, sorrir e inclinar ao mesmo tempo, para conseguir a melhor foto!
oscommerce SEO URLs x shared SSL
August 4th, 2009Today I faced a weird problem with some stores using SEO URLs and also using shared SSL.
Background: shared SSLs are popular among hosting providers, where the users can use both http://www.mydomain/myfile.html AND https://ssl.myhosting.com/users/mydomain/myfile.html
This situation is quite useful for ecommerce sites, because you won’t have to purchase a SSL certificate (at least, not while you’re trying to setup your store) and still benefit from using encrypted transmission of data to/from your server.
osCommerce has the ability of jumping back and forth from both URL formats, e.g. in a moment you are in the home of the store, in http://www.mydomain.com/index.php and in the other, you click in my account and move to https://sss.myhosting.com/users/mydomain/account.php, all transparently to the user, besides the info in the address bar.
That’s good for users of the standard osCommerce script, but I’d say that many the stores use a contribution named SEO URLs, which rewrites the standard url of a product (example: product_info.php?product_id=XX) into a more readable format: my_products_title-p-XX.html), which helps a LOT in Search Engine Optimization (hence SEO URLs ;-)).
All the problem arises from two facts:
- SEO URLs relies upon using mod_rewrite in Apache servers, which need a statement in .htaccess like
“rewritebase /mystore/” to work, along with some rewrite rules. - The RewriteBase statement is not conditional, i.e., it cannot be differently for SSL or nonssl addresses.
It’s not a really big deal, since all rewritten urls *should* be pointing to http addresses, and so any https addresses are not rewritten.
In other words: the links to products in your store are all pointing to http://www.mydomain.com/myproduct-p-xx.html and the a “rewrite base /” will suffice.
BUT, you cannot underestimate Murphy’s law. If a user sees https://sss.myhosting.com/users/mydomain/account.php, there’s a good chance that they can try to append the product’s URL in the address, just to check if they’re not being fouled into a phishing website. Something like:
https://sss.myhosting.com/users/mydomain/my_products_title-p-XX.html.
As the .htaccess file is set by the standard configuration, the above URL will return a 404 error, and your visitor may think it’s not the same website. So, what can we do?
I modified my .htaccess to create 2 sets of rewrite rules, one for http and other for https accesses, like these:
RewriteCond %{HTTP_HOST} ^ssl\.myhost\.com$ [NC]
RewriteRule ^(.*)-p-([0-9]+).html$ users/mydomain.com/product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-([0-9_]+).html$ users/mydomain.com/index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-([0-9]+).html$ users/mydomain.com/index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-([0-9]+).html$ users/mydomain.com/popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-([0-9]+).html$ users/mydomain.com/product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-([0-9]+).html$ users/mydomain.com/product_reviews_info.php?products_id=$2&%{QUERY_STRING} [L]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC]
RewriteRule ^(.*)-p-([0-9]+).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-([0-9_]+).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING} [L]
What are we doing here?
Those RewriteCond statements will limit the scope of each rewriterule block, so that one will work for https and the other will be OK for http accesses. Pretty straightforward, huh?
Neuroscience: How to explain music for the masses :)
August 1st, 2009oscommerce’s paypal module problem with downloads
May 31st, 2009I struggled a lapse of time today because my new customer’s store was delivering downloadable products for pending orders, using the standard_ipn module made for oscommerce rc1.
The whole problem is that the original Paypal_ipn module for oscommerce (since version 2.2 MS2 as far as I could track) DOES NOT have an option to changes statuses when an order was approved (completed).
It simply have two statuses: Preparing (before the customer went to the Paypal gateway) and Acknowledged (after the customer returned from the gateway). So, this customer’s module was set to change the order’s status to “download available” when the module was just saying “Acknowledged”.
The fix: add a new setting to the module and edit the file ext/modules/payment/paypal/standard_ipn.php to account this new order status.
(if you don’t know what I mean, hire a good programmer to do it for you or contact me and I can help you for a small fee.)
“esta página pode conter um risco de segurança não especificado. deseja continuar?”
May 17th, 2009O erro do título aparece frequentemente quando preciso dar um clique direito, copiar arquivos ou outras ações em uma pasta de rede. A solução está no link abaixo:
http://www.howtogeek.com/howto/windows-vista/disable-the-annoying-this-page-has-an-unspecified-potential-security-risk-when-using-files-on-a-network-share/
Cartório de Caarapó
April 27th, 2009De vez em quando, temos boas surpresas.
Gostaria de deixar meu agradecimento ao sr Ronaldo Mantovani, do Cartório de registro de Caarapó, MS. Normalmente, nós que somos do “Sul Maravilha” (como diria o personagem Zeferino), pensamos que os serviços nos estados de SP, RJ, etc deveriam ser melhores, o que frequentemente se mostra um erro.
Explicando: precisei de uma cópia de uma certidão de nascimento, a ser enviada para o Japão com urgência. Se fosse atrás de despachantes, seguramente teria um monte de burocracia, demorando semanas para chegar alguma coisa aqui.
Pois bem, dizem que perguntar não ofende, então telefonei ao cartório, falei com o sr Ronaldo, explicando a situação. Ele me disse que poderia emitir o documento, escanear e enviar imediatamente, ao custo de R$25,00 da emissão da 2a via, mais correio, que me custou R$8,00 (carta registrada internacional). Somando-se R$8,00 do DOC, o custo para obter esse documento foi de R$41,00 no total, e recebi a cópia do documento em dois dias em meu email. Agora estou apenas aguardando que o correio me entregue o original.
Com isso, meu problema foi resolvido, sem atraso e sem enrolação.
Para quem precisar, o telefone do Cartório de Caarapó é 0×67 3453-1400, email: cartorio1oficiocaarapo@yahoo.com.br
Fica aqui meu agradecimento
Antivírus (Avast4Home)
April 11th, 2009Sempre me perguntam qual o melhor antivírus. Para não me extender muito, geralmente digo o antivírus que estou usando no momento, o que pode mudar de uma hora para outra.
Explicando melhor:
Um antivírus deve ser eficiente, atualizar constantemente e de preferência, usar poucos recursos de seu computador. Segundo esses princípios, o antivírus de minha preferência desde 2005 é o Avast4Home, que além das razões acime, é gratuito para uso não comercial.
É possível baixar uma versão para seu idioma em http://www.avast.com/eng/download-avast-home.html, procure na lista no final da página.
Para usar a versão gratuita é necessário efetuar um registro no site da Alwil, que pode sser acessada em http://www.avast.com/por/home-registration.php. Mude o idioma do site para potuguês usando o botão no topo da página.
Caso você não queira fazer o registro, pode simplesmente pedar o serial aqui: W83324142H1400A0211-1ZMK9XCY (válido até 1/jun/2010)
“Farofa” de okara
March 2nd, 2009How to change the upload limit for an HTML form in PHP?
February 27th, 2009I created an upload function for one of my scripts, and had a problem with the maximum size.So the steps to fix this situation are:
Change the .htaccess for the directory containing the upload script, adding the lines:
# Change upload setting to allow larger uploads php_value upload_max_filesize 41M php_value post_max_size 42M php_value max_execution_time 400 php_value max_input_time 400
Important: the php_value post_max_size must be greater than php_value upload_max_filesize, since any upload will be part of the post variables.
In case you get an “Error 500: Internal server error” after placing the above lines in the .htaccess, it probably means that you server’s configuration is too restrictive.
Open your httpd.conf (or apache2.conf), look for a section such as
...
AllowOverride Indexes AuthConfig Limit FileInfo
...
Deny from alland add “Options” to the allow override directive, as:
AllowOverride Indexes AuthConfig Limit FileInfo Options
Also, if you don’t have it, add:
Deny from all
to the same section. This will prevent the possibility of any file beginning with .ht* to be served o the browser, even if you forget to change it’s permissions.
