﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>WinAdmin: waUtils/pyUtils</title>
    <description>Scripts for SysAdmins</description>
    <link>http://www.wwwcoder.com/Weblogs/tabid/283/BlogId/129/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>wwwcoder@forret.be</managingEditor>
    <webMaster>webmaster@wwwcoder.com</webMaster>
    <pubDate>Sat, 17 May 2008 08:29:01 GMT</pubDate>
    <lastBuildDate>Sat, 17 May 2008 08:29:01 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.2.0.29758</generator>
    <item>
      <title>waXSLT just released: command line XSL Transform</title>
      <description>&lt;P&gt;I just released a new script in the &lt;A href="http://winadmin.sourceforge.net/"&gt;http://winadmin.sourceforge.net&lt;/A&gt; series: &lt;A href="http://winadmin.sourceforge.net/waxslt.html"&gt;waXSLT&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I basically needed a fast way of performing a XSL Transform on an XML file:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;waXSLT.wsf /xsl:xml2htm.xsl /output=test.htm data.xml&lt;BR&gt;:: convert data.xml to HTML file through xml2htm.xsl XSLT&lt;/CODE&gt;&lt;/P&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/888/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/888/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=888</guid>
      <pubDate>Thu, 11 Nov 2004 05:20:00 GMT</pubDate>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=888</trackback:ping>
    </item>
    <item>
      <title>User-friendly IISRESET on a node in a cluster</title>
      <description>&lt;P&gt;With &lt;A href="http://winadmin.sourceforge.net/wacluster.html"&gt;waCluster&lt;/A&gt; you can create a scheduled task that on regular intervals, or under specific conditions, does a 'soft' reset of an IIS server without violently throwing people of the server: &lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;:: check first to see if the reset is necessary&lt;BR&gt;:: e.g. if CPU is continuously &gt; 90% for 10 seconds&lt;BR&gt;:: also: make sure that this is NOT the last active node in a cluster&lt;BR&gt;waCluster.wsf RESTART /wlbs:all /svc:iis /wait:600 /nobeep /noconfirm &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;This will drain the node, take it out of the cluster after 10 minutes, restart the IIS service, and put the node back in the cluster after 10 minutes.&lt;/P&gt;
&lt;P&gt;In the new version of waCluster (out soon), I will include 
&lt;UL&gt;
&lt;LI&gt;the option to call a web page just after the IISRESET, so that e.g. an ASP.NET application can start immediately (a heavy application could take something like 60 seconds to start up) 
&lt;LI&gt;make the &lt;CODE&gt;/t&lt;/CODE&gt; test option actually work (what a silly bug!).&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/887/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/887/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=887</guid>
      <pubDate>Thu, 11 Nov 2004 05:15:00 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=887</trackback:ping>
    </item>
    <item>
      <title>Great add-on for IE: MoreGoogle</title>
      <description>&lt;P&gt;I've installed &lt;A href="http://www.moregoogle.com/"&gt;MoreGoogle&lt;/A&gt; the day I first read about it, and I just love it. It uses the Alexa/Amazon thumbnail and the web statistics to add more information to every Google search you do. It's free and installs like a charm. Google doesn't seem to mind, although it was not developed by them.&lt;/P&gt;
&lt;P&gt;If you look for MoreGoogle in &lt;A href="http://www.forret.com/projects/hizmo/stereosearch.asp?left=google&amp;q=moregoogle&amp;right=teoma"&gt;StereoSearch&lt;/A&gt; (comparing results for Google and Teoma), it also works (so within frames). Teoma does not seem to have noticed MoregGoogle yet. Weird. Almost every one else has (Yahoo/MSN/HotBot/...), except for GigaBlast.&lt;/P&gt;&lt;IMG alt="MoreGoogle thumbnail by Alexa" src="http://www.wwwcoder.comhttp://pthumbnails.alexa.com/image_server.cgi?id=moregoogle&amp;size=small&amp;url=http://www.moregoogle.com/"&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/885/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/885/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=885</guid>
      <pubDate>Wed, 10 Nov 2004 23:36:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=885</trackback:ping>
    </item>
    <item>
      <title>waRmZip 1.6 released</title>
      <description>&lt;P&gt;Thanks to Robert Sommerville, I've been able to correct a bug in the moving of subfolders.&lt;/P&gt;
&lt;P&gt;The 1.6 version is now available on &lt;A href="http://winadmin.sourceforge.net/warmzip.html"&gt;http://winadmin.sourceforge.net/warmzip.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/886/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/886/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=886</guid>
      <pubDate>Wed, 10 Nov 2004 23:36:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=886</trackback:ping>
    </item>
    <item>
      <title>Bandwidth converter: from Ethernet over USB to MP3</title>
      <description>&lt;p&gt;For MP3's it's referred to as 'bitrate', for network speed it is 'transfer rate', for USB/FireWire one might call it 'throughput'. For a dedicated server, you get a 'monthly data transfer' limit. But however you look at it, it's always datasize per time unit. Kbps, MB/s, GB/mon, ... And you might want to convert between all those units.&lt;/p&gt;

&lt;p&gt;Because I regularly have to work those conversions out, I have made a conversion wizard:
&lt;a href="http://www.forret.com/projects/hizmo/bandwidth.asp"&gt;www.forret.com/projects/hizmo/bandwidth.asp&lt;/a&gt;&lt;/p&gt;

It allows conversions like: &lt;ul&gt;
&lt;li&gt;USB 2.0 can move data as fast as 216 GB/h
&lt;li&gt;MP3's encoded at 64Kbps take 28,8 MB per hour of music
&lt;li&gt;if an Ethernet connection is continously used at an average of 50% (5 Mbps), that equals 1.620 GB per month.
&lt;/ul&gt;

&lt;p&gt;I've also listed a lot of theoretical speeds for well-known standards: hard disks (ATA, SCSI), internet connection (modem, ISDN, ADSL), RAM (SDRAM, RDRAM), audio (MP3, GSM) and video (DVD). I intend to make the list more complete over time.&lt;/p&gt;

&lt;blockquote&gt;REMARK: I had started out using 1024-based conversion, but according to SI standards, one has to use 1000. So 1 MB/s = 1.000.000 B/s, not 1024 * 1024. I have included the Kibibytes conversions also.&lt;br /&gt;
&lt;a href="http://en.wikipedia.org/wiki/Kibi"&gt;en.wikipedia.org/wiki/Kibi&lt;/a&gt;&lt;/blockquote&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/884/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/884/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=884</guid>
      <pubDate>Mon, 01 Nov 2004 09:40:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=884</trackback:ping>
    </item>
    <item>
      <title>waTimer 1.2 released: easy throughput calculation</title>
      <description>&lt;P&gt;I just added the option to &lt;A href="http://winadmin.sourceforge.net/watimer.html"&gt;waTimer&lt;/A&gt; to calculate throughput based on the size of an input  file. Example:&lt;/P&gt;&lt;PRE&gt;waTimer START zip_logs
7za.exe -r -tzip a output.zip *.log
waTimer STOP  zip_logs /ofile:output.zip 
&lt;/PRE&gt;
&lt;P&gt;Which would give you as output something like this:&lt;/P&gt;&lt;PRE&gt;:: waTimer - zip_logs : 23.65 seconds elapsed
:: waTimer - zip_logs : Throughput = 152 KB/sec
&lt;/PRE&gt;
&lt;P&gt;There is also a small waTimeThis.cmd script that allows you to do stuff like:&lt;/P&gt;&lt;PRE&gt;D:\&gt;waTimeThis tracert www.google.com
____  START @ [Tue 09/14/2004 15:47:31.92] ____
Tracing route to www.google.akadns.net [216.239.39.104]
over a maximum of 30 hops:
  1     2 ms     2 ms     1 ms  10.10.13.254
 ...
 14    98 ms   101 ms   194 ms  216.239.39.104
Trace complete.
:: waTimer - watimethis : 16.94 seconds elapsed
:: waTimer - watimethis : Throughput = 213 #/hr
____ FINISH @ [Tue 09/14/2004 15:47:49.26] ____
&lt;/PRE&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/883/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/883/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=883</guid>
      <pubDate>Wed, 15 Sep 2004 00:52:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=883</trackback:ping>
    </item>
    <item>
      <title>waDate 1.0 released</title>
      <description>&lt;P&gt;Just a small utility to generate file names based upon the date. I basically needed it in a .CMD script that required the IIS log files of the day before, and there was no easy way to explain the concept of 'yesterday' to .CMD scripts. I made this in 30 minutes, not only because it is quite simple, but also because I build upon the &lt;A href="http://winadmin.sourceforge.net/watemplate.html"&gt;waTemplate script templates&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;So here is &lt;A href="http://winadmin.sourceforge.net/wadate.html"&gt;waDate 1.0&lt;/A&gt;!&lt;/P&gt;
&lt;P&gt;Examples: &lt;PRE&gt;:: IIS log file name of yesterday
waDate now /i:-1 /d:exYYMMDD.log

:: detailed string for this exact second
waDate now /t:HHNN.SS

:: using it in a CMD script
for /f "usebackq" %%d in (`waDate now /i:-1m`) do ( set ONEMONTHAGO=%%d )&lt;BR&gt;&lt;/PRE&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/882/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/882/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=882</guid>
      <pubDate>Tue, 14 Sep 2004 00:54:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=882</trackback:ping>
    </item>
    <item>
      <title>Does IceRocket stand a chance?</title>
      <description>&lt;P&gt;Imagine a meta-search engine, that uses a Google-like interface, gets its results from Yahoo, Teoma, amongst others, but not from Google. It's slower than a 'real' search engine, but adds thumbnails for most popular sites. Sound kinda plain, right? Would you put money in a company like this? &lt;A href="http://www.icerocket.com/"&gt;IceRocket.com&lt;/A&gt; is such a company and &lt;A href="http://news.com.com/New+search+tool+gets+billionaire's+backing/2100-1032_3-5297380.html"&gt;has found a wealthy sponsor&lt;/A&gt;! &lt;/P&gt;
&lt;P&gt;The service they propose is OK, but not revolutionary, basically a server-side MoreGoogle for the other search engines. So I've added it to my StereoSearch, and I now have all relevant search results in 1 window: &lt;A href="http://www.forret.com/projects/hizmo/stereosearch.asp?left=google&amp;q=xampled&amp;right=ice"&gt;StereoSearch on Xampled&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;A billionaire's toy or a serious search contender? Difficult to say this early, but they're not entirely on the right track with their marketing: 
&lt;BLOCKQUOTE&gt;Icerocket is quickly developing a very bad reputation for very unprofessional marketing methods among other things. (from &lt;A href="http://www.webmasterworld.com/forum16/1494.htm"&gt;webmasterworld.com&lt;/A&gt;)&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;(via &lt;A href="http://battellemedia.com/archives/000768.php"&gt;battellemedia.com&lt;/A&gt;)&lt;/P&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/881/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/881/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=881</guid>
      <pubDate>Thu, 12 Aug 2004 02:32:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=881</trackback:ping>
    </item>
    <item>
      <title>10 golden rules of scheduled scripts</title>
      <description>I use a lot of (self-written) scripts that run as a Scheduled Task, and have picked up some dos and don'ts on the way: 
&lt;DL&gt;
&lt;DT&gt;1. No parameters =&gt; usage 
&lt;DD&gt;&lt;CODE&gt;runtask.cmd&lt;/CODE&gt; should give a usage, not run the script! 
&lt;DD&gt;Usage should indicate what parameters are necessary: &lt;CODE&gt;runtask [server] [port]&lt;/CODE&gt;&lt;BR&gt;or in case of a bogus parameter &lt;CODE&gt;runtask Y&lt;/CODE&gt; 
&lt;DT&gt;2. Script should not give output (STDOUT/STDERR) except in case of an error 
&lt;DD&gt;you don't see the output anyway, and this allows you for triggering on existence of output 
&lt;DD&gt;(you can have a &lt;CODE&gt;/v&lt;/CODE&gt; verbose mode of the script that writes a lot to the STDOUT - this is for testing) 
&lt;DT&gt;3. Redirect command output into files 
&lt;DD&gt;&lt;CODE&gt;xcopy nonexistentfile.txt d:\folder&lt;/CODE&gt; will give:&lt;BR&gt;as STDERR &lt;CODE&gt;File not found - test.tststs&lt;/CODE&gt;, and as STDOUT &lt;CODE&gt;0 File(s) copied&lt;/CODE&gt; &lt;BR&gt;=&gt; you can do &lt;CODE&gt;xcopy [files] [destination] &gt; ignore_stdout.log&lt;/CODE&gt; so only STDERR output 'escapes' 
&lt;DD&gt;You can merge STDOUT and STDERR by using &lt;CODE&gt;command 2&gt;&amp;1 &gt; output.log&lt;/CODE&gt; 
&lt;DT&gt;4. Use daily log files to record progress 
&lt;DD&gt;&lt;CODE&gt;set PROG=RunScript&lt;BR&gt;set LOGFOLDER=D:\logs\daily&lt;BR&gt;set TODAY=%DATE:/=_%     :: Thu 07/22/2004 becomes Thu 07_22_2004 &lt;BR&gt;set TODAY=%TODAY:~-10%     :: Thu 07_22_2004 becomes 07_22_2004&lt;BR&gt;set LOGFILE=%LOGFOLDER%\%PROG%.%TODAY%.log&lt;/CODE&gt; 
&lt;DT&gt;5. Remove empty output/log files 
&lt;DD&gt;They clutter up the folders,and you're only really interested in them when they're not empty 
&lt;DD&gt;&lt;CODE&gt;for %%f in ( %TEMP1% %TEMP2% ) do ( if %~zf EQ 0 del %%f )&lt;/CODE&gt; 
&lt;DT&gt;6. Mount shared folder upon start if necessary 
&lt;DD&gt;Scheduled scripts don't have them when they start 
&lt;DD&gt;in .CMD: &lt;CODE&gt;if not exist T:\. net use T: \\server\folder&lt;/CODE&gt; 
&lt;DT&gt;7. Always use .CMD as wrapper for a Scheduled Task 
&lt;DD&gt;It's just so easy for redirecting the STDOUT/STDERR, and debugging 
&lt;DD&gt;E.g. I use a &lt;CODE&gt;daily.cmd&lt;/CODE&gt; script on each server that runs all daily tasks (e.g. a couple of &lt;A href="http://winadmin.sourceforge.net/warmzip.html"&gt;waRmZip&lt;/A&gt;'s); and a &lt;CODE&gt;weekly.cmd&lt;/CODE&gt; ... 
&lt;DT&gt;8. Use &lt;A href="http://winadmin.sourceforge.net/wacron.html"&gt;waCron&lt;/A&gt; if you want to be warned upon failure 
&lt;DD&gt;&lt;CODE&gt;wacron runscript.cmd Y&lt;/CODE&gt; will send an email if the script returns unexpected results 
&lt;DT&gt;9. The script should run when executed from a DOS box 
&lt;DD&gt;If it does, and it does not when you run it as a Scheduled Task:&lt;BR&gt;- Under what NT account does the task run? does it have enough permissions?&lt;BR&gt;- Redirect the whole script output to a file (or use waCron) and see what the error message is 
&lt;DT&gt;10. For scripts that give stats upon termination, use &lt;A href="http://winadmin.sourceforge.net/watimer.html"&gt;waTimer&lt;/A&gt; 
&lt;DD&gt;Start the script with &lt;CODE&gt;watimer START taskX&lt;/CODE&gt; 
&lt;DD&gt;End it with &lt;CODE&gt;waTimer STOP taskX /calc&lt;/CODE&gt; (see waTimer usage for more details)&lt;BR&gt;&lt;I&gt;(to have relevant stats, you need some measure of how many 'things' the script has done, either by using a &lt;CODE&gt;wc -l&lt;/CODE&gt;, or using a counter &lt;CODE&gt;SET /A DONE=%DONE% + 1&lt;/CODE&gt;.)&lt;/I&gt; 
&lt;DD&gt;Send the output of the last command to your log file, or a special stats file &lt;/DD&gt;&lt;/DL&gt;&lt;/CODE&gt;</description>
      <link>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/880/Default.aspx</link>
      <author>wwwcoder@forret.be</author>
      <comments>http://www.wwwcoder.com/Weblogs/tabid/283/EntryID/880/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.wwwcoder.com/Default.aspx?tabid=283&amp;EntryID=880</guid>
      <pubDate>Fri, 23 Jul 2004 04:38:00 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.wwwcoder.com/DesktopModules/Blog/Trackback.aspx?id=880</trackback:ping>
    </item>
  </channel>
</rss>