THE LATEST
The following are some useful commands to figure out which directory is consuming all of your disk space.
You can use the df command to find your disk free space for your mounted filesystems, for example :-
Show Plain TextText code
# df -h -T
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 ext3 57G 15G 39G 28% /
tmpfs tmpfs 1.9G 0 1.9G 0% /lib/init/rw
udev tmpfs 10M 52K 10M 1% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm
The du cammand can be used to give your disk usage information, for example :-
Show Plain TextText code
# ls | du -ch
52K ./mysql
4.0K ./bittorrent
20K ./apt
136K ./ntpstats
4.0K ./samba/cores/smbd
4.0K ./samba/cores/nmbd
12K ./samba/cores
4.9M ./samba
4.0K ./iptraf
540K ./apache2
12K ./fsck
56K ./exim4
4.0K ./news
9.2M ./installer/cdebconf
9.8M ./installer
21M .
21M total
The CakePHP dev's have made it super simple to display your cakephp version, I have only just stumbled across it when looking for something else in the API. Like me you might not have spotted it, its not an essential bit of code but a nice to have for those administering many sites on various servers and much better than finding the version text file on each install. I display the version number in the system setup part of the sites admin dashboard along with other framework related settings...
On the odd occasion your Linux box will lock up and won't appear to be working, at this point you go darn I'd love to do a controlled shutdown, here's one way of rebooting your local or remote Linux box...
Sometimes you need to only only list the directory names under Linux, a simple command for this is...
Sometimes you need a cron job at a frequency less than the minimum of 1 minute (60 seconds) that cron allows. One way of achieving this is by...
This is a basic example of how to use the CakePHP paginator helper with the group by condition, it took a little mucking around but this is how I got it working.
In this example we have a Comment controller which I want to paginate a custom query displaying an IP address and a calculated count field of the number of spam comments from this particular IP address...