[nycbug-talk] fun one liners

Marc Spitzer mspitzer at gmail.com
Thu Jun 8 17:35:44 EDT 2006


On 6/8/06, Peter Wright <pete at nomadlogic.org> wrote:
>
> > On 6/8/06, Anthony Elizondo <anthony.elizondo at gmail.com> wrote:
> >> On 6/8/06, Pete Wright <pete at nomadlogic.org> wrote:
> >> > although one guy posted this:
> >> > % fstat | grep 'httpd.*/var ' | awk '{print $6}' | xargs -n 1 sudo
> >> find \
> >> > -x /var -inum | sort -u
> >>
> >> That is indeed awesome. Although, you could optimize it by moving the
> >> sort after the awk, since it looks like httpd has lots of different
> >> pids accessing the same inode. I'm squirreling it away.
> >>
> >> Given a ip1.txt, a text file that has a list of ip addresses in it,
> >> the following will put them in order:
> >>
> >> awk -F. '{print $1*65536+$2*256+$3 " " $0}' ip1.txt | sort -n | cut -f
> >> 2- -d ' ' > sorted.txt
> >
> > why not 'sort  -n -k1,4 -t. ip1.txt' ?  your answer will only order to
> > a class C network, do you get signed int problems otherwise?
> >
> > real big hammer is to put it into postgres as an ip and do a sql select on
> > it.
> >
>
>
> lol...only if you write a python web gui front-end to print those results
> into a pdf which can easilly be sent to lpr ;)
>
> -pete

Its python I am sure there is a library to do just that.  Is that a
good thing I don't know

marc
-- 
"We trained very hard, but it seemed that every time we were beginning to
form into teams we would be reorganized. I was to learn later in life that
we tend to meet any new situation by reorganizing, and a wonderful method it
can be for creating the illusion of progress, while producing confusion,
inefficiency and demoralization."
-Gaius Petronius, 1st Century AD



More information about the talk mailing list