• General 29.11.2010 No Comments

    When compiling varnishtop (and other tools) on RHEL/CentOS 5, I came across the following issue:

    varnishtop.o: In function `do_curses':
    /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:223: undefined reference to `initscr'
    /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:224: undefined reference to `raw'
    /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:225: undefined reference to `noecho'
    /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:226: undefined reference to `nonl'
    /tmp/varnish-2.1.4/bin/varnishtop/varnishtop.c:227: undefined reference to `stdscr'
    ......
    ......
    collect2: ld returned 1 exit status
    make: *** [varnishtop] Error 1

    The issue seems to be with the ncurses library that comes with the standard distribution. So, I installed the ncurses-5.7 libs from source, using:
    ./configure --with-shared --with-debug --enable-overwrite --with-termlib

    and then recompiling/building varnish/varnishtop.

  • General 25.07.2010 No Comments

    Finding Physical Processors:
    $ grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l

    Finding Virtual Processors
    $ grep ^processor /proc/cpuinfo | wc -l

    Finding CPU cores
    $ grep 'cpu cores' /proc/cpuinfo

    “2″ indicates the two physical processors are dual-core, resulting in 4 virtual processors.
    If “1″ was returned, the two physical processors are single-core.

    If the processors are single-core, and the number of virtual processors is greater than the number of physical processors, the CPUs are using hyper-threading.

    Finding CPU Arch
    $ grep flags /proc/cpuinfo | uniq | egrep -o -w "rm|tm|lm"

    Under “Flags” section in /proc/cpuinfo, you will find any of the flags “tm” or
    “rm” or “lm”

    • rm (Real Mode) means it is a 16 bit processor
    • tm (Transparent Mode) means it is a 32 bit processor
    • lm (Long Mode) means it is a 64 bit processor
  • General 25.07.2010 No Comments


    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.your_domain.com$
    RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]

  • General 11.12.2009 No Comments

    Piwik(http://piwik.org/) is open source self-hostable web analytics tool (like omniture orĀ  google analytics). To integrate piwik with mediawiki, I customized the existing Google Analytics mediawiki plugin (http://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration) to work with piwik. To include the extension in your wiki,
    unzip the file, and deploy the piwik.php extension file into WIKI_INSTALL_DIR/extensions/. Then include the file in your LocalSettings.php, using:

    require_once("extensions/piwik.php");

    Download piwik extension

  • When using Ubuntu 8.10 and connecting to a Wireless-n (802.11n) network, the system freezes with kernel panic (as indicated by blinking scroll and numlock). The system gets unusable and you would have to reboot. I have had this issue with my Dell XPS M1530, when connecting to Apple Extreme router.

    The issue with the intel wireless module driver, and will get fixed by installing the compat-wireless driver.

    Try compiling this iwlagn module, http://www.orbit-lab.org/kernel/compat-wireless-2.6/2008/10/compat-wireless-2008-10-01.tar.bz2 .
    Extract the archive and then follow these steps:

    sudo apt-get install build-essential
    cd compat*
    make
    sudo make install

    Reboot the system, and you will not longer face kernel panic or system freeze.

    UPDATE:

    When installing 9.04, I figured out that 802.11N drivers for Ubuntu are totally broken. Since I did not want to fiddle around much, I added the following lines to /etc/modprobe.d/options(and restart the system):

    options iwlagn 11n_disable=1

    This would prevent Wireless-N mode, but it will get your Dell M1530 (and M1330) working on Wireless with Ubuntu

    Tags: , , , , , , ,

  • Elasticfox plugin for firefox on OS X uses Terminal.app by default(to SSH into the EC2 instances). If you would like to use iTerm instead of Terminal.app:

    1. Create a script (say ec2-ssh.osascript) in your home directory. This is an applescript.

    on run argv
      tell application "iTerm"
        activate
        set cmd to "ssh -i " & item 1 of argv & " " & item 2 of argv
        set myterm to the last terminal
        tell myterm
          launch session "Default Session"
          tell the last session
            write text the cmd
          end tell
        end tell
      end tell
    end run
    

    2. Edit ElasticFox properties. It should look like the following:

    capture 1.png

    So, every time you try to SSH, it would use iTerm instead of Terminal.app

  • General, OS X 09.07.2008 2 Comments

    OS X does not provide necessary plugins for iSync to sync with Sony Ericsson W830i. I have created a custom plugin to do the necessary (tested with the newly bought W830i).

    You can download the plugin here: http://www.megalinux.net/SonyEricsson-W830.phoneplugin.zip

    Drop the plugin into /Applications/iSync.app/Contents/Plugins/ApplePhoneConduit.syncdevice/Contents/Plugins/

  • Issue:

    “kernel: cdrom: open failed” errors noticed in /var/log/messages

    Solution:

    Edit /etc/hal/hald.conf and change /haldconfig/storage_media_check to false.

    Tags: , , ,