Posted by antonio lorusso on the June 21st, 2010
Complaining, screaming, sweating, swearing …. why it doesnt work … jeeeeeezzz/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection': Please install the postgres adapter: `gem install activerecord-postgres-adapter` (no such file to load -- active_record/connection_adapters/postgres_adapter) (RuntimeError)
And then a light … “I upgraded postgresql recently!”
Just reinstall the postgres gem and you are done…
What a night!
No Comments • June 21st, 2010
Posted by antonio lorusso on the May 17th, 2010
Probably many of you already know but here is the correspondent in PHP of the two fundamentals Perl functions:
map => array_map
grep => array_filter
Too lazy to give you examples .. I think you can work it out yourself.
No Comments • May 17th, 2010
Posted by antonio lorusso on the May 11th, 2010
I have been using the dotdeb repository on karmic for a while, but today, when I installed the new Lucid Lynx, it just became a mess so I decided to keep all the original ubuntu packages (Lucid ships php 5.3.2) and find an alternative repo for php-fpm which I use on my dev machine.
Here it is:Brian’s php5-fpm : Brian Mercer
Happy 10.04!
No Comments • May 11th, 2010
Posted by antonio lorusso on the March 31st, 2010
I spent hours yesterday to implement the GWO that, instead, should take literally minutes!
You want to know why? The bugged Techie Guide!!!
On page 19, the script is completely wrong and drove me mad: variation-content should be variation_content and document.write(“</nosc” + “ript>”) should be document.write(“<nosc” + “ript>”);
So, here is he complete correct script:
<script>
var v = utmx(‘variation_content’, ‘Section1’);
if (v) {
document.write(
v.replace(“%%product_name%%”, “<? print $product_name ?>”).
replace(“%%product_price%%”, “<? print $product_price ?>”).
replace(“%%product_id%%”, “<? print $product_id ?>”));
document.write(“<nosc” + “ript>”);
}
</script>
<ul>
<li>Product name: <? print $product_name ?>
<li>Product price: <? print $product_price ?>
<li><a href=’buy.php?prod-id=<? print $product_id ?>’>
Buy Now</a>
</ul>
</noscript>
Adapt it to your code and be happy!
No Comments • March 31st, 2010
Posted by antonio lorusso on the March 22nd, 2010
When you are using the FastCGI Php version, you would set HTTPS variable if you are serving parts of you website with SSL.
To do that, add the following function into the http section of your nginx configuration
map $scheme $fastcgi_https { ## Detect when HTTPS is used
default off;
https on;
}
and use the variable into your server section
fastcgi_param HTTPS $fastcgi_https;
Lazy explanation as usual
No Comments • March 22nd, 2010
Posted by antonio lorusso on the March 19th, 2010
I hate svn! It’s official!
if you have this stupid error, what you have to do is run dos2unix on the file specified by the error. Don’t forget the -a option!
shell$ dos2unix -a /the/affected/file.php
No Comments • March 19th, 2010
Posted by antonio lorusso on the March 10th, 2010
if you have this error from nginx with php-fpm and output_buffers = On in your php.ini then try to increment the buffer size in nginx:
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
No Comments • March 10th, 2010
Posted by antonio lorusso on the February 26th, 2010
A simple rename example using again the mighty awk and xargs
ls -l *.xml | awk '{print $9}' | xargs -t -i mv {} {}.old
Explanation:
ls -l *.xml -> easy! list the xml files in a folder
awk '{print $9}' -> output just the name of the file
xargs -t -i mv {} {}.old -> rename it adding at the same filename the extension “.old”
I know, I know … my explanation is crap: blame my laziness
No Comments • February 26th, 2010
Posted by antonio lorusso on the February 6th, 2010
Pure-ftpd is a bit tricky to configure because do not handle the configuration like any other daemon in Linux so you will not find any /etc/pure-ftpd.conf.
According to the pure-ftpd documentation, you should start the daemon already with the options you need. The default Ubuntu installation, use the files in /etc/pure-ftpd/conf/ to set the options for the startup script of pure-ftpd so, to disable the logging, execute the following command in your shell and restart the daemon
$ echo "none" > /etc/pure-ftpd/conf/SyslogFacility
$ /etc/init.d/pure-ftpd-mysql restart
No Comments • February 6th, 2010
Posted by antonio lorusso on the February 2nd, 2010
I’ll just paste here the usual simple steps to install the latest firefox 3.6 on your ubuntu:
sudo add-apt-repository ppa:mozillateam/firefox-stable
sudo apt-get update
sudo apt-get install firefox-3.6
Have fun
No Comments • February 2nd, 2010