Thursday, April 5, 2012

Upgrade to moodle 2 issue and fix

If upgrading from 1.9 to moodle 2 and you're running into issue like

!! Data too long for column 'questiontext' at row 1

Fix is

Running ALTER TABLE mdl_question MODIFY questiontext MEDIUMTEXT;

Sunday, April 1, 2012

Moodle 2 moodledata directory

Here is the info for moodledata directory in moodle 2

For example
moodledata/filedir/d2/90/d2901f1f5f46134bd8cd767448c1da7daf9a41a2

Then connect to the Moodle 2 database and run a query

SELECT * FROM mdl_files WHERE contenthash = 'd2901f1f5f46134bd8cd767448c1da7daf9a41a2';

Thursday, March 29, 2012

Moodle Timezone add UTC+14

Edit the moodle/lib/moodlelib.php and do a search for get_list_of_timezones() and change 13 to 14

USB Mouse not working in XP SP3

If you plug in USB Mouse and getting hid class error complaining about some windows 95 incompatible INF, here is the fix

1. Open %windir%\inf folder (Must show hidden files)
2. Backup and delete these files:

- INFCache.1
- msmouse.pnf
- input.pnf

3. Open a command line and run
Net stop Cryptsvc
4. Backup and delete this folder “%windir%\system32\catroot2”
5. Reboot the computer to make sure the information was clean up.
6. Insert USB mouse to another port which hasn’t been used before.

Thursday, February 9, 2012

How to find orphaned modules in moodle

SELECT cm.id, m.name AS modname FROM mdl_course_modules cm JOIN mdl_modules m ON m.id = cm.module WHERE cm.course = 1398 AND cm.section = 1513;

then list will show up.
delete from mdl_course_modules where id = 1523; (replace the id that associate with book and chat)

Sunday, February 5, 2012

Error during installing Office 2007 about protected file

Extract file I386\FP40EXT.CAB on the windows xp CD and then look for fp4ault.dll

Copy this file to c:\program files\common files\microsoft
shared\web server extensions\40\bin

The install should work.

Thursday, February 2, 2012

easyapache with ldap.so / mssql.so

Custom Configure Flags

Custom configure flags (also known as “raw opts”) are lines of data that advanced users can add to a specific file on the server in order to customize the configuration of Apache or PHP builds.

To add custom configure flags, you must know the version of Apache and PHP to which you need to add the flag. EasyApache allows you to specify any configure option supported by Apache and/or PHP. Simply place the option in the appropriate file; the files are as follows:

For Apache 1.3.x — /var/cpanel/easy/apache/rawopts/Apache1
For Apache 2.0.x — /var/cpanel/easy/apache/rawopts/Apache2
For Apache 2.2.x — /var/cpanel/easy/apache/rawopts/Apache2_2
For all PHP 4.x versions — /var/cpanel/easy/apache/rawopts/all_php4
For all PHP 5.x versions — /var/cpanel/easy/apache/rawopts/all_php5
For Mod_suPHP — /var/cpanel/easy/apache/rawopts/all_suphp
For a specific PHP Version — /var/cpanel/easy/apache/rawopts/PHP-X.X.X

To add a custom flag:

Create the file that corresponds to the version of Apache or PHP for which you would like to add a custom configure flag.
In the file, enter the flag you wish to add.
The file will be parsed, and the options properly formatted before EasyApache adds them to the data structure.
See the example below for more information about formatting your custom flags.
Save the changes you have made to the file.

Remember: Enter only one item per line.

--with-flag

--path-to-flag=/usr/bin/flag

--my-option=

This will result in the following being added to the configuration file:

--with-flag --path-to-flag=/usr/bin/flag --my-option

*************************** For mssql ***************************************


INSTALLING FREETDS

1-. Download freetds -> www.freetds.org
2-. tar -zxvf freetds-stable-tgz
3-. cd freetds-*
4-. ./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld

Note: tdsver=8.0 if you use SQL 2000, tdsver=7.0 if you use SQL 7.0

5-. make
6-. make install
7-. /usr/local/freetds/bin/tsql -S -U

Note: For default User SQL is sa and the it have not password
For example: /usr/local/freetds/bin/tsql -S 198.168.100.2 -U sa

8-. Add the next text in freetds.conf ( /usr/local/freetds/etc )
[TDS]
host =
port = 1433
tds version = 8.0

Note: If you use SQL 2000 then tds version = 8.0
if you use SQL 7.0 then tds version = 7.0

9-. Add the following line in the file /etc/ld.so.conf and run ldconfig -v:
/usr/local/freetds/lib

10- Recompile PHP with --with-mssql=/usr/local/freetds flag.