"; */ ?>

cool places


31
Oct 07

Feed Opera with Firefox :)

    One of my readers wanted to sign up to my feed using his favorite Opera browser. However failed to do that since Opera does not yet understand "feed://" protocol. Hence, I decided to drop this quick note on how to make Opera delegate feeds to others until the times it’s capable ;)

    In Opera go to "Tools -> Preferences -> Advanced -> Programs", click on "Add…", and enter "feed" for Protocol and "firefox", or ANY preferred RSS reader in "Open with other application":

   

    Now click "Ok" followed by another "Ok" and enter a "feed://" address to the address bar, for example this one. Once you hit Enter, you favorite RSS Reader (Firefox in my case) will open this feed, and your Opera will feel much better, since it just delegated a heavy unit of a hard work to somebody else ;)

    Happy hacking people!


19
Oct 07

Help Google to Generate Only Relevant Ads!

google money    I recently decided to participate in Google Adsense program where Google shows its ads on my blog, and I get paid when somebody clicks the ad. This tool from Google is far from being fresh and new, but I think it has a very cool idea behind it:
        – ad owner wins, because people go to her/his website,
        – Google wins, because ad owner pays Google for a click (through Google Adwords)
        – I win, because I keep writing stuff on my blog and get paid by Google for a click.

   One of the main challenges and the main thing about any kind of ads from any place is their relevance. Will you buy milk on a porno site? Or do you need a pack of Marlboro Lights, when searching for a Whitening Toothpaste? Probably not really…

    So you see the logic, the more relevant the ad is, the more chances people are going to pay their attention to it and, in the case of Adsense, "click it".

    Relevance is mostly achieved by the Google algorithm that analyzes your page (the page where ads are going to be displayed) by reading its content and "data mining" it. Then it makes a decision on what exactly "this" page is about, and what ads Google has on that topic. Once all is figured out, Google places the resulting ads on the page.

    But there are ways we can help Google not to "offer milk on the porno site" (although Google does not do porno sites – just a colorful example here :) ), but instead target its ads right to the point. One of such ways is "Section Targeting".

    how Google explains it:

    Section targeting allows you to suggest sections of your text and HTML content that you’d like us to emphasize or downplay when matching ads to your site’s content. By providing us with your suggestions, you can assist us in improving your ad targeting.

    You can read their short tutorial here. The idea is simple: your html page has a lot of text, including links, other advertisement, people comments, etc. but what you really want Google to focus on is your content ( in my case it is my blog post ). So you can use three HTML tags that will focus Google Adsense engine on your content. These tags are:

               Section start tag:               <!– google_ad_section_start –>

               Section end tag:                <!– google_ad_section_end –>

               Ignore section start tag:      <!– google_ad_section_start(weight=ignore) –>

    Sample from Google:

<html><head><title>Section targeting</title></head>
<body>
 
<!-- google_ad_section_start -->
 
This is the text of your webpage. Most of your content resides here.
 
<!-- google_ad_section_end -->
 
</body>
</html>

    From the sample above you can see how (start, end) tags can be used to focus Google only on the  main content. In order to ignore the content, wrap it with (ignore, end) tags as follows:

<html><head><title>Section targeting</title></head>
<body>
 
<!-- google_ad_section_start(weight=ignore) -->
 
This is the text of your webpage. Most of your content resides here.
 
<!-- google_ad_section_end -->
 
</body>
</html>

    But there is something interesting, that is not included in Google’s tutorial, that you can do with tags – you can nest them, as well as focus them on multiple sections! I have spoken to the Google Adsense representative, gave him a couple of examples I would liked to use the tags, and he confirmed that it works.

    So here is very cool and efficient things that you can do with adsense tags in addition to the usual stuff…

    nest those tags:

<!-- google_ad_section_start -->
 
     my content I want to focus on
     .....
 
     <!-- google_ad_section_start(weight=ignore) -->
 
          content I would like to ignore
 
     <!-- google_ad_section_end(weight=ignore) -->
 
     my content I want to focus on
     .....
 
<!-- google_ad_section_end -->

    so, in the above example we ignored a part of the section (content) we actually want Google to focus on – cool, right? :)

    That is not all, you can also focus on multiple sections, like this:

<!-- google_ad_section_start -->
 
     my content A I want to focus on
     .....
 
<!-- google_ad_section_end -->
 
     some other irrelevant content
     .....
 
<!-- google_ad_section_start -->
 
     my content B I want to focus on
     .....
 
<!-- google_ad_section_end -->

    This really opens the doors to finetune the relavence of your ads, which, who knows, maybe someday will make you a millionaire! ;)


16
Oct 07

Ubuntu Gutsy Gibbon Parties all over the World

Ubuntu LogoAccording to Ubuntu once Ubuntu 7.10 (Gutsy Gibbon) is out, there will be plenty to celebrate, whether you were directly involved in the release process or just rejoice because the next iteration of the best distribution is finally out.

    Thursday, 18th of October ‘2007 is the tentative date for Ubuntu 7.10. Many parties will be on this date, or you can pick your own date! Go ahead and put down your favorite pub, park or cafe and celebrate getting Gutsy Gibbon out of the door!

   Ubuntu Feisty Fawn

    get it while its hot :)

    Come and join Ubuntu parties all over the Globe! The schedule of already "Confirmed Parties" are here

picture’s source


10
Sep 07

Avant Window Navigator – Dual Monitor Hack

avant window navigator  Ok, so you have successfully configured dual monitor for you (Gnome/KDE) desktop, and now you have decided to take it even further and install and configure Avant Window Navigator – way to go!

    Although most of your installation/configuration will succeed by following one of the tutorials, in case if you have dual monitors, and/or you use Option  "MergedFB"  in "xorg.conf" to merge two monitors into a one screen, standard tutorials will not work. This will require additional hacking to get AWN to work right, and here is where this article comes in :)

    PROBLEM:    One of the problems that AWN has with multiple screens/monitors is to identify the position of where it needs to put its task bar. In case of two monitors merged into one big screen, it does not adjust to this new slightly larger "coordinate system", and fails to place its task bar to the right place on a screen (usually at the bottom of the bottom screen). This can be solved, of course ;)

    SOLUTION:   AWN stores monitor resolution info in a file called "%gconf.xml" which is located here:

          user@host:~/.gconf/apps/avant-window-navigator$ ll
          total 32
          drwx------ 2 user user 4096 2007-07-18 11:41 app
          drwx------ 4 user user 4096 2007-06-26 23:47 applets
          drwx------ 2 user user 4096 2007-08-06 21:52 bar
          -rw------- 1 user user 776 2007-09-10 09:52 %gconf.xml
          -rw------- 1 user user 776 2007-06-27 22:57 %gconf.xml.dual
          -rw------- 1 user user 776 2007-06-27 10:41 %gconf.xml.single
          drwx------ 2 user user 4096 2007-06-27 17:59 title
          drwx------ 2 user user 4096 2007-06-30 14:16 window_manager
          user@host:~/.gconf/apps/avant-window-navigator$

    "%gconf.xml" is an XML file that has several elements called "entry". The ones we are interested in would be:

 
        <entry name="monitor_height" mtime="1179886419" type="int" value="1024">
        </entry>
        <entry name="monitor_width" mtime="1179886419" type="int" value="1280">
        </entry>

    These values would work fine if we had a single 1280×1024 monitor, but if we have our (e.g.) bottom monitor as 1280×800, in order for AWN to display its task bar in a correct spot (the bottom of the bottom monitor), values have to change to:

 
        <entry name="monitor_height" mtime="1179886419" type="int" value="1824">
        </entry>
        <entry name="monitor_width" mtime="1179886419" type="int" value="1280">
        </entry>

    So what we did, we summed up Y-Positions of both monitors together: 1024 + 800 = 1824. Now when AWN is calculating its task bar’s Y-Pos offset, it will take 1824, as the Y-Pos max range, and will do the right thing!


18
May 07

Dual Monitor on Ubuntu 7.04 (Feisty Fawn) – nc2400 with Intel 945GM

xorg logoOne of the good things about being in a big consulting company is that you get these "once every one/two years" laptop upgrades. So my lucky upgrade day was yesterday, and my friend Dell D400 was upgraded to HP nc2400. So I decided to change my course a little, and use Ubuntu on a company laptop (instead of XP). I talked to the company people, they did not mind, which was great! The only problem is, when you get a new Windows XP laptop (upgrade), there are certain people that set it up for you, and you just pick it up and go to the client. Well, in my case I had to get up to speed very quickly myself. And of course one of majors problems with Ubuntu Feisty (as with most Linux distros) it does not have any tooling to deal with dual (laptop/LCD) monitors. So it was a fun time experimenting with "xorg.config". It took me quite some time, but I DID GET IT WORKING! And just want to share with everybody what I came with, since none of the Ubuntu forums, and none of what Google (with their new Web 2.0) told me did NOT work.

So here we go… Checking what graphic (video) my new nc2400 has:

user@host:~$ lspci
...
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)<br />
...

Ok, so I’ve got "Intel 945GM" – cool. Notice that there are two VGA/Display controllers, one is on 0:2:0, and another one is on 0:2:1 (those numbers are BusIDs by the way). Nevertheless, I used only one BusID, which is the first one 0:2:0 to get it working.

I also have 1280×800 laptop screen resolution, which means I need to get 915resolution

apt-get install 915resolution

Now, my External Monitor has 1280×1024 @ 60 Hz by specs. Let’s see it is supported by 915resolution:

user@host:~$ sudo 915resolution -l
Password:
Intel 800/900 Series VBIOS Hack : version 0.5.2
 
Chipset: 945GM
BIOS: TYPE 1
Mode Table Offset: $C0000 + $269
Mode Table Entries: 36
 
Mode 30 : 640x480, 8 bits/pixel
Mode 32 : 800x600, 8 bits/pixel
Mode 34 : 1024x768, 8 bits/pixel
Mode 38 : 1280x800, 24 bits/pixel
Mode 3c : 1920x1440, 8 bits/pixel
Mode 41 : 640x480, 16 bits/pixel
Mode 43 : 800x600, 16 bits/pixel
Mode 45 : 1024x768, 16 bits/pixel
Mode 49 : 1280x800, 16 bits/pixel
Mode 4d : 1920x1440, 16 bits/pixel
Mode 50 : 640x480, 32 bits/pixel
Mode 52 : 800x600, 32 bits/pixel
Mode 54 : 1024x768, 32 bits/pixel
Mode 58 : 1280x800, 32 bits/pixel
Mode 5c : 1920x1440, 32 bits/pixel

Seems like I do not have 1280×1024 as one of the supported modes. Hmmm. Ok, then I need to explicitly ask for it by modifying this file, to look like this:

user@host:~$ cat /etc/default/915resolution
#
# 915resolution default
#
# find free modes by  /usr/sbin/915resolution -l
# and set it to MODE or set to 'MODE=auto'
#
# With 'auto' detection, the panel-size will be fetched from the VBE
# BIOS if possible and the highest-numbered mode in each bit-depth
# will be overwritten with the detected panel-size.
MODE=3a
#
# and set resolutions for the mode.
# e.g. use XRESO=1024 and YRESO=768
 
XRESO=1280
YRESO=1024
 
# We can also set the pixel mode.
# e.g. use BIT=32
# Please note that this is optional,
# you can also leave this value blank.
BIT=24

Ok. No I still need to patch laptop LCD to 1280×800, therefore im going to write  a one liner script that is going to do that on startup (how-to). Here is that one line:

# Set the laptop monitor resolution
# Add it to 915Resolution supported modes
915resolution 38 1280 800 24

Did, resolution, did the patching, is it now time for an "xorg.conf"? Ok, then, here it is (working too) :)

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf(5) manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg
 
Section "Files"
        FontPath        "/usr/share/fonts/X11/misc"
        FontPath        "/usr/share/fonts/X11/cyrillic"
        FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"
        FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"
        FontPath        "/usr/share/fonts/X11/Type1"
        FontPath        "/usr/share/fonts/X11/100dpi"
        FontPath        "/usr/share/fonts/X11/75dpi"
        # path to defoma fonts
        FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection
 
Section "Module"
        Load    "i2c"
        Load    "bitmap"
        Load    "ddc"
        Load    "dri"
        Load    "extmod"
        Load    "freetype"
        Load    "glx"
        Load    "int10"
        Load    "vbe"
EndSection
 
Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "CoreKeyboard"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "us"
EndSection
 
Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ImPS/2"
        Option          "ZAxisMapping"          "4 5"
        Option          "Emulate3Buttons"       "true"
EndSection
 
Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
        Option          "HorizScrollDelta"      "0"
EndSection
 
Section "InputDevice"
        Driver          "wacom"
        Identifier      "stylus"
        Option          "Device"        "/dev/input/wacom"
        Option          "Type"          "stylus"
        Option          "ForceDevice"   "ISDV4"         # Tablet PC ONLY
EndSection
 
Section "InputDevice"
        Driver          "wacom"
        Identifier      "eraser"
        Option          "Device"        "/dev/input/wacom"
        Option          "Type"          "eraser"
        Option          "ForceDevice"   "ISDV4"         # Tablet PC ONLY
EndSection
 
Section "InputDevice"
        Driver          "wacom"
        Identifier      "cursor"
        Option          "Device"        "/dev/input/wacom"
        Option          "Type"          "cursor"
        Option          "ForceDevice"   "ISDV4"         # Tablet PC ONLY
EndSection
 
Section "Device"
        Identifier      "0 Intel 945GM"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Screen      0
        Option          "MonitorLayout" "CRT,LFP"
        Option          "DRI" "false"
    # I don't think these next lines are actually required.
    #Option          "BackingStore" "true"
    #Option          "DevicePresence" "on"
    #Option          "DisplayInfo" "FALSE"
    #Option          "DRI" "true"
    #Option                       "CacheLines" "1024"
EndSection
 
Section "Device"
        Identifier      "1 Intel 945GM"
        Driver          "i810"
        BusID           "PCI:0:2:0"
        Screen      1
        Option          "MonitorLayout" "CRT,LFP"
        Option          "DRI" "true"
    # I don't think these next lines are actually required.
    #Option          "BackingStore" "true"
    #Option          "DevicePresence" "on"
    #Option          "DisplayInfo" "FALSE"
    #Option          "DRI" "true"
    #Option                       "CacheLines" "1024"
EndSection
 
Section "Monitor"
        Identifier      "0 nc2400 Monitor"
        Option          "DPMS"
        Option          "DPMS"
#       HorizSync       28-75
#       VertRefresh     43-100
EndSection
 
Section "Monitor"
        Identifier         "1 nc2400 Monitor"
    HorizSync      30 - 83
    VertRefresh    56 - 76
    Option         "DPMS"
        Modeline       "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
EndSection
 
Section "Screen"
        Identifier          "0 Screen"
        Device              "0 Intel 945GM"
        Monitor             "0 nc2400 Monitor"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1280x800"
        EndSubSection
EndSection
 
Section "Screen"
        Identifier          "1 Screen"
        Device              "1 Intel 945GM"
        Monitor             "1 nc2400 Monitor"
        DefaultDepth    24
        SubSection "Display"
                Depth           24
                Modes           "1280x1024@60"
        EndSubSection
EndSection
 
Section "ServerLayout"
        Identifier      "Default Layout"
    Screen      0 "0 Screen"
    Screen      1 "1 Screen" RightOf "0 Screen"
        Option          "Xinerama" "on"
        Option          "Clone" "off"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
        InputDevice     "stylus"        "SendCoreEvents"
        InputDevice     "cursor"        "SendCoreEvents"
        InputDevice     "eraser"        "SendCoreEvents"
        InputDevice     "Synaptics Touchpad"
EndSection
 
Section "DRI"
        Mode    0666
EndSection

You may notice "Modeline "1280×1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync", well I just got it from the same place you would get it, yea..that’s right, I got it from Google.

Remember, no matter what a general opinion is (linux follows "install without restart" philosophy), you have to restart. And not just /etc/init.d/gdm restart, but a FULL system restart,

Ok, so now you should see two beautiful screens – one is your laptop, and the other one is your external monitor which is now a separate screen. Congrats!

If you have any questions – shoot, I killed so much time figuring out all these details, why should you?