Tuesday, December 09, 2008

install LAMP (Apache - mysql - php) on Ubuntu

sudo apt-get install apache2

sudo apt-get install php5

sudo apt-get install mysql-server-5.0

sudo apt-get install libapache2-mod-php5

sudo /etc/init.d/apache2 restart

Wednesday, December 03, 2008

show / unshow all files in Finder - OSX

with the command, from the Terminal:

defaults write com.apple.finder AppleShowAllFiles [ TRUE | FALSE ]

and restarting Finder (note the upcase)

killall Finder

Finder will show/unshow all the hidden files

Monday, October 13, 2008

php and XML

I wanted to run some php scripts to parse and create XML docs,
but on my Fedora 9 the XML package called DOM is disabled

the error on the script was:
PHP Fatal error: Class 'DOMDocument' not found

on phpinfo()
--disable-dom was one of the preprocessing compiling directives...

solution is easy and straightforward:

yum install php-xml

Thursday, July 31, 2008

last n records in a query

I'm using mysql for this:

This is straightforward:

SELECT * FROM tab LIMIT 0, 10

will display the first 10 rows from the table tab.

SELECT * FROM tab LIMIT 5, 2

display rows 6 and 7 (5 is the offset, 2 the count)

And:

select * from (select * from TAB order by id desc limit 5 ) TA order by id;

display the LAST 5 rows.

Wednesday, July 23, 2008

Perl modules

I'm taking a peek to some perl modules, following some personal rules:
1. do not re-invent the wheel
2. KISS, keep it simple, stupid

Perl is a great language, with many packages...
I'm missing a guide, a legenda on them

"Moose - A postmodern object system for Perl 5"
http://search.cpan.org/dist/Moose/lib/Moose.pm

a framework for web applications
http://www.jifty.org/view/HomePage

I know catalyist:
http://www.catalystframework.org/
it does a great job on a MVC point of view, but is overpowering for
90% of my apps

and "dubbed as a cross between Java's JAR and Perl2EXE/PerlApp"
http://par.perl.org/wiki/Main_Page

seems nice!

--
http://www.stefanobrozzi.com

--
http://www.stefanobrozzi.com

Monday, July 14, 2008

perl pack() & unpack()

nice documentation (well: the man page in HTML format)

http://perldoc.perl.org/functions/pack.html

MYSQL: convert null as 0

IFNULL():

like in:
SELECT IFNULL(field, 0) FROM tab;

firefox speed up

some speed increase can be obtained with some modifications
in firefox parameters:

about:config

setting to true

network.http.pipelining
http.proxy.pipelining


and setting at the value of 8
network.http.pipelining.maxrequests

Wednesday, February 06, 2008

check up agent, how to remove


given this error:
Throttling respawn: Will start in 10 seconds
2/6/08 5:05:03 PM com.apple.launchd[1] (com.app4mac.CheckUpAgent[5367]) posix_spawn("/Applications/CheckUp.app/Contents/MacOS/CheckUpAgent", ...): No such file or directory



on a terminal

sudo rm /Library/LaunchDaemons/com.app4mac.CheckUpAgent.plist