Friday, June 26, 2009

Terlupa or buat2 lupa

kadang2 org ni kan... x tau la betul2 dia terlupa or buat2 lupa...

but kene ingat la...

"lembu dipegang pada tali..manusia dipegang pada janji.."

Kita cuba nak jaga hati dia, x nak la tanya berulang2 kali.. paham2 sendiri la.. kang duk tanya berulang kali kata x reti bahasa pulak... dah tu kalau x ditanya buat2 lupa plak..

duhhhh.....

UiTM Arau

aku tiba2 teringat zaman2 aku study kat itm arau..


View UiTM Arau in a larger map

Byk sangat kenangan kat sini. pahit, manis & payau... telan je la labu... hahahhaha

Monday, June 22, 2009

Memancing di semenyih

Gambar lama. baru jumpa balik... tahun lepas g memancing d semenyih dgn Yen & Sham (nachosnachos.com)

hasilnya ikan Patin 2.5kg dgn Haruan 1.9kg... hahahha...

Sekarang ni tgh gantung joran... wife pregnant... mak x bg memancing kalau wife pregnant... hahahahaha

Father's Day gift from Ibu

Thanxs ibu bg abah hadiah hari bapa. hehehe ingat x dpt.. rupa2 nya ada gak.. hahahhaa...

x abis baca lg..

Saturday, June 20, 2009

Happy Father's Day

Happy Father's Day to all fathers..

Selamat hari bapa kepada semua bapa-bapa...

td aku dpt SMS dr kenalan. ditujukan utk bapa2 sekalian..

PENGUMUMAN HARI BAPA.
Semua bapa layak menuntut REBET
dari isteri anda bermula jam 10 malam ini.
Kepada bapa-bapa yang memiliki isteri berusia
18-29 tahun boleh tuntut 3 kali
30-45 tahun boleh tuntut 2 kali
45 tahun ketas boleh tuntut 1 kali.
MONOPOUSE tidak layak menunutu. Pndai2lah bawa diri.
SELAMAT HARI BAPA..

hehehhehehehhe nice dude... hahaha

Thursday, June 18, 2009

Reverse Proxy

Aku start kenal/bermain dgn reverse proxy setelah diperkenal kan oleh sepupu aku, bro sazly.

byk kegunaan dia, but yg pasti dia solve kan problem aku bermain dgn multiple web server utk satu2 project.

biasanya aku bermain reverse proxy sekitar apache, sambar server & IIS.

  • Apache -> Sambar server
  • Sambar server -> Apache
  • Sambar server -> IIS
  • Apache -> IIS

    Apache:
    setting di httpd-vhosts.conf

    ProxyPass / http://somesite.mysite.com:8080/
    ProxyPassReverse / http://somesite.mysite.com:8080/
    

    Sambar server:
    setting di vhosts.ini

    Reverse Proxy Server = http://somesite.mysite.com:8080
    

    loading time akan lebih skit sebab setiap request akan diproses oleh 2 web server.

    kegunaan lain nya adalah utk membenarkan request masuk melalui single port sahaja utk http or ftp. kemungkinan sesetengah organisasi hanya benarkan capaian ke port 80 je dari luar.. so utk applikasi yg dohostkan di port selain port 80, kita leh gunakan reverse proxy.

  • Civic 1.7

    surfing di mudah.my.. terjumpa ada sebijik honda civic antara yg aku minta nak dijual. http://www.mudah.my/Honda-civic-1.7-vti-3272475.htm

    harga jual : RM 55,900

    ermm... kalau la aku ada cukup duit... mmg dah lama aku sambar model ni... aku suka simple design dia...

    teringin nak bekereta baru... tapi tu la... financial aku x stable lg... mengharap janji manis yg ntah bila tertunai...

    kadang2 naik bosan... tunggu dan lihat dulu.... this year ada balance lg 6 bulan+-... kalau x da apa2... it's time......

    Auto Generate Subdomains form a Subdirectory of a Site

    this script will automatically(on the fly) translate/resolve subdomian into dedicated folder path.
    without touching web server config(

  • only touch the config for 1st time config only la...).

    eg:

    main domain name:
      http://mysite.com

    main vhost doc root:
      /usr/local/www

    Folder inside:
      /usr/local/www/brother
      /usr/local/www/sister
      /usr/local/www/mother
      /usr/local/www/father
      /usr/local/www/inlaw
      /usr/local/www/cucu
      /usr/local/www/cicit
      /usr/local/www/oneng2
      ........

    so

    when browser open url:
      http://mysite.com/

    it will display:

  • brother
  • sister
  • mother
  • father
  • inlaw
  • cucu
  • cicit
  • oneng2

    But when browser open url:
      http://brother.mysite.com/

    it will display:
      content inside folder 'brother', and can view everything inside this folder.

    The Script:

    #!/usr/bin/perl
    ########################################
    use CGI::Carp qw(fatalsToBrowser set_message);
    BEGIN {sub handle_errors { my $msg = shift;
    print qq|Server Error
    

    Web Server Error!

    $msg

    Please inform the mbek about this error.\n|;} set_message(\&handle_errors);} ######################################## use CGI; ## Set a few variables ############################################################## my $hostname = "site.williams"; my $perlexe = "c:/programs/perl/bin/perl.exe"; my $phpexe = "C:/Programs/server/php/php.exe"; ############################################################## if (exists $ENV{'PATH_INFO'}) { $uri_info = $ENV{'PATH_INFO'}; $uri_info =~ s/alias\.pl//; $uri_info =~ s/^\///g; } elsif (exists $ENV{'DOCUMENT_URI'}) { $uri_info = $ENV{'DOCUMENT_URI'}; $member_url =~ s/^http:\/\/.+?\///; $uri_info =~ s/^\///g; $uri_info =~ s/^$member_url//; } else { $uri_info = ''; } my $hosts = $ENV{'HTTP_HOST'}; my $sysdir = $ENV{'DOCUMENT_ROOT'}; my $script = $ENV{'DOCUMENT_NAME'}; my ($hostid,$host) = split /$hostname/, $hosts, 2; $hostid =~ s/\.$//; $sysdir =~ s/\/$//; $sysdir .= "/$hostid" if $hostid; $uri_info =~ s/$script//; $uri_info =~ s/^\///; $uri_info =~ s/\/$//; my $file = "$sysdir"; $file .= "/$uri_info" if $uri_info; $file =~ s/\/$//; if(!-e "$file"){ print "Content-type: text/html\n\n"; print "Invalid Path ($file)"; exit; } if(-d "$file"){ print "Content-type: text/html\n\n"; # load all files of the "data/" folder # into the @files array opendir(DIR, "$file"); my @files = readdir(DIR); closedir(DIR); if(@files){ print "

      "; foreach $file (@files) { next if ($file eq "." or $file eq ".."); my $folderpath; if($uri_info){ $folderpath = '/' . $uri_info . '/' . $file; }else{ $folderpath = '/' . $file; } $folderpath = "/". $script . $folderpath if $script && $uri_info ne $script; print "
    • $file
    • "; } print "
    "; }else{ print "Folder is empty"; } exit; }else{ if($file =~ /\.pl$/i || $file =~ /\.cgi$/i){ #handle perl/CGI my $result = `$perlexe $file`; print "$result"; exit; }elsif($file =~ /\.php$/i){ #handle PHP my $result = `$phpexe $file`; print "$result"; exit; }else{ use File::MMagic; my $mime = File::MMagic->new(); print "Content-type: " . $mime->checktype_filename($file) . "\n"; #The Content-Disposition will generate a prompt to save the file. If you want #to stream the file to the browser, comment out the following line. #print "Content-Disposition: attachment; filename=$filename\n"; print "\n"; binmode STDOUT; if($mime->checktype_filename($file) =~ /image\/png/i){ use GD; my $contents = GD::Image->new( $file ); print $contents->png; }else{ my $fh = new IO::File($file, "r"); my $contents = get_contents($fh); print $contents; } exit; } } exit; ############################ sub get_contents { ############################ my $in = shift; my $ret = ""; while (<$in>) { $ret.= $_; } return $ret; }

    and this apache httpd-vhost.conf

    <VirtualHost *:80>
            ServerAdmin me@mysite.com
            DocumentRoot "/usr/local/www"
            ServerName mysite.com
            ServerAlias mysite.com
    
            ErrorLog "logs/mysite.com-error.log"
            CustomLog "logs/mysite.com-access.log" common
            Options +Includes
            AddHandler server-parsed .html
    
            <Directory "/usr/local/www">
                    AllowOverride None
                    Options Indexes FollowSymLinks ExecCGI
                    Order allow,deny
                    Allow from all
            </Directory>
            
            RewriteEngine On
    	RewriteRule /(.*)$ /alias.pl/$1 [L]
    </VirtualHost>
    

    use at your own risk...

    happy coding..

  • Wednesday, June 17, 2009

    Target

    my Next target
    • My Own House
    • Toyota Wish/Caldina
    • Integra Type-R
    • Holiday to New Zealand/Japan
    • Mobile Phone complete with GPS and latest tech
    • Home Theatre
    • Mountain Bike
    amin...

    Monday, June 15, 2009

    Birthday @ 18SX

    aku nak tergelak dgn kek hadiah yg makcik wife aku bg kat hubby dia...Creative

    Dia mmg pandai buat kek... so dia buat special utk hubby dia... hahahhahaha...caya la mak wa... leh la ajaq along lak lepas ni.... hahahahha

    for more pic.. go to... http://anirzam.fotopages.com

    Memasak

    My wife tgh menempuhi morning sickness... memandangkan dia x berapa larat utk memasak.. kadang2 kalau ada kerajinan... aku yg mencuba masak apa2 yg ada didapur...

    hahahha setakat ni wife aku masih boleh telan apa yg aku masak... walaupun x sesedap mana... hehehhehe... ataupun dia sengaja nak menyedapkan hati aku... hahahha

    sebenarnya aku suka memasak... cuma x reti jer... aku fail bab nak merasa... yg aku tau x sedap... kurang garam or kurang apa aku x tau... kekadang wife aku jadi tukang rasa... hahahhaa....

    semalam aku buat nasi lemak... hehehhe wife aku masak nasi aku buat sambal tumis ikan bilis... ermmmm wife aku komplain manis katanya... hahaha... aku main tabur je gula takut terpedas sgt... hehehhehe...

    Tapi kalau aku kat dapur wife aku mesti begang... dapur besepah... hahahahhaa...

    Converting PDF to Image using Ghostscript

    before this, i'm converting from PDF to image using ImageMagick. it working fine for me then.

    but for my current project, image need on higher resolution for better manipulation. so after goggling... simple command using ghostscript..

    gswin32c.exe -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 -sOutputFile=D:\tmp\page_0001.png D:\tmp\page_0001.pdf
    

    Genap 8 tahun

    Last week, Genap 8 tahun aku bekerja di onestop.

    what's next?

    Saturday, June 13, 2009

    my TAHR Framework

    i'm planning to rewrite my current CMS framework.

    planning to use HTML::template back as my template processing.

    basic Function

  • Multi site/domain support
  • Module Base.

    Current framework already more that 5 years old and base on ActivePerl 5.6, and it was build when i'm totally new with CGI/Perl. There's certain thing that can be enhanced.

  • Wednesday, June 10, 2009

    Balik Kampung

    Weekend aritu balik kg ... menjenguk mak yg x berapa sihat.
    sambil balik tu dpt la merasa suasana kampung yg tenang lg aman dan damai...
    Ibu yg tgh mabuk pun x teruk sgt... hehehe..

    Paling best balik kali ni..
    Beli durian dkt Bukit Pasir. durian Kampung. sekilo RM3. beli dlm 11kg. dia punya sedap... pergh....mmg berbaloi sgt2... compare beli durian kak shah alam/kl ni. x sempat masuk rumah.. depan pintu kitaorg bedal... hahhaha... sedap banget...

    Mlm tu pulak, mengadap ikan + sotong + kerang dibakar ikut cara kampung... meleleh beb... mlm tu kitaorg tertidor awal. kekenyanga... teruk betul perangai.

    esok nya kak nah + abg mie balik kg gak... g pasar beli ketam + udang. tgh hari tu, mak yg tgh sakit2 tu masakkan ketam masak cili utk kami... perghhhhh... sedap banget...
    tgh hari tu mmg byk mak masak... kami tinggal makan jer... kerang masak pindang, sup ayam, daging batang pinang masak kicap... pergh.... sedap....

    PSSSTTTTT!!!!!..... on da way balik kami singgah PD... isk... jgn bgtau sesapa...tunggu gambar dari cik nah..

    Pakcik Margono@PKM

    Bila kembali hangat berita pasal chin peng(PKM) ni, aku teringat dgn arwah pakcik aku... aku x tau apa jawatan dia dlm PKM, tapi dia antara nama yg org johor kenal zaman2 PKM dulu. dia rapat dgn abah aku. even masa aku kahwin tahun 2005 dia sanggup datang dari kuala selangor ke muar.

    Margono@Umar.

    org2 area bukit gambir/Muar kenal akan nama ini. dia dah meninggal dunia dlm 2/3 tahun lepas, xcident motor di area kuala selangor/ijok/paket 100. aku x sure nama tempat. tapi aku pernah pegi 2/3 kali rumah pakcik aku ni semasa hayat nya masih ada.

    saki baki hayat nya dihabis kan dgn mengusahakan tanah sawah yg dikurniakan oleh kerajaan masa dia menyerah diri dulu. org2 disekitar sana pun aku rasa x mengenali sgt siapa margono, masa silam nya. sebab kalau x silap aku dia dah ditukar nama selepas menyerah diri.

    Byk cerita yg aku dengar yg pakcik aku ni byk ilmu. tembak x lut la, hilang bila dikepung la dan mcm2 lg. tapi itu semua cerita org yg tidak ada bukti menyokong. tapi bila ditanya oleh kami, pakcik aku tu hanya ketawa jer.. dia kata ilmu apa... ilmu nak idup jer la... hahahha merendah diri betul.. tetapi cerita yg dia dikepung di satu kawasan berpaya tetapi still dpt melepas kan diri tu mmg cerita betul... cuma cara dia melepaskan diri x da sapa tau... dia x nak citer pun.... org buat andaian jer.

    Kerajaan masa tu menwarkan sejumlah habuan kepada siapa yg dpt tangkap Margono. tapi akhirnya Margono menyerah diri dengan menyuruh seorg pakcik tua dgn anak nya yg sedang menoreh getah, menunjukkan nya jalan ke rumah pasung(balai polis). org tua & anak nya tu x tau pun itu margono. hahaha... lepas sampai kat rumah pasung, baru la mereka tau org yg mintak tolong tu adalah margono... dgr kata pakcik tu menggigil ketakutan. hahahha.. kalau x silap aku pakcik tua tu dpt reward dari kerajaan. x sure betul or apa yg dia dpt la..

    Semoga Roh nya dicucuri Rahmat & di ampunkan dosa2 nya sekiranya ada. amin..

    Pamplet menyuruh matgono menyerah diri. aku dpt kat net.. credit tu muor76.

    Tuesday, June 9, 2009

    m i good enuf?

    very subjective...
    i really donno the answer...

    the more i know.... the more i know i don know...

    • can i demand more than what i get now?....
    • is there any other place for me in the real world outside there?
    • can i survive with this?
    • can i?
    ..................................

    Browse image@book google's style

    for my document indexing, i have to handle a lot of images generated from PDF file. thinking to develop web viewer as user friendly as it can. 
    google docs & picasaweb give me some rough idea..
    i'm thinking of:
    • load low res/thumbnail before loading actual image.
    • loading image message.
    • priority loading page/section requested by user.
    • background images loading n cache.

    working demo can be view here.

    next version will include javascript image object call. that will cache image for faster loading.

    5 days without net.... rasa mau gila wooo

    penat+penat=penat gila....

    khamis mlm aku balik johor..

    baru ptg td sampai shah alam balik...

    penat gila...

    nanti aku followup citer2 lain...

    Thursday, June 4, 2009

    Hahahahaha... silly mistake...

    hahaha... ada quote yg berkata... "back to basic" ... itu yg terjadi kepada aku bila aku punya perl/cgi upload x jalan. utk lebih 5 tahun aku gunakan framework aku sendiri yg so far x da masalah dan byk membantu aku. semua berjalan seperti yg di hajati bila running on top of ActivePerl 5.6... but... on top of 5.8>..... semua x jalan... hampes....

    the problem?..... hahahaha... new CGI cannot be call more than 1 time... hahahha... cipan btul... framework aku awal2 lg akan call 1 sub class yg akan reformat param utk memudahkan kerja... so bila aku call lagi sekali kat sub yg lain.... dia dah x jalan... i donno y. ini semua hanya berlaku kat perl 5.8 >.... 5.6 ok jer... maybe implementation strict kut... ntah la...

    silly me...

    case closed... happy...

    CGI Upload problem..

    damn... forgot this thing... already facing this kind of problem when i'm installing perl 5.8 on my client machine.

    with 5.10... the problem still the same... how to solve? argh!!!!!!!!!!!!!!!! last time i just change from 5.8 to 5.6...

    somebody.... help me.............

    Wednesday, June 3, 2009

    Migrating from Active Perl 5.6 to 5.8/5.10

    i've been using active perl 5.6 since it realeased... till now..

    i must step out from my comfort zone with 5.6. too many module require at least 5.8.
    the main reason i wanna upgrade to 5.8/10 is about their unicode support. i need to play more on unicode from now on... 5.8> better unicode handling compare to 5.6...hopefully.

    but i haven't decide yet, wether to choose 5.8 or 5.10..... donwloaded 5.8.... but seem like 5.10 more... *&^%..

    i'm facing problem with uploading from HTML with active perl 5.8 on top of redhat. the same script work on 5.6..but fail with 5.8.

    just give a try.... amin......

    Happy 3rd Besday Hairi

    Abg Hairi dah 3 tahun hari ini.

    tuk ma suruh tunggu sampai tuk ma balik baru sambut.

    so td ibu belanja abg hairi makan kek kat Secret Recipes. abg hairi order chocolate chip walnut.

    Javascript BookFlip

    Beta release..

    tested on IE, Firefox & Chrome...

    http://docs.mbek.net/index.pl?action=docviewer&req=bookflip&docid=1

    more than 300 pages? no problem.....

    currently support image using javascript image object. on progress use AJAX to load HTML,PDF etc... in to div container...

    Genting Highlands

    hari isnin lepas, abah & acik mie ada 'meeting' kat genting highlands. angkut sekali satu family masing2...

    hahahaa... lama x pegi genting. Danish juara haritu.... x merengek or nangis langsung... ceria sepanjang perjalanan pergi & balik... dan kat sana ... abg hairi ok gak tp dia nangis skit sebab abg luqman nak tinggalkan dia awal.. sebab abg luqman x sihat... demam.. sian abg luqman..

    hairi manja sgt dgn acik nah dia... berkepit mcm acik nah dia mak dia jer... jelous luqman... hehehehe...

    bawah ni sedikit gambar kenangan hairi + danish di genting bersama abg luqman + udin.

    From genting escaped

    From genting escaped

    From genting escaped

    From genting escaped
    gambar2 lain bleh tgk kat sini ...