Saturday, March 22, 2008

 

Volume Control in WIndows XP

This sounds like a trivial advice, but if you see volume control icon disappear from your taskbar notification area in Windows XP, you can start volume control application by using command,

$SYSTEMROOT\system32\sndvol32.exe

Labels:


Tuesday, March 18, 2008

 

Installing Mono with yum

Creators of Mono so far haven't made it very simple to install; precompiled binaries exist only for few not the most popular distributions like Red Hat Enterprise 4 or OpenSuSe 10.3. But even there, it is a bit of a pain to download, verify dependencies and install all required packages.

One tool suggested to help somewhat with with problem is yum. Today we will talk about what it takes to use yam on Red Hat Enterprise 4 to install latest Mono release.

Note that at any point during that process it may turn out that your system is missing some requirements which mine didn't; it is assumed you know to to locate missing packages on whatever media you are using and install them.

We begin by installing certain prerequisites of yum. All of them are python packages, and all of them should be compatible with python 2.3.4 which comes with RHE4; upgrading to a newer python version may be possible, but not recommended since yum also depends on python package rpm, which is part of RedHat distribution.

  1. urlgrabber. cd /tmp
    wget http://linux.duke.edu/projects/urlgrabber/download/urlgrabber-3.1.0.tar.gz
    tar -xvzf urlgrabber-3.1.0.tar.gz
    cd urlgrabber-3.1.0
    python setup.py build
    python setup.py install
  2. ElementTree. Using http://effbot.org/media/downloads/elementtree-1.2-20040618.tar.gz, same procedure as above;
  3. cElementTree.
    Using http://effbot.org/media/downloads/cElementTree-1.0.5-20051216.tar.gz, same procedure as above.
Now we are ready to install yum. I used version 2.6.1, since according to this, it is the latest version compatible with python 2.3.X.
cd /tmp
wget http://linux.duke.edu/projects/yum/download/2.6/yum-2.6.1.tar.gz
tar -xvzf yum-2.6.1.tar.gz
cd yum-2.6.1
make DESTDIR=/
make DESTDIR=/ install
Make sure yum module loads properly, and fix problems if there are any :
[root@myRHE4 ~]# python
Python 2.3.4 (#1, Jan  9 2007, 16:40:18)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
>>>
Create info about mono repository:
cd /etc/yum.repos.d
wget http://www.go-mono.com/download-stable/rhel-4-i386/mono.repo
You're ready to begin installation! Here is what I installed:
yum install mono-complete
yum install gtk-sharp2-complete
yum install mono-basic
yum install mono-debugger
One last item - optional, but nice - it is to make sure Linux kernel can run your Mono applications "natively" (like Windows), without using "mono" every time. Following these directions, create script like that:
#! /bin/bash
if [ ! -e /proc/sys/fs/binfmt_misc/register ]; then
    /sbin/modprobe binfmt_misc
    # Some distributions, like Fedora Core, perform
    # the following command automatically when the
    # binfmt_misc module is loaded into the kernel.
    # Thus, it is possible that the following line
    # is not needed at all. Look at /etc/modprobe.conf
    # to check whether this is applicable or not.
    mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
fi

# Register support for .NET CLR binaries
if [ -e /proc/sys/fs/binfmt_misc/register ]; then
    # Replace /usr/bin/mono with the correct pathname to
    # the Mono CLR runtime (usually /usr/local/bin/mono
    # when compiling from sources or CVS).
    echo ':CLR:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register
else
    echo "No binfmt_misc support"
    exit 1
fi
and run it as root (or append to file /etc/rc.local as suggested) To verify your installation, use program "Hello, World!" from here :
using Gtk;
using System;

class Hello {

static void Main()
{
Application.Init ();

// Set up a button object.
Button btn = new Button ("Hello World");
// when this button is clicked, it'll run hello()
btn.Clicked += new EventHandler (hello);

Window window = new Window ("helloworld");
// when this window is deleted, it'll run delete_event()
window.DeleteEvent += delete_event;
               
// Add the button to the window and display everything
window.Add (btn);
window.ShowAll ();

Application.Run ();
}

// runs when the user deletes the window using the "close
// window" widget in the window frame.
static void delete_event (object obj, DeleteEventArgs args)
{
Application.Quit ();
}

// runs when the button is clicked.
static void hello (object obj, EventArgs args)
{
Console.WriteLine("Hello World");
Application.Quit ();
}
}
To compile and run:
gmcs helloworld.cs -pkg:gtk-sharp-2.0
./helloworld.exe

Labels: , , ,


Friday, March 07, 2008

 

Installing VMWare tools under Debian

VMWare tools depend on specific kernel version, and thus upon upgrading the kernel it is necessary to upgrade them as well. This process is a bit painful and not without its caveats, so here is a brief description of steps involved.
  1. Make sure you have correct version of kernel headers installed. Under Debian, this is done with the command:
    # apt-get install linux-headers-2.6.18-6-686
    where version string is reported by "uname -r".
    While traditional location for linux header files was under /usr/src/linux, Debian puts them under /usr/src/linux-headers-2.6.18-6-686/include (you will need this directory later in the installation process)
    Note: Aforementioned apt-get command would also create directory /usr/src/linux-headers-2.6.18-6 with platform-independent files.
  2. Go to virtual machine settings and specifically enable "shared folders", if not already enabled (you do not need to add any such folders)
  3. Now select in VMWare menus: VM => Install VMware tools.
  4. In a few seconds, VMWare will mount VMWare tool installation "CD" (you will probably see CD image on the desktop and top-level folder opened). Ignore '.rpm' file and unpack '.tar.gz' file under '/tmp':
    # cd /tmp
    # tar -xvzf /media/cdrom0/VMwareTools-6.0.2-59824.tar.gz
  5. Start installation process:
    # cd vmware-tools-distrib
    # ./vmware-install.pl
    It will proceed for a while before beginning to ask questions about where to install files. Accept all of the suggested defaults.
  6. After all the files are installed, installer asks if you want to launch VMWare configuration tool /usr/bin/vmware-config-tools.pl . Say "yes" (the default)
  7. Here comes the only time when you (might) need to override default. When asked about "C header files that match your running kernel", specify directory "/usr/src/linux-headers-2.6.18-6-686/include" (or similar) from step 1.
  8. Agree to install "experimental" feature "Virtual Machine Communication Interface".
  9. When selecting graphics mode, you screen might re-size and flicker for a few seconds.
  10. And the end, configuration utility shall start the services and report successful installation. Make sure that status line at the bottom of VMWare application window says "VMware tools installed successfully".
  11. Configuration utility might suggest to switch to vmxnet for network support, like that:
    /etc/init.d/network stop
    /sbin/rmmod pcnet32
    /sbin/rmmod vmxnet
    # /sbin/depmod -a (may be unnecessary)
    /sbin/modprobe vmxnet
    /etc/init.d/network start
  12. As part of the installation, installer overrides your existing X.org configuration file. You have previously configured your scroll mouse, these changes are now lost (though there should be a backup file /etc/X11/xorg.conf.old.0 available).
    To make scroll mouse work again, restore these changes to /etc/X11/xorg.conf :
    Option "Protocol" "ImPS/2"
    Option "Emulate3Buttons" "false"
    Option "Buttons" "5"
    Option "ZAxisMapping" "4 5"
    (from http://communities.vmware.com/thread/107816)
  13. Shut down and them power up viertual machine to enable changes to xconf.org to take effect and to make sure VMware services are properly restarted (do not just 'reboot')
  14. Upon successful startup, test scroll mouse and copy/paste between host and guest (if enabled in virtual machine properties, of course), and use /usr/bin/vmware-toolbox to make further adjustments to the configuration.
If everything went fine, congratulations! You have successfully installed/upgraded VMware tools. Till next kernel upgrade! IMPORTANT: If something didn't work and you must try again, do not just re-run vmware-config-tools.pl or vmware-install.pl . Begin from step 3 !
Update (24-Jun-2008). If when invoking "install VMware tools" you get CD mounted with some garbage (instead of two installer files it is supposed to contain), then: (1) "Eject" this CD (e.g., with desktop CD icon using RMB); (2) Go to VM => "Cancel VMware tools install"; (3) Go to VM => "Install VMware Tools" again. This time it should work.

Labels: ,


This page is powered by Blogger. Isn't yours?