IMPORTANT!

Snipt is going open source. We've toyed with this idea for quite a while, and have finally decided it's the right way to move forward.

A few things:
  • The entire Snipt source code will be released on GitHub under the 3-clause BSD License on Friday, September 10th.
  • While we'd like to think we're perfect, we realize we're only human. By open sourcing the software that runs this website, certain bugs or security flaws may be discovered that could compromise the privacy of your snipts.
  • Only the Lion Burger team will be able to push commits to the Snipt.net site. Contributors should send a pull request to add new features or submit patches.
  • By using this site, you agree not to be too angry or take any legal action against Lion Burger should this whole thing go up in flames some day.
  • Follow us on Twitter for updates.
I agree, close this message
Sign up to create your own snipts, or login.

Latest 100 public snipts » filezilla The latest public filezilla snipts.

showing 1-1 of 1 snipts for filezilla
  • sort filezilla server log entries by session id
    #!/bin/bash
    
    #
    # entry example
    #
    # (1579051) 10/16/2009 0:02:13 AM - (not logged in) (192.168.1.11)> USER chris
    #
    # sort -k1n fzs-2009-10-16.log
    # does not work properly because when the session id and timestamp are the same
    # it goes on and tries to sort based on the message
    # if the timestamp granularity was high enough it would work (and so much faster!)
    #
    
    [ $# -ne 1 ] && echo "number of args required is 1" && exit 1
    
    [ ! -e $1 ] && echo "file $1 does not exist" && exit 2
    
    FILEPATH=`dirname $1`
    LOGNAME=`basename $1`
    
    LOGNAME_SORTED=${FILEPATH}/${LOGNAME}".sorted"
    SID_SORTED_FILENAME=${FILEPATH}/"fzlog_sid_sorted.$$"
    
    rm -f $LOGNAME_SORTED
    
    awk '{ split( $1, L, "\\(|\\)" ); print L[ 2 ]; }' $1 | sort | uniq > ${SID_SORTED_FILENAME}
    
    cat ${SID_SORTED_FILENAME} | while read line
    do
            grep "^($line)" $1 >> ${LOGNAME_SORTED}
    done
    
    rm -f ${SID_SORTED_FILENAME}
    
    exit 0
    

    copy | embed

    0 comments - tagged in  posted by cgv on Jan 05, 2010 at 4:52 a.m. EST
Sign up to create your own snipts, or login.