Monday, November 26, 2007

Automatic Mount/Unmount Novell NetWare Shares in Linux

Purpose
  • Automatically mount Novell NetWare shares without prompting passwords when logging in.
  • Automatically unmount Novell NetWare shares without prompting passwords when logging out.

Configurations

  • "$HOME/.nwclient"
    • Create the file with permissions of "0600".
    • Add "Server/User Password" pair per each line as follows:
      NW_Server1/NW_UN1 PW1
      NW_Server2/NW_UN2 Password2

      where "NW_UN1/2" could be either just a NetWare username or
      a NetWare username appended by its context (e.g.,
      "joe.ee_dept.eng_school.great_univ").

  • "$HOME/.bash_profile"
    • Add "ncpmount" command as follows:
    • if [ ! -d /mount/point1/dir1_in_mounted_share ]; then
      # Check the above to prevent duplicate mount.
      ncpmount -S NW_Server1 -U NW_UN1 -u Linux_UN -V path/to/subdirectory1 -A NW_Server1_DNS_Name /mount/point1
      fi
      # We need "-m" below to allow multiple mounts from the same server.
      if [ ! -d /mount/point2/dir2_in_mounted_share ]; then
      ncpmount -S NW_Server2 -U NW_UN2 -u Linux_UN -V path/to/subdirectory2 -m -A NW_Server2_DNS_Name /mount/point2
      fi
      if [ ! -d /mount/point3/dir3_in_mounted_share ]; then
      ncpmount -S NW_Server2 -U NW_UN2 -u Linux_UN -V path/to/subdirectory3 -m -A NW_Server2_DNS_Name /mount/point3
      fi


  • "$HOME/.bash_logout"
    • Add "ncpumount" command as follows:
    •  if [ `w | grep pts | grep Linux_UN | wc -l` -eq 1 ]; then
      # The following will be executed only when this shell is the last login shell.

      if [ -d /mount/point1/dir1_in_mounted_share ]; then
      ncpumount /mount/point1
      fi
      if [ -d /mount/point2/dir2_in_mounted_share ]; then
      ncpumount /mount/point2
      fi
      if [ -d /mount/point3/dir3_in_mounted_share ]; then
      ncpumount /mount/point3
      fi
      fi

Tuesday, April 17, 2007

Linux Programming Environment Settings in Windows XP (with VMware)

  • GNU Emacs color settings & syntax highlighting for 256-color terminals (with PuTTy and screen):
    • See EmacsWiki: PuTTy for PuTTy settings.
      • Just change "xterm-256color" to "putty-256color" in "terminal-type-string".
    • Install "xterm-256color.el" under "lisp/term" directory.
      • Create "putty-256color.el" having the following line in the same directory:
        • (load "term/xterm-256color" nil t)
    • Install (from source) 256-color-enabled "screen".
    • Add "term putty-256color" in "$HOME/.screenrc".
  • Static IP address with NAT for Ubuntu server in VMware:
    • Update "interface" file under "/etc/networking" as follows:
      • From:

        iface eth0 inet dhcp


      • To:

        iface eth0 inet static
        address xxx.yyy.zzz.abc
        gateway xxx.yyy.zzz.2
        netmask 255.255.255.0
        network xxx.yyy.zzz.0
        broadcast xxx.yyy.zzz.255