• HEADS UP 02-22-2011 Comments Off

    ‘xauth list’ will give the current tokens for the first login user
    SOANDSO/unix:10 MIT-MAGIC-COOKIE-1 498e25150e75b1c319278813d853b1ca

    you can add some or alll of them to a second login user:

    xauth add SOANDSO/unix:10 MIT-MAGIC-COOKIE-1 498e25150e75b1c319278813d853b1ca

  • 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;
    }

  • HEADS UP, Solaris 02-16-2011 Comments Off
    for i in `ndd -get /dev/${DEV} \? | awk '{print $1}'| grep ^[a-z]`;
    do
    echo -n "$i:"; ndd -get /dev/${DEV} $i;
    done
    
  • 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, SQL & PL/SQL, SQLPLUS 02-11-2011 Comments Off
    ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
    
  • VMWare 02-07-2011 Comments Off

    vmware-cmd -l
    shows the vhosts on the server

    vmware-cmd start
    will start a vhost.

  • 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, Solaris 02-02-2011 Comments Off

    passwd -f <login>

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

    chage -d0 <login>

  • Enterprise Manager 02-01-2011 Comments Off

    JInitiator workaround for F5 certificates.

    1. Download the JInit from the server:
    2. Work out with app folks which version of Jinit the modified one will become (use a different one in QA and Prod).
    3. Download the decided upon version from the web. In this case we will download “25” and install it.
    4. Within the ‘C:\Program Files\Oracle\JInitiator 1.3.1.25\lib\security’ folder of the ‘new’ Jinit, open certdb.txt and append the new cert at the end.
    5. Create a self-extracting zip file for the certdb.txt file and remember the path to this .exe file (use WinZip).
    6. open iexpress
      Next
      Next
      Package Title: jinit <Next>
      Next
      Next
      Click Add and add the downloaded JInit package and the self-extracting exe file created in step #5.
      Next
      Install is the jinit .exe and the post-install command is the exe for the zipfile.
      Next
      Next
      Next
      Next
      Save the package (it will need to be uploaded to the server).
      Next until the creating .exe starts, then Finish.
    7. Login to the server:  then switch to ‘oracle’
    8. Go to oracle home (‘oh’)
    9. replace the jinit.exe located at $ORACLE_HOME/jinit/jinit.exe with the one we created.
    10. Modify the following files in $ORACLE_HOME/jinit/us/ :
      jinit_download.htm: We are changing the original jinit version number to the one we are uploading.
      jinit-version.ini : The version numbers are different in this file, but they need to match the new jinit version.
    11. In file $ORACLE_HOME/forms/server, change the file formsweb.cfg to point to the newly created version numbers.