sudo strace -tt -s 1024 -o strace.log -ffv -p {pid}
viernes, 9 de agosto de 2013
strace for parent and threads and output to files
miércoles, 7 de agosto de 2013
martes, 9 de julio de 2013
viernes, 7 de junio de 2013
grep output only part of matching regex
$ echo 'ETag: "ae02fff4e2395982747582496ada225d"'
ETag: "ae02fff4e2395982747582496ada225d"
#I want just the ETag value:
$ echo 'ETag: "ae02fff4e2395982747582496ada225d"' |grep -oP '(?<=ETag: ")\w+(?=")'
ae02fff4e2395982747582496ada225d
Ref: http://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match
ETag: "ae02fff4e2395982747582496ada225d"
#I want just the ETag value:
$ echo 'ETag: "ae02fff4e2395982747582496ada225d"' |grep -oP '(?<=ETag: ")\w+(?=")'
ae02fff4e2395982747582496ada225d
Ref: http://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match
jueves, 9 de mayo de 2013
jueves, 17 de enero de 2013
sort -u like awk for few items and many dups
| awk '{a[$0]=1} END{for (k in a) print k}'
Performance test:
# create a file with few items and many dups
$ for i in {1..1000000}; do printf "a\nb\nc\n" >> few_items_many_dups.txt; done
# sort uniq using awk
$ time cat few_items_many_dups.txt | awk '{a[$0]=1} END{for (k in a) print k}' > few_items_many_dups.txt.awk_sortuniq
real 0m1.291s
# sort uniq using sort -u
$ time cat few_items_many_dups.txt | sort -u > few_items_many_dups.txt.sortuniq
real 0m36.726s
Performance test:
# create a file with few items and many dups
$ for i in {1..1000000}; do printf "a\nb\nc\n" >> few_items_many_dups.txt; done
# sort uniq using awk
$ time cat few_items_many_dups.txt | awk '{a[$0]=1} END{for (k in a) print k}' > few_items_many_dups.txt.awk_sortuniq
real 0m1.291s
# sort uniq using sort -u
$ time cat few_items_many_dups.txt | sort -u > few_items_many_dups.txt.sortuniq
real 0m36.726s
viernes, 25 de mayo de 2012
how-to get IP from hostname using dig
$ dig www.groupon.com +short | tail -n1
184.28.147.170
184.28.147.170
$ dig www.groupon.com +short
www.groupon.com.edgekey.net.
e5352.b.akamaiedge.net.
184.28.147.170
www.groupon.com.edgekey.net.
e5352.b.akamaiedge.net.
184.28.147.170
Suscribirse a:
Entradas (Atom)