Showing posts with label Solaris. Show all posts
Showing posts with label Solaris. Show all posts

Sunday, July 19, 2009

Sending email with attachments on UNIX systems

Sending email with attachments on UNIX systems
All of the below examples use the following shell variables. I use MIME type application/octet-stream just as an example. Actual type used will vary depending upon attachment file type. Remember, these are simple examples of the different tools available.

TXTFILE=/tmp/textfile  # A text message with a simple preface message
ATTFILE=/tmp/binary_file # File to be attached and generally requiring encoding
SUBJECT="Your attachment" # Change as needed
MAILTO=user@where.ever  # Ditto
  • uuencode – This is the original method to send encoded text within a message. It is not an attachment as we think of them today but is still used enough to warrant putting it here.
    uuencode $ATTFILE $ATTFILE | mail -s "$SUBJECT" $MAILTO
    (uuencode $FILE1 $FILE1; uuencode $FILE2 $FILE2) | mail -s "$SUBJECT" $MAILTO
     
  • simple shell commands – For a very simple text (plain or html) attachment with just one file:
    echo "From: $LOGNAME\nTo: $MAILTO\nSubject: $SUBJECT\n\
    Mime-Version: 1.0\nContent-Type: text/plain\n" > /tmp/file
    cat $TXTFILE >> /tmp/file
     
  •  

    Saturday, July 18, 2009

    Find Solaris 10 HBA info

    Find HBA’s WWN on Solaris 10

    #!/bin/sh

    for i in `cfgadm
    grep fc-fabric
    awk ‘{print $1}’`; do

    dev=”`cfgadm -lv $i
    grep devices
    awk ‘{print $NF}’`”

    wwn=”`luxadm -e dump_map $dev
    grep ‘Host Bus’
    awk ‘{print $4}’`”

    echo “$i: $wwn”

    done

    Or command line: on all versions:

    #prtpicl -v -c scsi-fcp
    grep wwn (On all versions)

    :node-wwn 20 00 00 e0 8b 94 92 8d

    :port-wwn 21 00 00 e0 8b 94 92 8d

    # prtconf -vp
    grep -i ww

    port-wwn: 210000e0.8b80fb81

    node-wwn: 200000e0.8b80fb81

    On Sol 10

    # fcinfo hba-port

    Monday, June 1, 2009

    Virtualization for Dummies

    In my job I have to read a lot of Vendor biased documentation, and occaisionally I run across a document that is actually useful for more than just understanding a certain vendors offering and can be applied across the board.

    This article on virtualization, actually describes it pretty well and discusses why it is important. Keep in mind it does have a slant toward AMD processors and SUN, but nevertheless a good read of how different types of virtualization works specifically around x86 hardware. This document is mainly geared toward the SMB market and does not address the high end hardware virtualization methods of IBM, HP or even SUN. It is written by the authors of the "For Dummies" series of books so it is fairly easy to read, even if some of the content will make your head swim.

    Tuesday, May 26, 2009

    VMWare ESX fails to mount ISO image

    I was installing the newest OpenSolaris on VMware ESX 3.5 tonight and I wanted to mounted to verify my disk image prior to the install so I thought simple; mount the ISO and browse the file system and that will show everything is ok. I created the mount point and ran the Linux mount commands and got an IOCTL error.

    [root@x4100 x4100:storage1]# mkdir /tmp/isoimage
    [root@x4100 x4100:storage1]# mount -o loop /vmfs/volumes/x4100\:storage1/OpenSolaris.iso /tmp/isoimage/


    ioctl: LOOP_SET_FD: Invalid argument
     
    After a lot of research I found this article. That explains that if you try to mount an ISO image from a VMFS file system you get the aforementioned error. The problem I had is the ISO I was trying to mount is on a VMFS filesystem and the mount command only works for images residing on a Linux filesystem, and vmfs doesn't count as a Linux filesystem. 

    I moved the ISO to the /tmp filesystem and everthing worked as expected.

    [root@x4100 x4100:storage1]# mv OpenSolaris.iso /tmp
    [root@x4100 x4100:storage1]# mount -t iso9660 -o loop /tmp/OpenSolaris.iso /tmp/isoimage
    root@x4100 x4100:storage1]# cd /tmp/isoimage/

    [root@x4100 isoimage]# ls
    bin dev jack pkg.zlib proc root solarismisc.zlib system
    boot devices mnt platform reconfigure save solaris.zlib tmp
    [root@x4100 isoimage]# cd ..
    [root@x4100 tmp]# umount /tmp/isoimage/

    Thursday, May 21, 2009

    Oracle seems to be planning another Database Appliance

    From Larry Ellison's comments it appears that Oracle wants to create a database appliance and own all the pieces. It definitely makes sense, Oracle has been delivering "Oracle Linux" for a while now, but Linux is still not in the same league as the Solaris operating system.  The majority of Oracle's enterprise customers continue to run on SUN hardware and the Solaris operating system even after IBM surpassed SUN in hardware capabilites and Oracle started pushing Linux. Here are some exerpts from the article this links to

        "We are definitely not going to exit the hardware business," Ellison told Reuters in an e-mail interview published late today. "If a company designs both hardware and software, it can build much better systems than if they only design the software. That's why Apple's iPhone is so much better than Microsoft phones."
        ...
        Ellison said he believes that by jointly developing Oracle's software with Sun's hardware and SPARC chips, the company can build machines designed for specific purposes that are better than ones pulled together from separate components.
        ...
        "Once we own Sun, we'll be able to plan and synchronize new features from silicon to software, just like IBM and the other big system suppliers," he said.