Friday, December 18, 2009

Add folder to Places sidebar in Mac Finder

Very simple, navigate to the folder you desire to have listed under Places in the Finder, select it and press Cmd+T. That's it!
To remove the folder from the list, right click it in the sidebar and select "Remove from sidebar".

Saturday, December 12, 2009

Digital Color Meter in OS X

Digital Color Meter in OS X is a built in tool/application that comes with OS X and allows you to pick the color code for any color on the screen.

Wednesday, December 02, 2009

Replace multiple spaces/tabs with single space

Use following UNIX command to replace multiple spaces or tabs with a single space, thus enabling easier work with cut command:
tr -s ''

Wednesday, September 09, 2009

Installing Xen dom0 on Ubuntu 9.04

The overall structure of a 'Xen-enabled' system can be visualized by the following figure:

As shown in the figure, and contrary to my prior belief, Xen hypervisor is represented by another GRUB entry at system boot time (as opposed to simply replacing the OS that it was installed from). As a result, you can choose to boot into original OS without Xen availability or into the Xen system even after you have installed Xen on given system. This was just used to show a high-level picture of system layout...

Following are a set of commands that will install Xen hypervisor. These commands are to be executed within the original OS currently existing on the machine:

$ wget http://http.us.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.26-2-xen-686_2.6.26-19_i386.deb
$ wget http://http.us.debian.org/debian/pool/main/l/linux-2.6/linux-modules-2.6.26-2-xen-686_2.6.26-19_i386.deb
$ sudo dpkg -i linux-modules-2.6.26-2-xen-686_2.6.26-19_i386.deb
$ sudo dpkg -i linux-image-2.6.26-2-xen-686_2.6.26-19_i386.deb
$ sudo apt-get install ubuntu-xen-server

Then, restart the machine and in the grub loader, Xen should appear as a bootable OS.
After booting up, the following command should tell you that you are in dom0:
$ sudo xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 702 1 r----- 312.9



When it comes to installing guest OS's (i.e., domU's), the following websites were helpful:
  • A brief and technical process can be found here
  • The same process but where each step is explained in more detail can be found here
  • Another example process that shows contents of many files that need to be edited can be found he

Friday, August 14, 2009

Adding new disk to ZFS

This is a short and adjusted version of article available here.
When initially instantiating and setting up accounts on ZFS filesystem (in my case, under OpenSolaris 2009.06), it is beneficial to store user data on a pool other than root pool (i.e., rpool). This is because rpool cannot be composed from multiple hard disks and thus cannot be changed in size (unless it is mirrored) [ref].

So, start by adding a disk to the machine and creating a pool from it.
The following commands lists names of disks available in the system:
afgane@opensolaris:~$ pfexec format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c7d0
/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
1. c7d1
/pci@0,0/pci-ide@1,1/ide@0/cmdk@1,0
2. c8d1
/pci@0,0/pci-ide@1,1/ide@1/cmdk@1,0
Specify disk (enter its number): ^C
afgane@opensolaris:~$


From this, we see that the above system has three disks: c7d0, c7d1 and c8d1
NOTE: Instead of creating a filesystem on a physical disk, you may create it from a simple file that exists in current file system. To do this, create a file on the system of desired size and use it instead of the disk name. Use the following command:

afgane@opensolaris:~$ dd if=/dev/zero of=myfile bs=1024 count=10

This command creates a file called "myfile" filled with zeros with a block size of 1000 multiplied 10 tens or 10K (i.e., created file of size 10K bytes).

Before seeing which of the disks is being used by which pool, we need to see what pools are available on the machine. Do so by issuing the following command:
root@opensolaris:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
rpool 34.8G 3.79G 31.0G 10% ONLINE -
root@opensolaris:~#

From this output we can see that there is only one pool available on the machine, namely rpool.

Next, in order to see which disk is being used by rpool, issue the following command:
afgane@opensolaris:~$ zpool status
pool: rpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c7d0s0 ONLINE 0 0 0

errors: No known data errors
afgane@opensolaris:~$


This tells us that disk named c7d0s0 is used by rpool.

We can now create a new pool and add one of the two extra disks that are available in the machine to this newly created pool. Do so by executing following command (note that you must be root to issue this command):
root@opensolaris:~$ zpool create myPool c7d1

We can now see our newly created pool and can access it as a regular directory on the machine:
root@opensolaris:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
myPool 1.95G 32.7M 1.92G 1% ONLINE -
rpool 34.8G 3.79G 31.0G 10% ONLINE -
root@opensolaris:~#
root@opensolaris:~# cd /myPool


If you ever add another disk to this machine, it is very simple to add it to the overall pool of available space. We will use the third disk that is available in this machine, as follows (remember that you need to be root to issue this command):
root@opensolaris:~# zpool add myPool c8d1

And here is the list of the new pool arrangement, showing the increased pool size:
root@opensolaris:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
myPool 2.95G 32.7M 2.91G 1% ONLINE -
rpool 34.8G 3.79G 31.0G 10% ONLINE -
root@opensolaris:~#

Wednesday, June 10, 2009

Add 2nd disk in VMware

1. Add a second disk to the guest OS through the VM manager
2. Boot the guest OS and go to Control Panel->Administrative Tools->Computer Management->Disk Management
3. Right click the new partition and initialize it.

Thursday, April 23, 2009

Quickly toggle tab swap preference for TabMix Plus

Simply press F9 while FF in focus to toggle between tabs being swapped under Last Selected preference or Select Right preference.