Skip to main content

Posts

Showing posts from October, 2006

failed create midcom

I try to create midcom site, when I run following command php /usr/local/lib/php/midcom/lib/midgard/admin/sitegroup/bin/create-host.php -u admin -p password --sitegroup_id 0 --topic_midcom midgard.admin.sitewizard --hostname localhost --host_prefix /sitewizard --extend_style template_Midgard --topic_name "Midgard Site Wizard" I got the following error PHP Warning: main(/usr/local/lib/php/midcom/lib/midgard/admin/sitegroup/bin/../../../../midcom/helper/hostconfig.php): failed to open stream: No such file or directory in /usr/local/lib/php/midcom/lib/midgard/admin/sitegroup/bin/create-host.php on line 19 Warning: main(/usr/local/lib/php/midcom/lib/midgard/admin/sitegroup/bin/../../../../midcom/helper/hostconfig.php): failed to open stream: No such file or directory in /usr/local/lib/php/midcom/lib/midgard/admin/sitegroup/bin/create-host.php on line 19 PHP Fatal error: main(): Failed opening required '/usr/local/lib/php/midcom/lib/midgard/admin/sitegroup/bin/../../../../mi

java MessageDigest

If you use MessageDigest in java to encrypt string, you wont get hash like other language does. So you need to convert the result so that you can compare the hash result with other output that produce by diff language. Found the function on the java net forum private static String baToHexString(byte byteValues[]) { byte singleChar = 0; if (byteValues == null || byteValues.length <= 0) return null; String entries[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; StringBuffer out = new StringBuffer(byteValues.length * 2); for (int i = 0; i < byteValues.length; i++) { singleChar = (byte) (byteValues[i] & 0xF0); singleChar = (byte) (singleChar >>> 4);

table corrupt in mysql

My server just ran out of space recently, so I do some cleanup. Then my friend complain about several web app act abnormaly, turn out several db on mysql got table corrupt. The error sound like "Can't open file: 'TableName.MYD'. (errno: 145)" So to fix it, logon to mysql console, and type "REPAIR TABLE TableName" And don't forget to select the db first ;)