Monday, March 4, 2013

Find largest file in moodledata

SELECT DISTINCT filename, filepath, FORMAT( (filesize /1024 /1024), 1 ) AS filesize_MB, contenthash, component
FROM `mdl_files`
ORDER BY filesize DESC
LIMIT 0 , 30

Thursday, December 20, 2012

Apache subfolder setup

This tutorial is explain how to setup a subfolder but the location is not inside the html folder, instead, it can be located parallel to the html


Alias /subdirectory /path/to/real/subdirectory

Wednesday, December 19, 2012

How to setup cron for ELIS RLIP

This tutorial is to set cron to run every 5 minutes for the ELIS RLIP block

#crontab -e

then enter line below
5 * * * *  nice php /mnt/data/www/pathtomoodle/blocks/rlip/rlip_cron.php >/dev/null 2>&1


Tuesday, November 13, 2012

How to remove IP manually from cpanel

1 Bring down the ip first
for example ifconfig eth0:cp3 xxx.xx.xx.xx netmask 255.255.255.0 down

2. Edit /etc/ips and remove the line with the corresponding ip

3. Run this command /etc/init.d/ipaliases restart

Thursday, October 11, 2012

Some example for httpd.conf



  DocumentRoot /path/to/domainname
  ServerName domainname
  redirect permanent / https://domainname/
 Alias /sandbox /path/to/domainname/sandbox



The above is just an example on how to setup the virtualhost on apache
The Alias is like a subfolder inside the public_html but you can put the folder in parallel to the public_html.

Thursday, September 6, 2012

Wednesday, August 22, 2012

Recover mysql root password

You can recover MySQL database server password with following five easy steps.

Step # 1: Stop the MySQL server process.

Step # 2: Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for password.

mysqld_safe --skip-grant-tables

Step # 3: Connect to mysql server as the root user.

Step # 4: Setup new mysql root account password i.e. reset mysql password.


mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit



Step # 5: Exit and restart the MySQL server.