Author Archives: Oren

CSS position attribute

I didn't fully understand it from w3schools description, so here's a simpler (IMO) explanation after digging the issue a little bit:

  • static (the default!): The browser decides where to put the element, and it's not movable (i.e. one cannot change the position attributes (top, left, bottom, right) )
  • relative: Position attributes can be changed, relatively to the 'where-the-browser-decided' position (i.e. for having an element like the static above, but 5 pixels upper, one can put top: -5px)
  • absolute: One can specify a specific position inside the document, which should be measured from the beginning of the document. (i.e. top: 100px; left: 500px) will be on the x=500, y=100 location from the document's start point (top-left in most cases).
    I've noticed that IE6 sometimes measured the location relatively to the parent element in some cases, but it seems to be fixed in IE7.
  • fixed: Similar to absolute, only that the position is relative to the WINDOW and not the DOCUMENT, thus scrolling doesn't change the position. someone said it's like a watermark.

vim & ls colors (dark blue over black.. what were they thinking?)

I like black backgrounds. Less radiation to the eyes, less energy consumed off earth.. Unfortunately most of the time (Browser, Office) we are forced to use white background. But at least terminals can be made black easily.

The problem with black terminal is the dark blue color, which really hurts to read over black background. The solution:

  • /bin/ls: (I hope you use the --colors alias by default..)
    LS_COLORS environment variable should contain di=01;34 (instead of the common di=00;34).
    In Fedora, CentOS it can be easily configured from  /etc/DIR_COLORS.xterm    DIR 00;34 -> DIR 01;34
  • Vim: (I hope you don't use another editor..)
    add set bg=dark to /etc/vim/vimrc or ~/.vimrc.
    alternatively add colorscheme: <your favorite colorscheme>, such as  evening.

Oracle RAC on CentOS5/RHEL5

Apparently, at least as of 10.2.0.1, Oracle RAC is officially supported on RHEL5, but they forgot few things:

  • in oraparam.ini "redhat-5" should be added to the supported OS list. (Yeah, that's kinda funny)
  • the LD_ASSUME_KERNEL setting should be removed from crs/bin/vipca & crs/bin/srvctl (and maybe other places). LD_ASSUME_KERNEL sets glibc to old threads methods (pthread) which don't seem to be supported anymore in RHEL5..
  • vipca (Virtual IP manager) won't run unless you manually set the interfaces for the first time using the 'oifcfg setif' command.

Apparently it recognized CentOS5 as RHEL5, which is cool.

Don't let them make you stupid

I've encountered few posts about a security expert claiming he can easily steal gmail sessions. Very interesting and frightening, eh?

A little more reading reveals that he just got the Session ID by sniffing an unencrypted WiFi network. Same thing can probably be done on any non-ssl web application. I wonder how this boring and misleading article got even into Slashdot.

Ajax Parallelism

I've been asked to run few ajax requests in parallel.
Apparently the "A" in ajax stands for "Asynchronous", so each HTTP request made is non-blocking and unlimited HTTP requests should be made in parallel.

However, the browser limits the number of connections to a specific HTTP server. This is not a bad browser design: it's according to HTTP 1.1.

This can be tweaked (and thus breaking HTTP 1.1 compatibility):

FF: about:config -> network.http.max-persistent-connections-per-server

MSIE: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\MaxConnectionsPerServer (create it even if it doesn't exist, DWORD value)

Refs: http://support.microsoft.com/kb/183110