Skip to main content

Posts

Showing posts from 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 ;)

CapitalizeWords.java

I need to make my string sentence to be capitalize on each first character of word, So far haven't find such function that I can use. So made this simple class, incase someone need it. It's GPL so free to use it and modify it. import java.util.Scanner; import java.util.ArrayList; import java.util.Iterator; import java.lang.StringBuilder; /** * * @author avenpace * I'm using singleton here so, hope you know what that means ;) * license under the GPL so free to use, modify and hack whatever you want * lemme know if this programme benefit you if you had the time */ public class CapitalizeWords { private static CapitalizeWords capinstance; private CapitalizeWords() { } /** * The method will capitalizing every first character on each word on the String sentence * This method take two parameter, * @param source source sentence string that you want to capitalize on the first character if each word. * @param allword this argument

Fucked up chaintech and ecs

My pc at home was suddenly broke like 3 month ago before I went to Zagreb. So after doing some hardware test, turn out my 7aivl chaintech without a clear reason got bios corrupt and it onboard vga died. Damn cheap mobo!!!!! So I went to computer store looking for socket A mobo and finally found it at this computer store named edicom at Harco Mangga dua. So I bought that ECS k7s5a pro. So I install it after got home, and walaaahhh.... that FUCKING brand new mobo not showing any sign of life what so ever, fuck me!!!!!! So I go back the next day to the store where I bought that damn thing, and the store technician check it and said to me that my Duron proc dead for sure.... WTF!!!!!! So I went home again, curious with that dumb technicision and check the proc my self using other mobo, and viola..... the proc running just fine, but not in ECS k7s5a pro. I leave it untouch for like 3 month coz I was in Zagreb for the whole time and ECS k7s5a pro still can't run my Duron. When I got home
It's now 21.38 GMT+1. Tomorrow morning I'm gonna leave Zagreb and going back to Jakarta and now kinda bit snowy outside. It was really fun here and like it so far. The city is not so crowded like Jakarta not mention the geek scene here , I'm definetly gonna miss this place. Hopefully will had the change to come again and doing other FLOSS hack. Hvala Zagreb! Hvala Croatia! Hvala Mama!
Don't really bother with syntax coloring on vim 'till now So to make syntax coloring on vim, edit "/etc/vimrc" and add "syntax on set backspace=indent,eol,start"
Another notes for me, in mysql version 4, at least the one that on my SuSE 10. If I create user and give permision to do all things and assign host anything beside localhost. I wont be able to login to mysql console. And now my mysql_connect() on my php script wont work unless I use 127.0.0.1 for the db host. Dunno why, I'll figure out this later
Been while since I post my last blog and playing with php. So to remind my self about getting value from POST and GET in php. When you have url like http://lame.com/script.php?duh=ownotagain You can just straight echoing inside the script like echo $duh; Just notice that the newer php, that thing doesn't work anymore. For the url that I've mention above, that mean it use the GET method, if you want assign the duh variable to you php script, you gotto do like this $duh = $_GET['duh']; echo $duh; It then will give you ownotagain on your browser. Yeah I know.... I'm totally moron just figure that out :D Ummmm, 1,5 week again before I return home, so still have to deal with this damn cold winter Guess, I'll miss Zagreb coz this is really nice town to be around