Posts

Showing posts from June, 2010

Mounting nfs share on Mac

Mounting nfs share on Mac

Through The Finder

Accessing an NFS share with the Mac OS X Finder is simple. Select Go -> Connect to Server... in the Finder. In the Address box, enter the location of the NFS share as follows nfs:// servername /path/to/share. So if your server's name is taco and the share is /exports/media, you would use the address nfs://taco/exports/media. The Finder will then access the share and mount it on your desktop. An important note here is that the Finder uses an unprivileged port to do this, which may not work with some NFS server configurations.

Through The Mount Command

To use the mount command to mount a share, open the Terminal application. Enter the command sudo /bin/mount_nfs servername: /path/to/share _/private/mnt/point_, replacing the italicized sections with the necessary values. This command will also use an unprivileged port by default, but you can force a privileged port with the -P switch.



Using the automount Daemon

For more permanent mounts…

Converting .DMG or .CDR to .ISO on Mac OS X

To convert .DMG to . iso

hdiutil convert /Users/alpa/Desktop/winxp-sp2.DMG -format UDTO -o /Users/alpa/Desktop/winxp-sp2.iso

To convert .cdr to .iso

hdiutil makehybrid -iso -joliet -o /Users/alpa/Desktop/winxp-sp2.iso /Users/alpa/Desktop/winxp-sp2.cdr

What process is using your CD or DVD on *nix

Tried to eject a CD or DVD and you were told that the disk was in use and couldn't figure out what was using the disk? Use the below shell script is to findout.



#!/bin/bash

PATH=${PATH}:/sbin:/usr/sbin

dr=($(drutil status | grep -i 'type:'))
devtype=${dr[1]}
device=($(mount | grep ${dr[3]}))
if [ $devtype = "No" ]
then echo No disk found. Sorry! >&2
exit 1;
fi
echo A $devtype is mounted on the device named $device
pids=($(sudo -p 'Please enter the administrator password:' lsof -t $device))
echo \nList of programs that may be preventing the disk to eject
ps -o pid,user,comm=COMMAND -www -p $(echo ${pids[*]} | sed 's/ /,/g')

The output is a list of the processes that lsof says is using the CD or DVD.

Mount NFS Volumes in Snow leopard with Disk Utility

NFS mounts are now added using Disk Utility. To add a Linux-hosted NFS share on my network,

1. Start Disk Utility
2. Select NFS Mounts from the File menu
3. Click the plus sign in the lower left corner
4. Enter in your remote NFS URL info as described
5. Enter the mount point. If you add it to /Network, then it will show up in the Shared section of Finder, in an entry called All.
6. If you're using secure ports on your server, then click the Advanced option and enter -P
7. Click Verify
8. Save your settings

The NFS mount is now available.

How to pass an init level to kernel in linux

Pass a init level to the kernel assuming you have grub open up /boot/grub/menu.1st and add 'init=3' to the options in the config like:

example:

kernel (hd0,0)/boot/linux-2.6.8 root=/dev/hda1 idebus=66 init=3

Enabling Kernel Cores in Linux permanently

Enabling Kernel Cores in Linux permanently

1. Open /root/.bashrc file and append the following strings

sysctl -w kernel.core_uses_pid=1

ulimit -c unlimited

Displaying user related information on mac in Terminal

Displaying user related information on Mac in Terminal

$ dscl . -read /Users/user

Formatting an external disk or usb disk of size more than 32 GB as FAT32

Formatting an external disk or usb disk of size more than 32 GB is a problem ? Then use the this tool available at below link. with this tool you can format the disk of size 2TB as fat32

A GUI BASED TOOL - http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm

OR

A COMMAND LINE BASED TOOL - http://www.ridgecrop.demon.co.uk/index.htm?fat32format.htm

Resetting PRAM and NVRAM on mac

Resetting PRAM and NVRAM

1. Shut down the computer.
2. Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
3. Turn on the computer.
4. Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
5. Hold the keys down until the computer restarts and you hear the startup sound for the second time.
6. Release the keys.

Setting up kernel boot architecure in mac osx permanently without worrying about holding 32 or 64 keys during the mac system bootiing

Now you are not required to hold 32 or 64 keys on keyboard to boot the snow leopard into respective OS mode. Run the below command to set the kernel boot parameter.

sudo systemsetup -setkernelbootarchitecture i386 | x86_64

Snow leopard will boot in respective os mode from next reboot onwards.

how to set up webDAV on Mac OS X

The following is how to set up webDAV on Mac OS X

1. Start Apache Server ( Go to System Preferences > Sharing, and turn on the box labeled Web Sharing.)

2. Enable WebDAV support in Apache. Edit the file /etc/apache2/httpd.conf, (remember to use sudo to edit it) and locate this line:

LoadModule dav_module libexec/apache2/mod_dav.so
Make sure it is not commented. Then locate this line (towards the bottom of the file):
Include /private/etc/apache2/extra/httpd-dav.conf
Again, make sure it is not commented out. It is disabled by default, so you need to remove the "#" from this line.

3. Configure WebDAV.

Edit the file /etc/apache2/extra/httpd-dav.conf. Add a section as below in it to create our new WebDAV share.


Alias /webdav "/Library/WebServer/WebDAV"



Dav On
Order Allow,Deny
Allow from all
AuthType Basic
AuthName WebDAV-Realm
AuthUserFile "/usr/webdav.passwd"


require user a…

Mounting temporary filesystem in linux

The below command will mount temporary file system on your linux computer

$ mount tmpfs /mnt/tmpfs -t tmpfs

Clearing kernel cache in linux

This is about the drop_caches tunability. It's available in kernel 2.6.16 and above, and exists in /proc/sys/vm.

If you echo various values to it, various kernel cache data structures are dropped. This is a non-destructive operation, so if you still see stuff hanging out after it, it's likely that it was dirty cache. Anyhow, on to the values:

1 - drop the pagecache
2 - drop the dentry and inode caches
3 - drop both the dentry and inode caches, as well as the pagecache.


echo 3 > /proc/sys/vm/drop_caches as a root or admin user