Wednesday, 26 June 2013

Install Forefront TMG

Note that this guide will provide only a basic configuration setting, you may need to verify them as your desired.

1. You need Windows 2008 Sp1 R2 64 bit version then load the Forefront TMG from the Microsoft website - I have loaded it from MSDN
2. Login to the server using the user name which is in the same domain as your machine if the server already joined any domain.
3. Mount Forefront DVD iso then run installation wizard
4. Click Next until Define Internal Network click Add.. > Add Adepter.. > Select all then next
5. Wait…
6. Launch Forefront configuration wizard
7.Configure Network setting > select single network adepter > select LAN > fix ip address
8.Configure System setting Just next
9. Deployment option select No 
10.Download isa_tpr.js
11. Run cmd as admin
12. Modify HTTP and HTTPS port range
C:\>cscript isa_tpr.js
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.


This is your current Tunnel Port Range list:
        NNTP (single port): 563
        SSL (port range) : 443

C:\>cscript isa_tpr.js /del SSL
C:\>cscript isa_tpr.js /add HTTP 14000-15000
C:\>cscript isa_tpr.js /add SSL 17000-18000
C:\>cscript isa_tpr.js
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.


This is your current Tunnel Port Range list:

        HTTP (port range) : 14000 --> 15000
        NNTP (single port): 563
        SSL (port range) : 17000 --> 18000
13. Configure firewall by select Firewall policy > tasks > create access rule > enter name > allow > This rule applies  to all outbound traffic > add source and destination select both external and internal > add user All authenticate and All user
14. Save configure
15. Disable HTTPS Inspection/Malware Inspection
16.  Save configure and wait for 30-60 secs.
Result:
-- begin response --
HTTP/1.1 407 Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  )
Via: 1.1 FOREFRONT
Proxy-Authenticate: Basic realm="FOREFRONT.rdc.reuters.com"
Connection: close
Proxy-Connection: close
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 721  

Error Message
Network Access Message: The page cannot be displayed
Technical Information (for Support personnel)
  • Error Code: 407 Proxy Authentication Required. Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. (12209)
  • IP Address: 192.168.27.104
  • Date: 6/24/2013 11:07:51 AM [GMT]
  • Server: FOREFRONT.rdc.reuters.com
  • Source: proxy

  • -- end response --
    *** The proxy requested a close (during authentication). Reconnecting. ***

    CONNECT 192.168.27.33:14002 HTTP/1.1
    User-Agent: RFA/Java
    Proxy-Connection: Keep-Alive
    Content-Length: 0
    Host: 192.168.27.33:14002
    Pragma: no-cache
    Proxy-Authorization: BASIC QWRtaW5pc3RyYXRvcjpBcGlyZXV0ZXJzMQ==
    -- begin response --
    HTTP/1.1 200 Connection established
    Via: 1.1 FOREFRONT
    Connection: Keep-Alive
    Proxy-Connection: Keep-Alive

    -- end response --
    Connection established to FOREFRONT:8080
     


    Wednesday, 16 January 2013

    Great set of Basic Java Garbage Collection -0-

    http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html

    Sunday, 27 November 2011

    PXE for windows install mounted drive

    net use z: \\192.168.8.121\vista /u:192.168.8.121\administrator "apibkk"
    net use z: \\192.168.8.121\vista64 /u:192.168.8.121\administrator "apibkk"
    net use z: \\192.168.8.121\2008 /u:192.168.8.121\administrator "apibkk"
    net use z: \\192.168.8.121\200864 /u:192.168.8.121\administrator "apibkk"
    net use z: \\192.168.8.121\seven /u:192.168.8.121\administrator "apibkk"
    net use z: \\192.168.8.121\seven64 /u:192.168.8.121\administrator "apibkk"

    Sunday, 2 October 2011

    Startup PXE

    1. Run C:\PXE\binl\binlsrv.exe
    2. Run C:\PXE\tftpd32\tftpd32.exe
    3. Start dhcpd service : service dhcpd restart
    4. Start up share server

    Monitor : tail -f /var/log/messages
    leases file : /var/lib/dhcpd/dhcpd.leases

    Friday, 24 June 2011

    Basic DHCP configuration for PXE

    Setup DHCP for others network and let client boot the image from the PXE boot server.

    # vi /etc/dhcpd.conf
    ddns-update-style interim;
    ignore client-updates;
    authoritative;

    subnet 192.168.8.0 netmask 255.255.255.0 {
    # --- default gateway
    option routers 192.168.8.254;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.8.255;
    # --- NIS configuration
    option nis-domain "RFAQANIS";
    option nis-servers 192.168.8.150;
    # --- Domain name configuration
    option domain-name "RFAQANIS";
    option domain-name-servers 10.42.33.25;
    # --- Other configuration
    option time-offset -18000; # Eastern Standard Time
    # --- Dynamic ip provided only for diskless server
    range dynamic-bootp 192.168.8.86 192.168.8.91;
    default-lease-time 21600;
    max-lease-time 43200;
    }

    allow booting;
    allow bootp;

    # PXE-spcecific configuration directories...
    next-server [PXE-server-IP];
    filename "pxelinux.0";

    Tuesday, 31 May 2011

    Kickstart Guide for RHEL

    This post continued from PXE boot server setup but the propose of this is to create an automatic setup configure/script while install RHEL via PXE.
    (refer to PXE boot server configure in previous post --> http://aflando.blogspot.com/2011/05/how-to-setup-pxe-boot-server-on-windows.html)

    [Basic requirements]
    1. Automatic install via NFS server(assume 192.168.8.184:/share/pxe already been shared)
    2. Have a default value and let client click next to confirm or change it to own value.
    3. Default value for keyboard, language and timezone.
    4. Automatic add key(only AS5)
    5. Start x windows on boot with GNOME
    6. Interactive Network configuration
    7. Firewall disabled (Not recommended)
    8. Enable shadowed MD5 passwords
    9. SELinux disabled (Not recommended)
    10. Configure boot loader
    11. Interactive disk layout
    12. Automatic selecting package

    [KickStart configuration]
    /share/pxe/install/kickstart/ks.cnf file :

    # RedHat Enterprise WS Kickstart configuration
    ## - - install type/source - - - - - - - - - - -
    install
    interactive
    nfs --server=192.168.8.184 --dir=/share/pxe/32as4u8

    ## - - language and input support - - - - - - - -
    lang en_US
    keyboard us
    timezone Asia/Bangkok

    # enable X at boot time with GNOME as the default desktop
    xconfig --startxonboot --defaultdesktop=GNOME

    # for the install we get the IP address by DHCP
    # AS4U8 network --device eth0 --bootproto dhcp
    # AS5U6 network --bootproto=query
    --noipv6
    # AS6 xxxx
    network --device eth0 --bootproto dhcp

    firewall --disabled

    # enable shadowed MD5 passwords
    authconfig --enableshadow --enablemd5
    selinux --disabled

    ## - - boot loader- - - - - - - - - -
    bootloader --location=mbr

    clearpart --all --initlabel

    #For AS4U8 and AS5U6
    %packages
    @ X Window System
    @ GNOME Desktop Environment
    @ FTP Server
    @ Legacy Network Server
    @ Administration Tools
    @ System Tools

    #AS4U8 will not select telnet-server,Let post script do
    #AS5U8 will auto-select

    telnet-server

    #Package section for AS6
    #%packages
    #@ X Window System
    #@ Desktop
    #@ FTP Server
    #@ Networking Tools
    #telnet
    #telnet-server

    # post-installation script starts
    %post --interpreter /bin/sh

    mkdir -p /mnt/tmp
    mount 192.168.8.184:/share/pxe/32as4u8 -o ro /mnt/tmp
    # run the top-level post-install script
    # AS4U8 cd /mnt/tmp/RedHat/RPMS
    # AS5U6 cd /mnt/tmp/Server
    # AS6 cd /mnt/tmp/Server/Packages/
    cd /mnt/tmp/RedHat/RPMS
    rpm -ivf telnet-server*
    cd /
    # unmount the disk and delete the mount point
    umount /mnt/tmp
    rmdir /mnt/tmp

    # enable telnet service
    chkconfig telnet on
    chkconfig vsftpd on
    service xinetd restart
    service vsftpd restart
    mv /etc/securetty /etc/securetty.org
    # post-installation script ends

    [PXE boot server configuration]

    Configure file C:\PXE\tftpboot\pxelinux.cfg\default
    Example for AS4U8 :

    label 32as4u8
    menu label Install AS4U8 32bit
    kernel /32as4u8/images/pxeboot/vmlinuz
    append initrd=/32as4u8/images/pxeboot/initrd.img console=tty0 ks=nfs:192.168.8.184:/share/pxe/install/kickstart/32as4u8_ks.cfg ramdisk_size=268235456

    Monday, 30 May 2011

    How to setup PXE boot server on Windows XP Part IV

    New requirement came again.Let's setup PXE for booting VMware ESXi and Solaris 10 (x86).

    For VMware ESXi
    1. Create directory C:\PXE\tftpboot\vmware\esxi that contain all files from ESXi iso.

    2. Update content of C:\PXE\tftpboot\pxelinux.cfg\default

    label ESXi
    menu label Install VMware ESXi 4.0
    kernel /vmware/esxi/mboot.c32
    append /vmware/esxi/vmkboot.gz --- /vmware/esxi/vmkernel.gz --- /vmware/esxi/sys.vgz --- /vmware/esxi/cim.vgz --- /vmware/esxi/ienviron.tgz --- /vmware/esxi/image.tgz --- /vmware/esxi/install.tgz --- /vmware/esxi/cimstg.tgz
    iappend 2

    3. Done.So easy!!!

    For Solatis 10 x86
    Actually Solaris 10 x86 can be installed via jumpstart but I would like to mix them all together to only one mechanism that is PXEboot.
    Solaris has a pxe file (pxegrub) for booting via pxe but it can not be loaded directly.
    We need to configure pxelinux to load pxegrub and pxegrub will load menu.lst

    At your NFS server
    1. mount the iso file:
    [root@RFATEST184 /]# mount -F hsfs -o ro `lofiadm -a /temp/sol-10-u9-ga-x86-dvd.iso` /mnt

    note : if lofiadm is busy uses command below then mount mnt
    [root@RFATEST184 /]# lofiadm
    Block Device File
    /dev/lofi/1 /temp/sol-10-u9-ga-x86-dvd.iso
    [root@RFATEST184 /]# lofiadm -d /dev/lofi/1

    2. Created and shared file in directory /pxeboot/solarisX86
    [root@RFATEST184 /]# share
    - /pxeboot ro ""

    note : changed /etc/dfs/dfshare by adding line
    share -F nfs -o ro /pxeboot
    and save then use command shareall

    3. Go to /mnt/Solaris_10/Tools that run setup_install_server and wait

    [root@RFATEST184 /]# ./setup_install_server /pxeboot/solarisX86/

    4. Check required file in your shared directory

    [root@RFATEST184 boot]# ls -li multiboot x86.miniroot grub/pxegrub grub/menu.ls
    t
    474188 -r--r--r-- 1 root root 564 Aug 12 2010 grub/menu.lst
    474191 -r--r--r-- 1 root root 139920 Aug 6 2010 grub/pxegrub
    474202 -r-xr-xr-x 1 root root 136552 Aug 12 2010 multiboot
    474209 -r--r--r-- 1 root root 87891019 Aug 12 2010 x86.miniroot

    5. Now open your windows xp PXE boot server then ftp to NFS server and copy required file
    ****important****
    change file pxegrub to pxegrub.0 (add .0)

    Directory of C:\PXE\tftpboot\solarisX86\boot
    08/12/2010 12:00 AM 136,552 multiboot

    08/12/2010 12:00 AM 87,891,019 x86.miniroot


    Directory of C:\PXE\tftpboot\Boot\grub

    05/30/2011 05:03 PM 260 menu.lst

    08/06/2010 12:00 AM 139,920 pxegrub.0


    Note : menu.lst need to be in boot\grub dir because your pxegrub.0 will look into that dir by default
    6. Configure file C:\PXE\tftpboot\pxelinux.cfg\default by adding below entry and save it.

    label SolarisX86

    menu label Install Solaris 10U9 X86

    kernel /boot/grub/pxegrub.0

    7.
    Configure file C:\PXE\tftpboot\Boot\grub\menu.lst

    timeout=15

    title Solaris 10 Update 9 x86

    kernel /solarisX86/boot/multiboot kernel/unix -v -m verbose install nfs://192.168.8.184/pxeboot/solarisX86/jumpstart/config.tar -B install_media=192.168.8.184:/pxeboot/solarisX86/

    module /solarisX86/boot/x86.miniroot


    8. Get back to NFS server,We still missed config.tar that contain 4 files in /pxeboot/solarisX86/jumpstart (create new dir)

    8.1 rules file
    [root@RFATEST184 jumpstart]# cat rules
    any - - any_machine -

    8.2 rules.ok file
    [root@RFATEST184 jumpstart]# cat rules.ok

    any - - any_machine -

    # version=2 checksum=num

    8.3 sysidcfg file
    [root@RFATEST184 jumpstart]# cat sysidcfg

    system_locale=en_US

    install_locale=en_US

    terminal=vt100

    name_service=NONE

    network_interface=PRIMARY {protocol_ipv6=no}

    security_policy=NONE

    timeserver=localhost

    8.4 any_machine file
    [root@RFATEST184 jumpstart]# cat any_machine

    install_type initial_install

    cluster SUNWCXall

    package SUNWaccr add

    fdisk all solaris all

    partitioning explicit

    filesys any free /

    filesys any 4096 swap

    system_type server

    8.5 Then tar all file
    [root@RFATEST184 jumpstart]# tar c rules rules.ok any_machine sysidcfg > /pxeboot/solarisX86/jumpstart/config.tar


    9. Done

    Thursday, 19 May 2011

    How to setup PXE boot server on Windows XP Part III

    I got a new requirement from my team to add RHEL and SUSE into the existing PXE boot server,OK that would be easier than Windows.

    Tested OS:
    RHEL AS4U8/5U6/6
    SUSE 10sp3/11sp1

    My PXE boot is just a normal windows xp machine with 20 GB harddisk that is insufficient for keeping all os images so I decided to setup NFS in different machine.Fortunately there is unused SUN server in my farm so I will setup it as my NFS server to keep images file.

    1. At your NFS server,mount the iso file:

    [root@RFATEST184 /]# mount -F hsfs -o ro `lofiadm -a /temp/rhel-server-6.0-i386-dvd.iso` /mnt

    2. Created and shared file in directory /share/pxe

    [root@RFATEST184 pxe]# share
    - /share/pxe ro ""

    3. Copy all files in /mnt to /share/pxe/[OS image]

    [root@RFATEST184 pxe]# cp -pr /mnt/* /share/pxe/32as6/

    4. Check required file in your share directory

    For RHEL
    [root@RFATEST184 32as6]# pwd
    /share/pxe/32as6
    [root@RFATEST184 32as6]# ls -li images/pxeboot/
    total 63074
    275230 -r--r--r-- 1 root root 441 Sep 23 2010 TRANS.TBL
    275231 -r--r--r-- 1 root root 28587578 Sep 23 2010 initrd.img
    275232 -r-xr-xr-x 1 root root 3667328 Sep 23 2010 vmlinuz

    For SUSE
    [root@RFATEST184 loader]# pwd
    /share/pxe/32suse10sp3/DVD1/boot/i386/loader
    [root@RFATEST184 loader]# ls -li linux initrd
    576202 -rw-r--r-- 1 root root 10726367 May 14 13:03 initrd
    576210 -rw-r--r-- 1 root root 1305277 May 14 13:03 linux

    5. Now open your windows xp PXE boot server then ftp to NFS and copy 'image' directory for RHEL or 'boot' directory for SUSE to tftpboot directory

    C:\PXE\tftpboot>ls 32as6\images\pxeboot
    TRANS.TBL initrd.img vmlinuz

    C:\PXE\tftpboot>ls 32suse10sp3\boot\i386\loader\linux
    32suse10sp3\boot\i386\loader\linux

    C:\PXE\tftpboot>ls 32suse10sp3\boot\i386\loader\initrd
    32suse10sp3\boot\i386\loader\initrd

    6. Configure file C:\PXE\tftpboot\pxelinux.cfg\default by adding below entry and save it.

    For RHEL
    label 32AS6
    menu label Install AS6 32bit
    kernel /32as6/images/pxeboot/vmlinuz
    append initrd=/32as6/images/pxeboot/initrd.img switches

    For SUSE
    label 32suse10
    menu label Install Suse 10sp3 32bit
    kernel /32suse10sp3/boot/i386/loader/linux
    append initrd=/32suse10sp3/boot/i386/loader/initrd splash=silent showopts

    7.
    Boot the client PC using PXE boot option
    8. Select an option from the menu
    9. the ramdisk OS will be loaded.Don't forget to select Network/NFS source image for installation(Setup NFS's IP and shared directory)
    10. enjoy setup.

    Friday, 11 March 2011

    How to setup PXE boot server on Windows XP Part II

    Ok After you got PXE boot server,The remaining steps are adding OS image for installation.Below steps are only for windows vista/2008/7 both 32 and 64 bit edition.

    1. Install WinPE3.0 -> WAIK (Note: you need to install .NET Framework 2.0 and MSXML 6 SP1 as well)
    2. Run [4a_WinPE.cmd] and [4b_WinPE.cmd] so easy.
    3. Configure file
    C:\PXE\tftpboot\pxelinux.cfg\default by adding below entry

    LABEL winpe
    MENU LABEL WinPE 3.0
    KERNEL /boot/pxeboot.0

    4.
    Add option for OS installation
    • If adding Windows Vista, copy all files and folder from Windows Vista source to C:\PXE\tftpboot\vista\ - share C:\PXE\tftpboot\vista\ as vista
    • If adding Windows 2008, copy all files and folder from Windows 2008 source to C:\PXE\tftpboot\2008\ - share C:\PXE\tftpboot\2008\ as 2008
    • If adding Windows 7, copy all files and folder from Windows 7 source to C:\PXE\tftpboot\seven\ - share C:\PXE\tftpboot\seven\ as seven
    5. Start C:\PXE\tftpd32\tftpd32.exe
    6.
    Start C:\PXE\binl\binlsrv.exe
    7.
    Boot the client PC using PXE boot option
    8. Select an option from the menu
    9. Select the first Ramdisk options entry if your source files are 32-bit or Select the second Ramdisk options entry if your source files are 64-bit
    10. Once WinPE has booted enter command.Select one below:
    Vista : net use z: \\[your server's ip]\vista /u:[your server's ip]\[your server's user] "[your user's password]"
    2008 : net use z: \\[your server's ip]\2008 /u:[your server's ip]\[your server's user] "[your user's password]"
    7 : net use z: \\[your server's ip]\7 /u:[your server's ip]\[your server's user] "[your user's password]"
    10. Enter drive Z:
    11. run setup.exe then enjoy!!!

    Thursday, 10 March 2011

    How to setup PXE boot server on Windows XP

    Credit by : http://diddy.boot-land.net/pxe/files/walkthrough.htm
    Thank you so much
    Link for script and a cool guide -> http://diddy.boot-land.net/ccount12/click.php?id=3

    [My steps are quite for a dummy user,don't need to know anything about the theories;If you would like to understand about PXE,read the cool guide above.]

    System Requirement:
    1. PXE boot server : Windows XP sp3 32bit
    2. PXE client : Support PXE boot sequence.
    3. Network setup in the same lan.

    Preparation phase on PXE boot server:
    1. Create mandatory directory c:\PXE Recommand use creating script [1_create_folders.cmd]
    2. Share C:\PXE\tftpboot\ as tftpboot - simple file sharing must be used for the share [Just click Right and share it]
    3. Add registry patch and reboot PC - open notepad,copy and paste code below

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
    "NullSessionPipes"=hex(7):43,00,4f,00,4d,00,4e,00,41,00,50,00,00,00,43,00,4f,00,4d,00,4e,00,4f,00,44,00,45,00,00,00,53,00,51,00,4c,00,5c,00,51,00,55,00,45,00,52,00,59,00,00,00,53,00,50,00,4f,00,4f,00,4c,00,53,00,53,00,00,00,4c,00,4c,00,53,00,52,00,50,00,43,00,00,00,62,00,72,00,6f,00,77,00,73,00,65,00,72,00,00,00,73,00,72,00,76,00,73,00,76,00,63,00,00,00,00,00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
    "RestrictAnonymous"=dword:00000000

    save as PXEboot.reg and exit,then double click the file.Don't forget reboot your server.
    4. Install helpful tools
    4.1 7-zip Windows 32 command line version -> http://www.7-zip.org/ download and install it after that copy file C:\Program Files\7-Zip\7z.exe to C:\PXE\tools.Change the exe file name from 7z to 7za because our script uses this format!!
    4.2 Download gsar -> http://gnuwin32.sourceforge.net/packages/gsar.htm download and install it that copy file C:\Program Files\GnuWin32\bin\gsar.exe to C:\PXE\tools.
    4.3 Download syslinux version x.xx -> http://www.kernel.org/pub/linux/utils/boot/syslinux/ download and save it in C:\PXE\tools
    4.4 Download tftpd32 -> http://tftpd32.jounin.net/tftpd32_download.html download and save it in C:\PXE\tftpd32\
    4.5 Download binl.zip -> http://diddy.boot-land.net/ccount12/click.php?id=5 and extract the contents to C:\PXE\binl\
    5. Modified script [_parameters.cmd]

    set SERVER_IP=[your server's ip]

    The default is 192.168.2.2.Change it!!!

    set syslinux=[your syslinux zip file name]

    The default is syslinux-3.80.zip.Change it!!!
    6. Run [2a_syslinux.cmd]
    7. Configure C:\PXE\tftpd32\tftpd32.exe.Read carefully
    7.1 Click Settings button
    7.2 On the Global tab -> select only TFTP server and DHCP server
    7.3 On TFTP tab -> set Base Directory as C:\PXE\tftpboot , TFTP security as Read only ,Advanced TFTP options select only Option negotiation.
    7.4 On DHCP tab -> set DHCP Pool definition depends on your requirement.Boot file needs to be pxelinux.0

    OK..Now we got the PXE boot server,Let's try by starting your client and booting it with PXE.
    Boot menu will appear but no selectable OS..absolutely continue in part II.

    Thursday, 1 October 2009

    How to check memory size in Solaris

    ref : http://sysdigg.blogspot.com/2007/12/how-to-check-memory-size-in-solaris.html
    There are various options to check memory in Solaris. I am running Solaris 8 on Sun Fire server, these Solaris commands can run on any x86 or SPARC platforms.

    1. Check real/physical memory size in Solairs using dmesg (message information during boot time ):

    # dmesg |grep mem

    Dec 14 21:56:21 bos-solaris unix: [ID 168242 kern.info] mem = 523836K (0x1ff8f000)

    This Solaris server has 512 mb physical memory ,dmesg output show memory in kilobytes which is 512 Megabytes.

    2. Check memory size in solairs using prtdiag (only on sparc) :

    # /usr/platform/sun4u/sbin/prtdiag |grep Memory

    Memory size: 512 Megabytes

    Running prtdiag output show memory as 512 megabyes

    3. Check Memory size in Solaris using prtconf :

    # prtconf -v |grep Mem

    Memory size: 512 Megabytes

    Running prtconf with –v shows memory size in megabytes

    How to check Linux release/update in RHEL/fedora/CentOS

    ref : http://sysdigg.blogspot.com/2007/12/how-to-check-linux-releaseupdate-in.html
    How to check Linux release/update in RHEL/fedora/CentOS

    To upgrade fedora, centos and Redhat enterprise Linux you need to know what release and what update you are currently running on your server. You can check release by running uname –r, but uname –r shows kernel release not the Linux OS release/updates. Here is how you can check Linux OS release and updates:

    In Redhat enterprise linux,fedora and centos to check update running :

    In Redhat enterprise Linux 5 (RHEL5) to check release and update run command:

    #cat /etc/redhat-release

    Red Hat Enterprise Linux Server release 5.1 (Tikanga)

    Looking into redhat-release file contents reveals that my Linux server is running Redhat Enterprise Linux release (RHEL5) 5.1 and base OS namaed Tikanga.

    In Redhat enterprise Linux 4(RHEl4) to check release and update run command:

    [root@svn ~]# cat /etc/redhat-release

    Red Hat Enterprise Linux ES release 4 (Nahant Update 3)

    This Linux server running RHEL4 (code name= Nahant) with installed update 3.

    In Fedora to check release and update run following command:

    #cat /etc/redhat-release

    Fedora release 8 (Werewolf)

    This Linux server running Fedora 8 and base OS named Werewolf

    On Debian I don't find any command to check Linux OS update. If anyone find the command to check what debian update is installed please let me know. However I find glimpse of

    Update in /etc/issue:

    #cat /etc/issue :

    Debian GNU/Linux 4.0 \n \l

    How to Check Disk space in Linux

    ref : http://sysdigg.blogspot.com/2008/03/how-to-check-disk-space-in-linux.html
    How to Check Disk space in Linux

    For Linux beginners sometimes it's very hard for them to perform simple administration tasks like check available disk space. I know some Windows folks at my work who tried to get their hands into Linux so they installed Fedora 8 on PC. But soon they realized that they couldn't do some basic tasks like check free disk space, sharing directories, configuring printers etc etc to name a few. Checking disk space I Linux is not very difficult in Linux .There are two ways to check disk space in Linux

    * Check disk space in Linux using command line
    * Check disk space in Linux by using Graphical tool if you have some sort of graphical desktop installed.

    Check disk space using command line in Linux:

    Open command terminal

    window if you are running Graphical windows manager. If you don't know how to open

    command terminal window see how

    Run df –h , UNIX friendly way is to run df –k but if want disk

    space displayed in Megs and Gigabytes then use df –h :

    [root@fedoradev]# df -h

    Filesystem Size Used

    Avail Use% Mounted on

    /dev/mapper/vgroot-lvroot

    20G 12G 7.2G 62% /

    /dev/cciss/c0d0p1 97M 16M 76

    M 18% /boot

    none 2.0G 0 2.0G 0% /dev/shm

    /dev/mapper/vgdata-lvdata 22G 62G 245G 21% /data

    Check disk space in Linux using GUI:

    From command line run command:

    [root@fedoradev # baobab &

    OR

    From desktop Select Systems Tools from Applications and then select Disk usage analyzer, this will launch a GUI window.

    Select Filesystem icon

    if you want to check the disk space for the file systems or select Folder icon if you want to see disk space for each and every directory on your Fedora machine

    How to check Memory size in Linux

    ref : http://sysdigg.blogspot.com/2007/12/how-to-check-memory-size-in-linux.html
    How to check Memory size in Linux

    In all Linux operating Systems memory size can be checked by running dmesg,free, top and using Kernel proc information. Linux is very cool it offers various pre-installed tools and commands to check memory size compared to UNIX Operating systems.

    To check memory size in Linux using dmesg, run the following command:

    [root@earth ~]# dmesg |grep -i memory

    Memory: 4084332k/4653052k available (1868k kernel code, 43456k reserved, 755k data, 180k init, 3211208k highmem)

    Running dmesg command in Linux displays memory in kilobytes, on this Linux server total memory size is 4 Gg.For checking memory dmesg command is also available in Solaris and HP-UX.To check memory size in linux using /proc information run following from the command line:

    [root@svn ~]# cat /proc/meminfo |grep -i memtotal

    MemTotal: 4086484 kB

    /proc/meminfo shows total memory size configured as 4086484 displayed in kilobytes (KB).

    To check memory size on Linux using free command, run the following:

    [root@svn ~]# free

    total used free shared buffers cached

    Mem: 4086484 4033924 52560 0 71764 3122188

    -/+ buffers/cache: 839972 3246512

    Swap: 4194216 376 4193840

    Free command on linux also displays used,free memory,cached memory ,shared and memory

    buffer size. You can use –m option to check Linux memory utilization in megabytes:

    [root@svn ~]# free -m

    total used free shared buffers cached

    Mem: 3990 3523 467 0 69 2649

    -/+ buffers/cache: 804 3185

    Swap: 4095 1 4094

    Linux also comes with top command, top can be run to check real memory size and memory utilization.Top display total memory size,used memory,free memory ,memory buffers size and swap memory utilization :

    top - 08:05:36 up 6 days, 16:46, 7 users, load average: 0.07, 0.09, 0.08

    Tasks: 131 total, 1 running, 130 sleeping, 0 stopped, 0 zombie

    Cpu(s): 4.2% us, 0.5% sy, 0.0% ni, 95.3% id, 0.0% wa, 0.0% hi, 0.0% si

    Mem: 4086484k total, 3609956k used, 476528k free, 71752k buffers

    Swap: 4194216k total, 1100k used, 4193116k free, 2713504k cached

    Ubuntu and fedora linux also comes with package called lshw (list hardware) which provides

    detailed information on memory size, how many memory dims available, memory slots free along with other Linux system Hardware information .Run lshw and scroll down to *-memory section :

    #lshw |grep

    *-memory

    description: System Memory

    physical id: 39

    slot: System board or motherboard

    size: 1GB

    Saturday, 26 September 2009

    Setting Up a FTP server with SSL

    Ref: http://filesharingtalk.com/vb3/f-guides-and-tutorials-65/t-setting-up-ftp-server-ssl-276623/
    Sever Setup


    1. Download Filezilla server software on your server. Click Here.

    2. Install with default settings.

    3. We will be restricting which IP's can access the server's ftp. Click Edit, Settings, General Settings, IP filter.

    The top box is where you can block IP's from accessing the FTP, the easiest method is to build your range and have you ip be excluded, rather then build a custom range around your ip.



    Paste the following into the block list:
    *.*.*.*

    That will automatically block all IP addresses.

    4. Add your ip to the addresses to be excluded from the block, the lower box.

    5. Since we are in the general settings, we will tweak a few other things. In the general settings, change the port to 990, Change connection time out to 0, no transfer time out 800, login timeout 60. Those are what I use as the default always messes with some of my friends clients.



    6. I personally delete the welcome message, its up to you though.

    7. Go to SSL/TLS settings, Check the enable box, check allow explicit box, and check force explicit box.



    8. Generate a new certificate by clicking the button. I always select the maximum encryption, 4096byte. All the information can be random, EXCEPT for common name (server address), put the servers ip address there. Select where you want to save it, and generate it.



    9. Go back to the ssl/tls settings page, for the private key file and certificate file, browse to the certificate you just made. Set a key password. You can finally click ok, as we are done with the server settings.




    10. Create a user group: Edit-->groups

    11. Click add, make it whatever name you want.



    12. Check all three boxes there, adjust max. connection to 100 and connection limit to 0



    13. Click the shared folders tab...click add. Select your group on the right, then the add folder button willl be the main directory that you will see when you log in. I always just have everything downloaded into one folder and just share that one folder as it is easier.




    14. Click ok.

    15. Now create a user for your group ----Edit---users

    16. Add them, make them a part of the user group you made.

    17. Then put checks in all 4 boxes on that screen (enable account, password, bypass server, force ssl) Set max connection count and connection limit to 0 and Click ok.




    Now that is the server side...next up is client side.

    Client Side:

    You can use any client that supports SSL, however I highly recommend using a client like Cuteftp as it takes advantage of multipart download, which is very important if speed means anything to you. For mac users, they also have a mac version of their client. Link is provided below to their overview page.

    1.Download CuteFTP professional...Click Here for their home page

    2. After you install it, on startup, it will bring you through the connection wizard. If it doesnt, click the wand with the star under the "file" tab.

    3. Host address is your servers ip...click next.



    4. Put in the username and password you made on the server.



    5. When you click next, it will try to verify the server, cancel this. As it wont be able to connect due to the ssl not being set up yet.



    Then Click No when it asks to check the username



    6. Click your home directory, local folder, that you want the client to always open to. DO NOT edit the default remote folder, leave it blank, as your server is set up to direct you perfectly to the folder.



    7. Click Finish.

    8. See the site manager to the left, you should see your server in there, right click on it.

    Click this bar to view the full image.



    9. Click Properties.




    10. Go to the "Type" Tab and you are going to be changing the protocol and port. Change the port to 990.




    11. Change the protocol to "FTP with SSL (Auth. SSL --Explicit)" and click connect.




    12. The client will now connect to the server.

    13. Click on the Tools menu and select global options.




    14. Select connections, and adjust the max transfers to 6. You can go higher, however 6 runs smoothly on most setups. If you are experiencing slow speeds, adjust this up or down and see how it effects transfer rates.



    15. Select transfer now and adjust the number of parts to be download at once. The more parts, the faster the download, however as above, it will be specific to your download. I use 6.




    16. You should be all set now to proceed to the download. Read below for the fastest download method.


    Download

    1. After you connect to your server, you will see your home directory and be all ready to just download what you want right? Yes, BUT without selecting a specific way to download, you will only be downloading 1 connection at a time. Lets take advantage of multi-part downloads.

    2. On the folder you wish to download, right click and select Advanced download-->Multipart Download--->Max





    3. Thats the trick. Now you will open up multiple connections to the server and decrease the transfer time by 6 times. (if you left the max connections at 6 as above).

    Wednesday, 1 October 2008

    How to jumpstart Solaris 10 (Part 2)

    Adding Client
    Step to adding a Client
    1. Create Client profile
    2. Create pre- and post-install script
    3. Update /export/Config/rules
    4. Run check script
    5. Add ethers and hosts information
    6. Run add_install_client script
    7. Reboot client machine

    Step 1: The Client Profile
    Edit file profile1 in /export/Config
    # cd /export/Config
    # vi profile1
    # install_type MUST be first
    install_type initial_install

    # start with the minimal required number of packages
    cluster SUNWCXall
    package SUNWaccr add

    # format the entire disk for Solaris WARNING: This line for X86 only
    fdisk all solaris all

    #define how the disk is partitioned
    partitioning explicit
    filesys rootdisk.s0 free /
    filesys rootdisk.s1 4096 swap

    # install systems as server
    system_type server

    Step 2: Pre- and Post-install script (optional)
    Careful! New system's disks are mounted on /a during jumpstart
    begin1 script example:
    # vi begin1
    #!/bin/sh
    echo "Begin Script for JumpStart RFATEST178..."
    finish1 script example:
    # vi finish1
    #!/bin/sh
    echo "Finish Script for JumpStart RFATEST178..."
    echo "Get rid if the nfs prompt during the initial boot"
    touch /a/etc/.NFS4inst_state.domain

    Step 3: The rules file
    Format of entries are:
    [match rule] [pre-install] [profile] [post-install]

    Sample file:
    # vi rules
    hostname RFATEST178 begin1 profile1 finish1

    note : profile1 from step 1 ,begin1 and finish1 from step 2
    use : hostname RFATEST178 - profile1 -,If you skip step 2

    Step 4:Run check script
    Run this script each time that rules file is updated.It will check the syntax of profile and verifies that script exist.After that It will create rules.ok file for jumpstart process.
    # ./check

    --Now you should have files in /export/Config follow this:
    # ls -l
    -rwxr-xr-x 1 root root 59701 Jan 8 10:16 check
    -rw-r--r-- 1 root root 232 Jan 8 10:14 profile1
    -rw-r--r-- 1 root root 32 Jan 8 10:15 rules
    -rw-r--r-- 1 root root 57 Jan 8 10:16 rules.ok
    -rw-r--r-- 1 root root 278 Jan 8 09:33 sysidcfg
    Note : begin1 and finish1 is option

    Step 5: Update hosts info
    Update file /etc/ethers that should contain the MAC address of the client.Make sure the jumpstart server can resolve the name of the client.
    # cd /etc
    # vi ethers
    0a:3b:ba:f5:d1:e6 [client hostname]

    # vi hosts
    [ip.address.for.client] [client hostname]

    Step 6: add_install_client
    you run the following commands from your installation image, not from the CD.
    # cd /export/Install/Solaris_10/Tools
    # ./add_install_client \
    -e 0a:3b:ba:f5:d1:e6 \
    -s :/export/Install \
    -c :/export/Config \
    -p :/export/Config [client hostname] sun4u

    PS. -e specifies the MAC address of the client.
    -s specifies the location of the server's installation files.
    -c specifies the Solaris JumpStart configuration location.
    -p specifies the sysidcfg file's location.
    sun4u specifies the architecture of the client.

    Step 7:Reboot Client
    Boot up the client and have it find the server.
    On the client, be at the OpenBoot OK prompt and run the following command:
    ok> boot net - install
    or
    # reboot -- 'net - install'
    the client connected to server, downloaded the OS, and commenced installing it.

    NOTE : Ensure that nsswitch.conf which hosts ,ether and bootparams has 'files' is the first parameter.

    reference : http://www.sun.com/bigadmin/content/submitted/jumpstart_zfs.jsp

    Friday, 4 July 2008

    How to jumpstart Solaris 10 (Part 1)

    Server Configuration
    1. Create install and configuration directory.
    2. Copy OS media to install directory.
    3. Copy scripts to configuration directory.
    4. Create "sysidcfg" file in install directory.
    5. Create /tftpboot.
    6. Start system daemon.
    step 1-2 : to config install server
    step 3-4 : to config configure server
    step 5-6 : to config boot server

    Step 1 : Create Create install and configuration directory
    # mkdir -m 755 /export/Config /export/Install
    # chown root:root /export/Config /export/Install
    # cat >> /etc/dfs/dfstab
    share -F nfs -o ro,anon=0 /export/Config
    share -F nfs -o ro,anon=0 /export/Install
    ^D
    # shareall

    Step 2 : Copy OS media to install directory
    Put the first CD of Solaris 10 in the CD-ROM drive
    Install OS:(1st Disk)
    # cd /cdrom/cdrom0/s0/Solaris_10/Tools
    # ./setup_install_server /export/Install
    Install OS:(another Disk)
    # cd /cdrom/cdrom0/Solaris_10/Tools
    # ./add_to_install_server /export/install
    Note : Interested directory
    /export/Install/Solaris_10
    - Misc/jumpstart_sample contain sample configs and scripts
    - Tools contain script for adding clients
    - Tool/Boot is boot image for client
    - Product contain Solaris package which will be installed
    - Patches contain patches to install during jumstart
    - MU contain maintenance update patch(may be)

    Step 3 : Copy Script to Config directory
    # cd /export/Install/Solaris_10
    # cd Misc/jumpstart_sample
    # mkdir -p -m 755 /export/Config/bin
    # cp check /export/Config/bin
    # chmod 755 /export/Config/bin/check
    # chown -R root:root /export/Config/bin

    Step 4 : The sysidcfg File
    # cd /export/Config
    # vi sysidcfg
    system_locale=en_US
    timezone=US/Central
    timeserver=localhost
    terminal=vt100
    name_service=NONE
    security_policy=NONE
    root_password=
    network_interface=PRIMARY {hostname=
    netmask=
    protocol_ipv6=no
    default_route=}

    :wq


    Step 5 : Create /tftpboot
    # mkdir -m 711 /tftpboot
    # chown root:root /tftpboot
    Uncomment the below line in /etc/inet/inetd.conf
    tftp ..... /usr/sbin/in/tftpd in.tftpd -s /tftpboot
    On Solaris 10 execute command :
    # inetconv

    Step 6 : Start System Daemon
    - NFS daemon
    FMRI : svc:/network/nfs/server
    Script : /usr/lib/nfs/nfsd
    - in.rarpd
    FMRI : svc:/network/rarp
    Script : /usr/sbin/in/rarpd
    - rpc.bootparamd
    FMRI : svc:/network/rpc/bootparams
    Script : /usr/sbin/rpc.bootparamd
    - inetd
    FMRI : svc:/network/inetd
    Script : /usr/lib/inet/inetd

    Continue in part 2...