cakephp 2 rc1
June 15th, 2008At last, cakephp 1.2 rc1 is finally here.
Download it now, or go to the official website: http:www//www.cakephp.org
At last, cakephp 1.2 rc1 is finally here.
Download it now, or go to the official website: http:www//www.cakephp.org
Identifying slow db queries is critical for the optimal operation of the db server. There is an excellent guide that helps to accomplish this task: http://www.ducea.com/2006/11/06/identifying-mysql-slow-queries/
use this code to rotate the apache logs in /etc/httpd/logs/ The logs in /etc/httpd/domlogs are rotated according to setting in WHM -> Tweak settings
Recently I bought a new hard drive for my ubuntu box to use it as a primary disk. I didnt want to re-install every piece of software, so I created a clone of my old disk to the new.
This is the linux command I used:
dd if=/dev/hdb of=/dev/hda bs=1M
What this command does, is to tell the system to copy every byte of data in 1MB increments from the /dev/hdb drive to the /dev/hda drive. In order to do this, you will have to boot from a live cd.
My system used the secondary hard drive as the main drive.
The old disk was an 80gb seagate drive, while the new is an 250gb, also seagate. The process completed around 40 minutes later. The next step was to change the grub menu.lst and replace every occurrence of hdb to hda. I could avoid this step if I made the new drive a secondary drive instead of primary. I also had to change the occurences of hdb to hda in the /etc/fstab file.
Then, I unplugged the power cable from the old hard drive, changed the boot drive bios setting and rebooted the system. Everything worked perfect.
When I used the 'Gnome Partition Editor' application to view the partitions of the new hard drive, I saw that all partitions were duplicated from the old drive to the new. The remaining space was unallocated, so I formatted as a new ext3 partition.
This might be useful:
http://www.ubuntu-nl.org/source-o-matic/
It is a generator for the /etc/apt/sources.list file
This guide will help you install the sun java version without having to deal with fakeroot.
Edit your /etc/apt/sources.list file
Add the following (if not already there)
deb http://us.archive.ubuntu.com/ubuntu dapper main restricted
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse
Run:
sudo apt-get update
and
sudo apt-get install sun-java5-jdk
Accept the license agreement
If you have already installed an older java version run:
sudo update-alternatives --config java
and chose the appropriate version:
msti@msti:~$ sudo update-alternatives --config java
There are 3 alternatives which provide `java'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
*+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
3 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
Press enter to keep the default[*], or type selection number: 3
Using `/usr/lib/jvm/java-1.5.0-sun/jre/bin/java' to provide `java'.
If your mysql database is not as fast as it used to be, maybe it is a good idea to activate the slow queries log. Add the following lines in your .my.cnf file:
All the queries that take more than 2sec to execute will be logged in the /var/log/mysql-slow-queries.log file
Ok, this is fascinating. I love cakephp and also love joomla. When I found out about this, I got very excited. Have not tested it yet, but I am going to very soon.
Jake is the child of joomla and cakephp.
Jake is a component that lets you execute your CakePHP applications inside Joomla. It is meant to provide a transparent bridge between Joomla and CakePHP, allowing your applications to be run with or without Joomla, with absolutely no need to change your existing code.
Jake is still in beta stages, but I am sure that we are going to have a stable release soon.
More info about it at Jake website.
Have you ever came across a situation where you wanted an image to download instead of having the browser to display it? This is how you can do it . Enter the following code in a php file foo.php and call it like foo.php?file=myimage.jpg. Then a browser save dialog box will appear.
If you want to do the same with other kind of files like video etc, just replace the 'image/jpg' above with on of the following:
"pdf": "application/pdf"
"exe": "application/octet-stream"
"zip": "application/zip"
"xls": "application/vnd.ms-excel"
"ppt": "application/vnd.ms-powerpoint"
"gif": "image/gif"
"png": "image/png"
"jpg": "image/jpg"
"mp3": "audio/mpeg"
"mp3": "audio/mp3"
"wav": "audio/x-wav"
"mpe": "video/mpeg"
"mov": "video/quicktime"
"avi": "video/x-msvideo"