Topics

Archives

Handy References

Archive for July, 2009

shell math and alphanumeric sizes…

Thursday, July 30th, 2009

Just because I really like the elegance: preload_count=$(echo “($preload_size) / ($file_size)” | sed ‘s/K/ * 1024/g’ | sed ‘s/M/ * 1048576/g’ |\ sed ‘s/G/ * 1073741824/g’ | bc)

Stopping windows update reboot prompts

Friday, July 24th, 2009

So I’m doing development and testing work… No, I can’t reboot now just because you updated overnight. And by popping up continously, it threatens me accidentally hitting OK when I’m typing and the context changes. Which could abort some interactive testing going on. http://www.codinghorror.com/blog/archives/000294.html

Cool one-line report…

Monday, July 13th, 2009

sudo grep “GET https://www.miroguide.com/ HTTP/1.1″ /var/log/squid/access.log  | grep “\”Miro/” | sed ‘s/^.*”-” “//g’ | sed ‘s/ .*$//g’ | grep Miro | sort | uniq -c The sort | uniq -c being the good part.  It parsed 625,000 entries in the log to make this useful (to the person who asked for it) report:       2 Miro/0.9.8 [...]