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

Friday, September 17, 2010

Accessing ALOM on Sun Servers

Default login and password:

root
changeme

To create an "admin" user:
create /SP/users/admin role=Administrator cli_mode=alom


To start the console prompt:


start /SYS
start /SP/console


To switch from ALOM to command prompt:


console -f

To change the IP:


cd /SP/network

set pendingipaddress=192.168.1.10
set pendingipnetmask=255.255.255.0
set pendingipgateway=192.168.1.1
set commitpending=true

Saturday, January 16, 2010

Linux Notes

Checking Firewall Status:
# service iptables status

Stopping/Starting firewall:
# service iptables stop/start

Wednesday, September 16, 2009

Mirroring the System Disk in Solaris

Partition the secondary disk the same as the primary:
prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2

Create the matadevices:
metadb –a –c 3 -f c0t0d0s7 c0t1d0s7

Initialize the root slices for both disks are as follows:
metainit -f d11 1 1 c0t0d0s0
metainit -f d12 1 1 c0t1d0s0


Create the meta device that will be the mirror:
metainit d10 -m d11

Create the root mirror:
metaroot d10

Do the similar procedure on the other disk partitions:
metainit d21 1 1 c0t0d0s1
metainit d22 1 1 c0t1d0s1
metainit d20 -m d21

*NOTE: Manually edit /etc/vfstab if mirroring the swap partition

REBOOT THE SYSTEM

metattach d10 d12
metattach d20 d22