Thursday, October 20, 2011

From the source server:

· Edit /etc/exports and add the following line:

/directory_to_share HOSTNAME(rw,no_root_squash)

Note: HOSTNAME = IP or hostname of server mounting the share, replace rw with ro for read-only

· Start NFS daemon

# service nfs start

· Export the share

#exportfs -a

· Confirm if the share has been exported

#exportfs

From the destination(mounting) server:

· Start the NFS daemon

# service nfs start

· Create the mount point

# mkdir /mountdir

· Backup /etc/fstab file (mounting table)

# cp /etc/fstab /etc/fstab.old

· Edit /etc/fstab and add this line:

IP_OF_SOURCE:/shared_directory /mountpoint nfs defaults 0 0

· Mount the share by command line

# mount /mountpoint

· Confirm that it is mounted

# df -h /mountpoint

Wednesday, September 28, 2011

Turning on/off SELINUX on Linux

1. Temporarily switch off enforcement
You can switch the system into permissive mode with the following command:
# echo 0 >/selinux/enforce
You'll need to be logged in as root, and in the sysadm_r role:
# newrole -r sysadm_r

2. To switch back into enforcing mode:
# echo 1 >/selinux/enforce

In Fedora Core and RedHat Enterprise Linux you can use the setenforce command with a 0 or 1 option to set permissive or enforcing mode, its just a slightly easier command than the above.
To check what mode the system is in,

cat /selinux/enforce

Wednesday, February 2, 2011

Image sharpening using Photoshop

1. Edit and make adjustments to you image as you wish.
2. Save your PSD file if you want to keep your layers and orginal full size for re-editing later.
3. Resize image to your web size if you choose to.
4. Layers > Flatten image.
5. Duplicate background layer.
6. Make sure the copy of background layer is selected.
7. Filter > Sharpen > Unsharp Mask - enter Amount 18, Radius 40, Threshold 0 - press OK.
8. Filter > Sharpen > Unsharp Mask - enter Amount 150, Radius 0.3, Threshold 0 - press OK.
9. Edit > Fade Unsharp Mask - enter Opacity 100% and select Darken in the Mode dropdown list - press OK
10. Filter > Sharpen > Unsharp Mask - enter Amount 150, Radius 0.3, Threshold 0 - press OK.
11. Edit > Fade Unsharp Mask - enter Opacity 50% and select Lighten in the Mode dropdown list - press OK.
12. Layers > Flatten image.
13. Save as .jpg

Done!!!.

Tuesday, January 4, 2011

Sendmail Notes

To restrict relaying from particular domains and subnets:
- Create or edit a file names /etc/mail/access

- Add lines similar to the following:
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
From:xyz.com RELAY
10 RELAY
Connect:127.0.0.1 RELAY
Connect:10. RELAY
Connect:172.25 RELAY

- Save the file and run :
# makemap hash /etc/mail/access.db < /etc/mail/access


To define the mail relay for each domain:
- Edit the file /etc/mail/mailertable

- Add lines similar to the following:
abc.com smtp:[10.50.1.10]
xyz.com smtp:[10.50.1.10]

- Save the file and run this:
makemap hash /etc/mail/mailertable < /etc/mail/mailertable