Thursday, July 25, 2013

Fix Microsoft SQL missing login name after db copy/move

To fix the missing login name, just execute this

EXEC sp_change_users_login 'UPDATE_ONE','Annie','Annie'

replace Annie with the name of the user

To find out the list of broken / orphaned users, you can execute this

EXEC sp_change_users_login 'REPORT'


On SQL 2005 and above, this is the query to fix

use dbname;
EXEC sp_change_users_login 'Auto_Fix', 'username', null, 'password'

Monday, July 1, 2013

Trace running php script

To see more details on running php script, you can just use
strace -p pid

Wednesday, June 5, 2013

Login using manual user to Moodle with Cas authentication

http://moodleurlhere/login/index.php?authCAS=NOCAS&username=admin

Change the moodleurlhere with your domain name

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