• Run Discover if it’s not starting

    courtesy of Plasma-discover not launching – Help – KDE Discuss

    > pkill plasma-discover
    > pkill discover
    > plasma-discover –backends packagelit-backend

  • Courtesy of http://www.secretgeek.net/ps_duplicates

    PS c:\Users\JuanKerr> get-content h:\UpYerArris.txt | select-object -unique

    The -Unique argument is a case sensitive

  • getProperty () {

       [[ -z $2 ]] && fatal “getProperty called with not enough parameters”
       key=$1

       file=$2

       [[ ! -r $file ]] && \
          fatal “getProperty($LINENO): cant find property file ($file)”

       # find the property using the key
       property=$(grep “^${key}=” $file)
       if [[ $? -ne 0 ]]
       then
          fatal “cant find key ($key) in $file”
       fi

       # remove comments from the line, if they exist
       property=”${property%%#*}”

       # return everything after the ‘=’ sign
       value=${property#*=}

       if [[ -z $value ]]
       then
          echo “null”
          return 1
       else
          echo $value
          return 0
       fi
    }

  • get_pid()
            # $1=command
            {
            /usr/ucb/ps auxwww | fgrep “$1” | fgrep -v grep | awk ‘ { print $2 } ‘
            }
    start_bg()
            # $1=start_command
            # $2=match_command
            {
            pid=`get_pid “$2″`
            if [[ “$pid” = “” ]] ; then
                    $1 < /dev/null > /dev/null 2> /dev/null &
                    pid=`get_pid “$1″`
                    wait=
                    while [[ “$pid” = “” && “$wait” != “xxxxx” ]] ; do
                            sleep 1
                            wait=”x$wait”
                            pid=`get_pid “$2″`
                    done
            fi
            if [[ “$pid” = “” ]] ; then
                    return 1
            else
                    return 0
            fi
            }

    stop_bg()
            # $1=match_command
            {
            pid=`get_pid “$1″`
            if [[ “$pid” != “” ]] ; then
                    kill $pid
                    pid=`get_pid “$1″`
                    wait=
                    while [[ “$pid” != “” && “$wait” != “xxxxxxxxxx” ]] ; do
                            sleep 1
                            wait=”x$wait”
                            pid=`get_pid “$1″`
                    done
            fi
            if [[ “$pid” = “” ]] ; then
                    return 0
            else
                    return 1
            fi
            }

  • #!/bin/ksh

    expand_property() {
    # $1=file.properties

    awk -v PROPFILE=$1 ‘
    BEGIN {
    while ( (getline 0 )
    if ( $0 != “” && substr($0,1,1) != “#” )
    if ( (i = index($0, “=”)) != 0 )
    map[substr($0,1,i-1)] = substr($0,i+1) ;
    }
    {
    i = $0 ;
    while ( match(i, /\${[0-9A-Za-z_.]+}/) != 0 )
    {
    k = substr(i, RSTART+2, RLENGTH-3) ;
    v = map[k] ;
    i = substr(i, 1, RSTART-1) v substr(i, RSTART+RLENGTH) ;
    }
    print i ;
    }
    ‘
    }

    get_prop() {
    # $1=file.properties
    # $2=property

    print “\${$2}” | expand_property $1
    }

  • I’ve cheated and used perl to format the date.

    #!/bin/ksh

    view=myview
    branch=mybranch

    # Create a date 10 minutes earler than the current time
    dte=$(perl -e ‘use POSIX qw/strftime/; my $date = strftime “%d-%b-%y.%H:%M:%S”, localtime(time-1200); print “$date\n”;’)
    echo “Checking for change since $dte”
    result=$(cleartool lshistory -recurse -since $dte -fmt ‘\”%Nd\” \”%u\” \”%En\” \”%Vn\” \”%e\” \”%o\” \n%c\n’ -branch brtype:$branch -nco /view/$view/vobs/mypath)

    echo “$result”

    if [[ -n $result ]] ; then
      echo Changes found
      exit 0
    else
      echo No changes found
      exit 1
    fi

  • for dir in `ls -da */`; do ; du -hs $dir; done;

  • I Love Cruise Control… Really I do…. Honest Guv

    Update the Cruise control xml file to add the following to convince the unit test tab to actually acknowledge the existance of unit tests

    <log>
    <merge dir=”c:\MyBoringWindowsPath\MyProject\target\surefire-reports\” />
    </log>

Create your own website, free on WordPress.com.Create your own website.
Start free