Tuesday, January 18, 2011

Mac to Windows Domain

Mac to Windows Domain


Try this:

1. In the "Utilities" directory (which is a sub-directory of "Applications") there is a program called "Directory Access.app". Run that program.

2. Click the lock icon in the lower left corner of the app window. It will prompt you for your Administrator password. The lock should now be unlocked and you can make changes to the settings in this panel.

To Join a Workgroup:

3. Make sure the "Services" tab is highlighted. There should be a list of directory services; the last one on the list should be SMB/CIFS.

4. Highlight SMB/CIFS and click the "Configure" button. This will bring up a dialog containing two fields: Workgroup Name and WINS server. Type the name of your workgroup and WINS server.

To Join a Domain:

5. In the same way, hightlight Active Directory (should be near the top of the Directory Access panel) and click Configure.

6. Enter your settings for Active Directory Forest, Active Directory Domain, and Computer ID.

7. For more settings you can click the arrow next to Advanced Options in this panel and you'll have more configuration options. (note: the advanced settings should probably only be used by system administrators)

You may also need to adjust your TCP/IP settings to find your local domain:

8. Open the System Preferences control panel (either from the Apple menu or from the Dock) and choose Network.

9. Next to the word "Show" is a drop-down menu from which you can select the network port you want to configure (usually this will be either Airport or Built-in Ethernet)

10. Once you've selected your network port, the panel will change to show you a series of tabs. Choose the TCP/IP tab.

11. In the text field marked "DNS Servers", add an IP address for your local domain name server.

12. In the text field marked "search domains" add the name of your local domain.

You should, by this point, have full access to your company domain. Your system administrator should be able to make sense out of these control panels also and can help tweak them to meet the needs of your local domain.

Note that you can also do all of this through the Command Line from a Terminal window if you're more comfortable with the UNIX end of things - SMB and Active Directory settings are all the same as they would be from any Linux/Unix configuration - the mac GUI Directory Access and Network control panel just make things more visual.

And lastly, a very good description (with screenshots) of how to join a Windows domain can be found at:

http://weblog.bignerdranch.com/?p=6&page=3

More good information on how to integrate your mac into a Windows server environment can be found at:

http://www.macwindows.com

Thursday, January 6, 2011

View log files in Ubuntu Linux

View log files in Ubuntu Linux



Q. Can you explain me log files in Ubuntu Linux and how do I view logs?

A. All logs are stored in /var/log directory under Ubuntu (and other Linux distro).

Linux Log files and usage

=> /var/log/messages : General log messages

=> /var/log/boot : System boot log

=> /var/log/debug : Debugging log messages

=> /var/log/auth.log : User login and authentication logs

=> /var/log/daemon.log : Running services such as squid, ntpd and others log message to this file

=> /var/log/dmesg : Linux kernel ring buffer log

=> /var/log/dpkg.log : All binary package log includes package installation and other information

=> /var/log/faillog : User failed login log file

=> /var/log/kern.log : Kernel log file

=> /var/log/lpr.log : Printer log file

=> /var/log/mail.* : All mail server message log files

=> /var/log/mysql.* : MySQL server log file

=> /var/log/user.log : All userlevel logs

=> /var/log/xorg.0.log : X.org log file

=> /var/log/apache2/* : Apache web server log files directory

=> /var/log/lighttpd/* : Lighttpd web server log files directory

=> /var/log/fsck/* : fsck command log

=> /var/log/apport.log : Application crash report / log file

To view log files at shell prompt

Use tail, more, less and grep command.
tail -f /var/log/apport.log
more /var/log/xorg.0.log
cat /var/log/mysql.err
less /var/log/messages
grep -i fail /var/log/boot

Difference between RAID 0+1 vs RAID 1+0

"Difference between RAID 0+1 vs RAID 1+0"


We have covered RAID levels before in our posts. You can read about the different RAID levels here and the I/O characteristics here. While building up a DR (Disaster Recovery) environment for one of our clients, one of the questions asked by the client was: “How is RAID 1+0 different than RAID 0+1?”. Both RAID 0+1 and RAID 1+0 are multiple RAID levels which means that they are created by taking a number of disks and then dividing them up into sets. And within each of these sets, a single RAID level is applied to it in order to form the arrays. Then, the second RAID level is applied at the top of it to form the nested array. RAID 1+0 is also called as a stripe of mirrors and RAID 0+1 is also called as a mirror of stripes based on the nomenclature used for RAID 1 (mirroring) and RAID 0 (striping). Let’s follow this up with an example:
Suppose that we have 20 disks to form the RAID 1+0 or RAID 0+1 array of 20 disks.
a) If we chose to do RAID 1+0 (RAID 1 first and then RAID 0), then we would divide those 20 disks into 10 sets of two. Then we would turn each set into a RAID 1 array and then stripe it across the 10 mirrored sets.
b) If on the other hand, we choose to do RAID 0+1 (i.e. RAID 0 first and then RAID 1), we would divide the 20 disks into 2 sets of 10 each. Then, we would turn each set into a RAID 0 array containing 10 disks each and then we would mirror those two arrays.
So, is there a difference at all? The storage is the same, the drive requirements are the same and based on the testing also, there is not much difference in performance either. The difference is actually in the fault tolerance. Let’s look at the two steps that we mentioned above in more detail:
RAID 1+0:
Drives 1+2 = RAID 1 (Mirror Set A)
Drives 3+4 = RAID 1 (Mirror Set B)
Drives 5+6 = RAID 1 (Mirror Set C)
Drives 7+8 = RAID 1 (Mirror Set D)
Drives 9+10 = RAID 1 (Mirror Set E)
Drives 11+12 = RAID 1 (Mirror Set F)
Drives 13+14 = RAID 1 (Mirror Set G)
Drives 15+16 = RAID 1 (Mirror Set H)
Drives 17+18 = RAID 1 (Mirror Set I)
Drives 19+20 = RAID 1 (Mirror Set J)
Now, we do a RAID 0 stripe across sets A through J. If drive 5 fails, then only the mirror set C is affected. It still has drive 6 so it will continue to function and the entire RAID 1+0 array will keep functioning. Now, suppose that while the drive 5 was being replaced, drive 17 fails, then also the array is fine because drive 17 is in a different mirror set. So, bottom line is that in the above configuration atmost 10 drives can fail without effecting the array as long as they are all in different mirror sets.
Now, let’s look at what happens in RAID 0+1:
RAID 0+1:
Drives 1+2+3+4+5+6+7+8+9+10 = RAID 0 (Stripe Set A)
Drives 11+12+13+14+15+16+17+18+19+20 = RAID 0 (Stripe Set B)
Now, these two stripe sets are mirrored. If one of the drives, say drive 5 fails, the entire set A fails. The RAID 0+1 is still fine since we have the stripe set B. If say drive 17 also goes down, you are down. One can argue that that is not always the case and it depends upon the type of controller that you have. Say that you had a smart controller that would continue to stripe to the other 9 drives in the stripe set A when the drive 5 fails and if later on, drive 17 fails, it can use drive 7 since it would have the same data. If that can be done by the controller, then theoretically speaking, RAID 0+1 would be as fault tolerant as RAID 1+0. Most of the controllers do not do that though.

Wednesday, January 5, 2011

How to assign IP in Ubuntu machine

Static IP to Ubuntu Server

Trick: to know what network interface your machine have
$ sudo lshw -class network
$ vim /etc/network/interfaces

Find and remove dhcp entry:

iface eth0 inet dhcp

Append new network settings:

iface eth0 inet static

address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254

Save and close the file. Restart the network:

$ sudo /etc/init.d/networking restart

Task: Define new DNS servers or Name Server

$ sudo vim /etc/resolv.conf

search myisp.com
nameserver 192.168.1.254
nameserver 202.54.1.20
nameserver 202.54.1.30

CHANING THE HOSTNAME

$ vim /etc/host
and give the name

$ vim /etc/hostname
and give the name again
$/etc/init.d/hostname.sh start