Programming Frankfurt with html and Java: one0.com k-hi.net Titel-Illustration
  SFO  .  FRA  .  BEJ  
 
00:42
.
09:42
.
15:42
 
site map |
What is one0 doing?
The Name
About Us
Technology
References
Pricing
Contact

   

Hello World! Design Patterns

FAQs
Why one0?
Why one0 for China?

Free web tools
Docs + Downloads
Links
IT-News
Support
Job Offers

News: Online-Werkzeuge

Useful Code Snippets


 

1 Shell Scripting

Viewing all httpd requests in realtime:
tail -f /var/log/*access*

Obtaining unique search engine referrers from an httpd log/combined file:
grep -h "search?" one0-com-access.log | gawk "{ print $ 11 }" | sort | uniq

2 Reverse Polish Lisp for the HP48SX

Mandelbrot function for built-in plot function:
Mandelbrot
@ function; returns color value for a given pixel (x; y)
@ global variable "maxcolor" and "maxiter" must be set
<< -> x y                 @ get pixel coordinates x, y
   << x y R->C 0 -> c i   @ convert to complex c; init iteration counter
      << c                @ place c as initial value of z on stack
         DO               @ start loop
            SQ c +        @    z := z**2 + c
         UNTIL            @ terminating condition:
            DUP ABS 2 >   @    check z for being greater than 2
            'i' INCR      @    increase and recall iteration counter and ...
            maxiter >     @    ... check it for being greater than maxiter
            OR            @    (ABS(z) > 2) OR (i > maxiter)
         END              @ end loop
         DROP             @ remove z from stack
         i maxcolor MOD   @ calculate and return pixel color value
      >>
   >>
>>

3 Apache Virtual Hosts

3.1 By Port Numbers

httpd.conf:

...
Listen 80
Listen 81
...
<VirtualHost _default_:80>
  ServerAdmin webmaster@name1.com
  DocumentRoot "C:/dat/www/name1.com/pub"
  CustomLog "c:/dat/www/logs/name1.com-access.log" combined
  ErrorLog "c:/dat/www/logs/name1.com-error.log
</VirtualHost>

<VirtualHost _default_:81>
  ServerAdmin webmaster@name2.com
  DocumentRoot "C:/dat/www/name2.com/pub"
  CustomLog "c:/dat/www/logs/name2.com-access.log" combined
  ErrorLog "c:/dat/www/logs/name2.com-error.log
</VirtualHost>
...

3.2 By DNS Names

httpd.conf:

...
Listen 80
...
NameVirtualHost *

<VirtualHost *>
  ServerName dev.name1.com
  ServerAdmin webmaster@name1.com
  DocumentRoot "C:/dat/www/name1.com/pub"
  CustomLog "c:/dat/www/logs/name1.com-access.log" combined
  ErrorLog "c:/dat/www/logs/name1.com-error.log
</VirtualHost>

<VirtualHost *>
  ServerName dev.name2.com
  ServerAdmin webmaster@name2.com
  DocumentRoot "C:/dat/www/name2.com/pub"
  CustomLog "c:/dat/www/logs/name2.com-access.log" combined
  ErrorLog "c:/dat/www/logs/name2.com-error.log
</VirtualHost>
...

hosts:

127.0.0.1 dev.name1.com
127.0.0.1 dev.name2.com

3.3 By DNS Names and Various Languages

httpd.conf:

...
<VirtualHost *>
  ServerName dev.edelfoto.com
  ServerAlias dev.www.edelfoto.com dev.de.edelfoto.com dev.en.edelfoto.com dev.es.edelfoto.com
  ServerAdmin webmaster@edelfoto.com
  DocumentRoot "C:/dat/www/edelfoto.com/pub"
  ErrorLog logs/edelfoto.com-error.log
  CustomLog logs/edelfoto.com-access.log combined
</VirtualHost>
...
  NOTE: The site one0.com is maintained by Klaus Hildner, Frankfurt a. M., Germany.
Requires cookies and the installation of simplified Chinese character sets for the Mandarin site.
More detailed information can be found in the imprint. Please also see the legal terms.
min. resolution 800x600
 ©  2004 — 2008 by one0.com, Frankfurt a. M., Germany | contact | legal | imprint | updated 08 Mar 2008
Professional search engine optimization