Thursday, June 18, 2009

wget stuff

note to self

RHN doesn't seem to play well with download managers. "wget" used to be good but noticed a small problem lately. When wget -c is given to resume a download, it starts to download things from scratch. This probably has something to do with the expiring urls that are given on RHN.

Renaming the old file part to the new one you can identify from the new download URL will work in this. Still not sure what's causing this, but remember quite well "wget" that wget didn't have this file-name problem earlier.

Thursday, June 11, 2009

simple awk usage

note to self

Once again, something i can't seem to hold in my mind, and end up searching for it over and over.

Awk can be used in this way to filter out a field from a text file when the separator is a " " ( WHITE SPACE )

awk '{ print $n}'

$n - is the field/column number

This can also be used in many other things for example, -my favourite- to take out the leading white spaces on queue_ids from grep'd and cut'd ;-) postfix logs.

Thanks dhaj for showing me this trick.