• Linux, Networking 02-03-2012 Comments Off

    The usb0 NIC sometimes causes problems with certain Oracle grid components on 11g RAC.

    Setting the /etc/sysconfig/network-scripts/ifcfg-usb0 ‘ONBOOT=no’ does not always work and the devices fires up again.

    You can disable the NIC from even initializing by adding the following as the first line in /etc/udev/rules.d/60-net.rules
    ACTION==”add”, DRIVER==”usb”, SYSFS{configuration}==”CDC Ethernet”, OPTIONS+=”ignore_device, last_rule”

  • Linux 09-20-2011 Comments Off

    tunefs.ocfs2 -S

  • HEADS UP, Linux, Networking 06-14-2011 Comments Off

    ETHTOOL_OPTS=”autoneg off speed 100 duplex full”

  • Linux, Vertias, VxFS 05-12-2011 Comments Off
    Scan the fibre and re-read the device maps:
    /opt/QLogic_Corporation/ql-dynamic-tgt-lun-disc-2.5/ql-dynamic-tgt-lun-disc.sh
    
    vxdctl initdmp
    vxdctl enable
    
    vxdisk list #will show something similar to:
    fas60801_40  auto            -            -            error
    
    verify the 'FAS' number from sanlun output to make sure we are working with the correct device!
    
    #Initialize the new disk
    vxdisksetup -i fas60801_40
    vxdisk list #will now show the disk online:
    fas60801_40  auto:cdsdisk    -            -            online thinrclm
    
    To create a volume in an existing disk group:
    vxdg -g DGNAME adddisk DGNAME-Disk=FAS60800_27
    ex: vxdg -g proddg adddisk proddg-redoDisk=FAS60800_27
    
    # see how big we can make a concat on the new disk
    vxassist -b -g proddg maxsize layout=concat proddg-redoDisk
    output will be like this:
    Maximum volume size: nnnnnnn (XXXXMb)
    
    # make the volume
    vxassist -b -g proddg make proddg-redoVol XXXXm layout=concat proddg-redoDisk
    
    # mkfs.vxfs /dev/vx/rdsk/proddg/proddg-redoDisk
    
    # then mount it up and off you go!
    
    For a new disk group:
    #Initialize the new disk group
    vxdg init SOMETHING_dg SOMETHING-1=fas60801_40
    
    vxdisk -o alldgs list
    will now show the new disk in its new group:
    fas60801_40  auto:cdsdisk    SOMETHING-1  SOMETHING_dg online thinrclm
    
    #Create logical volume and filesystem
    
    vxassist -g SOMETHING_dg make SOMETHING-vol1  SOMETHING-1
    
    #make the filesystem
    /usr/lib/fs/vxfs/mkfs -t vxfs -o largefiles /dev/vx/rdsk/SOMETHING_dg/SOMETHING-vol1
    
    #Mount up the filesystem
    mount -t vxfs /dev/vx/rdsk/SOMETHING_dg/SOMETHING-vol1 /where/ever
    
  • Linux, NFS 05-06-2011 Comments Off

    for i in `mount|grep nfs|awk ‘{print $3}’`; do echo -n “testing $i now…”; cd $i; ls|wc -l; cd; done

  • HEADS UP, Linux 02-24-2011 Comments Off

    The script will need to run thru a wrapper, or the OS will ignore the setuid bit altoghether. Compile the following C program and make it setuid, and it will work:

    #include 
    #include 
    
    int main(int argc, char *argv[])
    {
    argv[0] = "some_script_path";
    
    setreuid(geteuid(), -1);
    execv(argv[0], argv);
    exit(1);
    }
    
  • HEADS UP, Linux, iptables 02-16-2011 Comments Off

    #!/usr/bin/perl -w
    # server.pl
    #--------------------

    use strict;
    use Socket;

    # use port 7890 as default
    my $port = shift || 7890;
    my $proto = getprotobyname('tcp');

    # create a socket, make it reusable
    socket(SOCKET, PF_INET, SOCK_STREAM, $proto)
    or die "Can't open socket $!\n";
    setsockopt(SOCKET, SOL_SOCKET, SO_REUSEADDR, 1)
    or die "Can't set socket option to SO_REUSEADDR $!\n";

    # bind to a port, then listen
    bind( SOCKET, pack( 'Sn4x8', AF_INET, $port, "\0\0\0\0" ))
    or die "Can't bind to port $port! \n";
    listen(SOCKET, 5) or die "listen: $!";
    print "SERVER started on port $port\n";

    # accepting a connection
    my $client_addr;
    while ($client_addr = accept(NET_SOCKET, SOCKET)) {
    # send them a message, close connection
    print NEW_SOCKET "Smile from the server";
    close NEW_SOCKET;
    }

  • Enterprise Manager, HEADS UP, Linux 02-14-2011 Comments Off

    mv /etc/localtime /etc/localtime-old

    ln -sf /usr/share/zoneinfo/GMT /etc/localtime

    hwclock –systohc (or –utc)

  • HEADS UP, Linux, Solaris 02-05-2011 Comments Off

    The problem is that the ssh session will wait for the command to complete and the ‘&’ to background the task does not seem to work. The net result is that the script running the nohup ssh command hangs.

    This is because by default ssh does not allocate a TTY to run a command. You can force TTY allocation by using the ‘-t’ option to ssh, which will permit backgrounding, and the ssh command will return immediately.

    In order to demonstrate, create a file /tmp/sleepy like so:

    #!/bin/bash
    while ( true ); do
    echo `date` “sleep”
    sleep 1
    done

    This command will invoke the script over ssh using nohup and &:

    ssh -t localhost ‘nohup /tmp/sleepy &’

    Tags: , ,

  • HEADS UP, Linux 02-02-2011 Comments Off

    chage -d0 <login>