Posts

Showing posts from 2007

Moodle error: Query failed in load_user_capability

In Moodle 1.8 platform, whenever you encounter the captioned error during login, the /var is likely to be full. The solution, obviously... clean up the /var to feed more free space to it.

Tracing IP and e-mail header information

I found some resources for tracing IP and e-mail header stuff... Find the IP of the e-mail sender via header: http://www.infobanc.com/articles/faida5_12.htm Trace the IP location: http://visualroute.visualware.com/

List and comparisons of emulators...

Mayank Sharma provided a nice articles on some alternative emulators other than VPC: Ref:  http://www.linux.com/articles/60742 They are QEMU, Bochs, Virtual Box, VMware Player and VMware server...

phpgraphy album title length

The title length of albums could be modified at: found in file "/base/include/yorsh-varval-request_data.inc.php" field dirtitle verison 0.93.

apache: /libphp5.so: cannot restore segment prot after reloc: Permission denied

If apache cannot start, with error: /libphp5.so: cannot restore segment prot after reloc: Permission denied, try the following: % setenforce 0

VsFTP 500 OOPS: cannot change directory

cannot change directory:/home/*** 500 OOPS: cannot change directory:/home/******* 500 OOPS: child died Solution (in prompt) % setsebool ftpd_disable_trans 1 % service vsftpd restart To make the effect working even reboot, add option -P in setsebool Reference: http://www.phpchina.com/14881/viewspace_8888.html

Using find command in Unix

Just for my memory... find . -exec grep "keywords" '{}' \; -print This handly statement finds files contains "keywords" and print the line and the file name as well. Ref: http://www.athabascau.ca/html/depts/compserv/webunit/HOWTO/find.htm#EX03

Context level of Moodle

From lib/accesslib.php 25 // context definitions 26 define('CONTEXT_SYSTEM', 10); 27 define('CONTEXT_PERSONAL', 20); 28 define('CONTEXT_USER', 30); 29 define('CONTEXT_COURSECAT', 40); 30 define('CONTEXT_COURSE', 50); 31 define('CONTEXT_GROUP', 60); 32 define('CONTEXT_MODULE', 70); 33 define('CONTEXT_BLOCK', 80);

MS Word closed right after it starts

Whenever you experience this sort of problem, most likely it will be the problem of file: normal.dot Try to seek and delete that file to solve the problem. Ref: http://word.mvps.org/FAQs/AppErrors/ProbsOpeningWord.htm

Create create VPN connection in Windows XP

In Windows XP, make sure the Telephony, Remote Access Connection Manager, and Remote Access Auto Connection Manager services are running. Ref: http://support.microsoft.com/default.aspx?scid=kb;en-us;329441

php_mysql.dll problem in Apache

Apache startup error message: PHP Startup: Unable to Load Dynamic library 'C:\PHP\ext\php_mysql.dll - The specified module could not be found. Solution: Copy the libmysql.dll from the main php folder to \windows\system32

Using EditItemTemplate for InsertItemTemplate in FormView (ASP.NET)

There is a nice way to reuse your hardly made EditItemTemplate in the InsertItemtemplate. Found in ASP.NET forum: protected void FormView1_Init ( object sender, EventArgs e) { FormView1.InsertItemTemplate = FormView1.EditItemTemplate } protected void FormView1_DataBound( object sender, EventArgs e) { if (FormView1.CurrentMode == FormViewMode.Edit) { LinkButton InsertButton = FormView1.FindControl( "InsertButton" ) as LinkButton; LinkButton UpdateButton = FormView1.FindControl( "UpdateButton" ) as LinkButton; InsertButton.Visible = false ; UpdateButton.Visible = true ; } else if (FormView1.CurrentMode == FormViewMode.Insert) { LinkButton InsertButton = FormView1.FindControl( "InsertButton" ) as LinkButton; LinkButton UpdateButton = FormView1.FindControl( "UpdateButton" ) as LinkButton; InsertButton.Visible = true ; UpdateButton.Visible = false ; } } Ref: http://forums.

P2P Service in Windows

Nice try.. > net start p2psvr >netsh >p2p pnrp clould

String Concatenation in SQL Server

When using '+' to concatenate two string field in SQL server (e.g. a+b), if one of them is NULL, then the whole string will become NULL. There is one solution to solve it: COALESCE(a,'') + COALESCE(b,'') So if any of the field is NULL, it will evaluate as an empty string. That's it!

Just played around with Greasemonkey

I'm not a javascript expert, but just played around using js in greasemonkey, quite funny. // ==UserScript== // @name FilterGuruEntry // @description Filter Guru Entry // @include http://www.guru.com/pro/search_results.cfm* // ==/UserScript== var allTRs, thisTR; allTRs = document.getElementsByTagName('SPAN'); for (var i = 0; i < allTRs.length; i++) { thisTR = allTRs[i]; if (thisTR.getAttribute("class") == "btblue") { myTR = thisTR.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; myTD = thisTR.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; if (myTR.nodeName == "TR") { myTR.removeChild(myTD); } } }

SQL Express installation messages

In case you just skip the post-installation messages... that may helps :P Configuring and Managing SQL Server Express ·    For improved manageability and security, SQL Server 2005 provides more control over the SQL Server surface area on your system. To minimize the surface area, the following default configurations have been applied to your instance of SQL server: o    TCP/IP connections are disabled o    Named Pipes is disabled o    SQL Browser must be started manually o    OPENROWSET and OPENDATASOURCE have been disabled o    CLR integration is disabled o    OLE automation is disabled o    xp_cmdshell is disabled To enable or disable features and services, run the SQL Server Surface Area Configuration tool from the Start menu. ·    To install SQL Server Management Studio Express Edition, download it from the SQL Server Developer Center on MSDN (http://go.microsoft.com/fwlink/?linkid=51793). Documentation and Samples To install SQL Server 2005 Books Online, download them from the SQL

AutoIncrement in .NET and Autonumber in ACCESS

From my experience, try to avoid turning on both AutoIncrement (in DataColumn) in .NET and Autonumber in MSAccess at the same time. As somehow there is just no communication between them. They just work on their own. For example, when you have records in ACCESS having ID (1,2,3,4) and suppose the next ID be 10 (as doing some record add and delete before). AutoIncrement in .NET just don't know about it as it's AutoIncrementSeed can just automatically set to 5. Then 10 vs 5, I hope you can see how the problem being occurred. So avoid having them both at the same time.

Literal vs Label

When working with .NET, you may wonder the difference between Literal and Label . Actually, when both controls are converted to become HTML, Label will add a pair of <span></span> tag, while Literal keeps everything unchanged. So most of the time if would be better to use Literal instead of Label for the sake of simplicity.

Re-installing WMI

For those folks out there using Windows Server 2003 SP1 Build 1277 along with the SQL Server 2005 December CTP, you may be unable to install SQL Server 2005 with the following error: Microsoft SQL Server 2005 Beta 3 Setup The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine SI4P64LF3-05 Error:2147749907 (0x80041013). The cause of this error is a corrupt install of WMI, caused by upgrading Windows Server 2003 to SP1 build 1277. To fix this issue, copy the following into notepad and save it with either a .cmd or .bat extension. Then run the script to re-install WMI: %SYSTEMDRIVE% CD %windir%\system32\wbem Mofcomp.exe cimwin32.mof Regsvr32 /s wbemupgd.dll Regsvr32 /s wbemsvc.dll wmiprvse /regserver If that doesn't work, try the info here posted on MSDN . Ref: http://blogs.msdn.com/jpapiez/archive/2004/12/09/279041.aspx