-
Posts just written
Me reacting to web stuff
Pages
Archives
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2003
Tag Archives: unix
List outdated port names with awk
MacPorts. Sometimes your ports are outdated. There’s a pseudo-portname for them. The report has many columns. And I only want the names, not their versions.
port list outdated | awk 'BEGIN { RS="\n" } { print $1 }' > names_of_old_ports.txt
Done.
Update: got a bug, fixed it. Sheesh.
[tags]awk,unix[/tags]
Snippet: remove .svn directories
Snippet to recursively drop Subversion control of a directory. It removes the .svn directories, and their contents.
find . -name ".svn" -exec rm -rf {} \;
Credit: Zed Shaw, at the Mongrel mailing list.
(Note to contemporary readers: Crazy old info) Oh, and if you are using Mongrel, and need help with it, there is a [...]
bash functions example
Bradley Taylor (of [Railsmachine](http://railsmachine.com/) hosting fame) said this on [the excellent Mongrel mailing list](http://rubyforge.org/mailman/listinfo/mongrel-users):
“Just use these bash functions and put them in your .bashrc:”
cluster\_restart () {
mongrel\_rails cluster::restart -C /etc/ mongrel\_cluster/$1.yml;
}
cluster\_start () {
mongrel\_rails cluster::start -C /etc/ mongrel\_cluster/$1.yml;
}
cluster\_stop () {
mongrel\_rails cluster::stop -C /etc/mongrel\_cluster/$1.yml;
}
usage:
[...]
Awk, text processing
Fooling around with load average output on a shared host (where it can be life-or-death):
$ w -s|awk '/load average:/ { print "Load averages:\nPast 1 min: " $10 "\nPast 5 min: " $11 "\nPast 15 min: " $12 }'
Load averages:
Past 1 min: 20.94,
Past 5 min: 20.67,
Past 15 min: 18.75
What’s w, you say? [...]
unix search-and-replace: rpl (and sed)