Google Analytics

2010/07/29

Using mod_proxy without access log

Apache's module mod_proxy gives me a proxy server, but the access log is complex with non-proxy access in easy way.
Edit the httpd.conf.
Enable mod_proxy
<IfModule mod_proxy.c>
ProxyRequests On
#
<Proxy *>
    Order deny,allow
    Deny from al
    SetEnvIf Remote_Addr "127\.0\.0\.1" localnet=1
    SetEnvIf Remote_Addr "192\.168\.1\.*" localnet=1
    allow from env=localnet
</Proxy>
ProxyVia off
</IfModule>
and I changed the CustomLog Line.
CustomLog logs/access_log combined env=!localnet
After edit the file, restart apache.

done :-)

anyway, pizza hut is now 10 bucks in US... Why so cheaper than Japan..
In Japan, we have to pay over 15 bucks (1600JPY + Delivery cost. there are no dine in expect stupid PizzaHut Natural) at Pizza Hut.

2010/07/26

Google Bookmark with Star

In a few days ago, I just started using Google Bookmark to store the URL for my private memo.
After that, Google show me that star that I added URL with label and comment in the bookmark.

but I don't like to show me stars in search result any more.

So I tried to check off all stars in Google bookmark screen.

After hours later, I tried to add new URL in Google Bookmark.
but there aren't suggest the label.
what??? I'm a confused. I checked what going on my Google bookmark.


I recognized when add URL for google bookmark makes star for that URL.
but I DID NOT recognized when I check off the star, it means delete my bookmark!!!


D**N!!

I don't want to show me the star when I search the words.
So I just delete whole star in my bookmarks. I thought it just delete the star mark.
but it was not only that. they delete whole my Google bookmark ....

Google Bookmark is not good for me :-p

and Please warn "You gonna delete this bookmark?"for me when I check off stars...

uhhhhhh, I stored some good tips... but its gone. I have to find it again....


Yewhoooo!!
I could get back those my bookmark from Google Notebook garbage box.
uh, anyway I stop to use Google bookmark anymore :-p


2010/07/23

SpeedyCGI tips

SpeedyCGI is very easy and powerful speedup the response and execute perl scripts.
also some scripts changed only first line.
#!/usr/bin/perl
      ↓
#!/usr/bin/speedy
only that.
but there are some important things to use it.
because SpeedyCGI running deamon untill the timeout. (default timeout is set to 3600sec = 1hour).
so sometimes SpeedyCGI needs initialize variables.
it means, GET, POST method post the input values to CGI. Like a messages and user name, Id and Pass...
There values set by manually, then there are problem to use SpeedyCGI.
#!/usr/bin/speedy -- -t300 -M2
use strict;
use vars qw($GLOBAL $FUNCGLOBAL %FORM);
print "Content-type: text/plain\r\n\r\n";
my $test=scalar localtime time;
{
 my $local;
  $local++;
  $GLOBAL++;
  &func($FUNCGLOBAL);
  {
   my ($name, $value, $buffer);
    if ($ENV{'REQUEST_METHOD'} eq "POST"){
        read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    }else{
        $buffer = $ENV{'QUERY_STRING'};
    }
    foreach (split /&/,$buffer) {
       ($name, $value) = split /=/;
       $value =~ tr/+/ /;
       $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack('H2',$1)/eg;
       $value =~ s//>/g;
       $value =~ s/"/"/g;
       $value =~ tr/ / /s;
       $FORM{$name} = $value;
    }
  }
print <<"_EOF_";
Result: $$
Global:\t$GLOBAL
Local:\t$local
FUNC:\t$FUNCGLOBAL
TEST:\t$test
FORM:
_EOF_
}
foreach(sort keys %FORM){ print "$_ = $FORM{$_}\n" }
sub func(){ $_[0]++; }
running on that cgi on httpd, send query to that cgi. Like http://example.com/test.cgi?hoge=hoge Then the CGI output Like this:
Result: 20575
Global: 1
Local: 1
FUNC: 1
TEST: Fri Jul 23 03:04:13 2010
FORM:
hoge = hoge
Then request that cgi without query strings. Like http://example.com/test.cgi?
Result: 20575
Global: 2
Local: 1
FUNC: 2
TEST: Fri Jul 23 03:08:39 2010
FORM:
hoge = hoge
did you find out which line is strange?

Yes, "hoge = hoge" is strange!
I didn't send any queries :-(
But the output is there.
So when you change to the SpeedCGI from perl, be careful to use GLOBAL variables :)
use CGI, huh? I don't know perl modules :-p

No, just joke, I checked there is no problem with CGI.pm.

2010/07/14

First step

Now I start blog.

This is first time blog on my life.
anyway, I'm tyring to write an about Technical and Management things of MMOBBS.
and I'm not good at write English. so when you found stupid express, plz teach me :-)