Connecting a second mouse or keyboard directly to a Fusion virtual machine

Mice and keyboards belong to a special class of USB devices known as Human Interface Devices, or HID. Fusion does not allow these to be connected to the virtual machine by default, due to the risk of removing all human interface from the Mac. It is possible to instruct Fusion to make it possible to connect these devices by modifying the virtual machine settings.
 
Caution: You require access to a second keyboard and/or mouse for these steps. Do not follow these steps if you only have one mouse and/or keyboard, as you will not be able to use the device(s) with your Mac while Fusion is running.
 
To connect an external keyboard and/or mouse directly to your virtual machine:
  1. Shut down the virtual machine that needs the mouse/keyboard.
  2. Plug the second mouse/keyboard into your Mac.
  3. Edit your virtual machine's .vmx file using a text editor to include these lines:

    usb.generic.allowHID = "TRUE"
    usb.generic.allowLastHID = "TRUE"

    Note: For more information about editing the .vmx file,
    see Editing the .vmx file for your Fusion virtual machine (1014782).
     
  4. Power on your virtual machine.
  5. Go to Virtual Machine > USB and select Connect <your mouse or keyboard>.

source: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003418

Validate email addresses using regular expressions (RFC 2822)

Hi,

this is for everyone who wants to check for a RFC 2822 compliant email. Here are 2 expressions, one for normal and one for strange looking but valid emails:

$normal = "^[a-z0-9_\+-]+(\.[a-z0-9_\+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,4})$";

$strange = "^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,})$";

source: http://www.markussipila.info/pub/emailvalidator.php

Map unix group to a windows domain group

Hello world,

here my scenario: i have a webdevelopment server as a domain member and i need the apache user in one of the domain groups so that apache can access readable and writeable files by the webdev group. The problem now is that you can't add unix users to a windows group because the unix user doesn't exist on the windows machine. BUT: you can map an existing unix group to an existing windows group so that the unix group is like an alias for the windows one and add the unix user to that group… and it is quite easy.

Let's say you have group1 on windows and domgroup1 on unix. Here is how to do it:

create a new unix group
# groupadd domgroup1

now map the groups
# net groupmap add ntgroup="group1" unixgroup="domgroup1" type=domain

list the mapped groups
# net groupmap list

now restart samba
# /etc/init.d/smb restart

The only thing left you have to do now is to add the user add to your domgroup1 in /etc/group