Archive for the ‘programing’ Category.

Strip Comments from config files on *nix ; linux

Quite easy really, you can use a number of approaches. As always regex is your friend:

Sed

sed -e 's/#.*//;/^\s*$/d' [file_name]

Grep

egrep -v '(^[ ]*#|^#|^$)' [file_name]

Perl

/usr/bin/perl while(<>) { print unless /^(#.+|\s+)$/ );

Visual C# Express

Make your own RSS Screensaver

Dan Fernandez blogged about a new screen saver starter that uses RSS feeds for its display content:

http://blogs.msdn.com/danielfe/archive/2004/06/29/168449.aspx

Loosk like this is Microsoft’s first shipped product that includes RSS support. It’s the RSS “Screen Saver Starter Kit” in the newly-released Visual C# Express (click to download). The Express programming tools are newly-minted Visual Studio 2005 Express versions.