<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tech.It.2.Me-&#62;{By.Anton.Perez} &#187; Scripting</title>
	<atom:link href="http://antonperez.com/category/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://antonperez.com</link>
	<description>Technical satisfaction guaranteed...</description>
	<lastBuildDate>Thu, 09 Sep 2010 22:06:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Read a file with bash</title>
		<link>http://antonperez.com/2007/08/16/read-a-file-with-bash/</link>
		<comments>http://antonperez.com/2007/08/16/read-a-file-with-bash/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 01:10:01 +0000</pubDate>
		<dc:creator>anton</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://antonperez.com/?p=198</guid>
		<description><![CDATA[I had to test our download servers at work right away, i.e., HTTP vs HTTPS, which required downloading a large number of files.&#160; A file list was given to me to work with, like so:
/download/integrations/file1.exe/download/us/update/patch/file1.exe/download/us/cab/file1.exe
So I&#160;decided to use the bash shell to read each line and run wget quick and dirty.&#160; Here&#8217;s the script:
cat c:\\test.txt [...]]]></description>
			<content:encoded><![CDATA[<p>I had to test our download servers at work right away, i.e., HTTP vs HTTPS, which required downloading a large number of files.&nbsp; A file list was given to me to work with, like so:</p>
<p><font face="Courier New" color="#0000ff" size="2">/download/integrations/file1.exe<br />/download/us/update/patch/file1.exe<br />/download/us/cab/file1.exe</font></p>
<p>So I&nbsp;decided to use the bash shell to read each line and run <strong>wget </strong>quick and dirty.&nbsp; Here&#8217;s the script:</p>
<p><font face="Courier New" color="#0000ff" size="2">cat c:\\test.txt | while read line; do wget &#8220;</font><a href="http://files.stamps.com/"><font face="Courier New" color="#0000ff" size="2">URL/</font></a><font face="Courier New" color="#0000ff" size="2">${line}&#8221;; done</font>
<p>While&nbsp;running it I just used the Windows clock to get an approximate time difference.
<p>That&#8217;s it!&nbsp; Hope this helps.&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://antonperez.com/2007/08/16/read-a-file-with-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VI global search and replace</title>
		<link>http://antonperez.com/2007/06/29/vi-global-search-and-replace/</link>
		<comments>http://antonperez.com/2007/06/29/vi-global-search-and-replace/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 21:52:19 +0000</pubDate>
		<dc:creator>anton</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://antonperez.com/?p=174</guid>
		<description><![CDATA[In case you need to search and replace text globally within vi, here&#8217;s the command to do so:
:1,$s/old/new
vi is a free software screen-oriented text editor computer program written by Bill Joy in 1976 for an early BSD release.

Peace!&#160; \m/
]]></description>
			<content:encoded><![CDATA[<p>In case you need to search and replace text globally within <a title="vi" href="http://en.wikipedia.org/wiki/Vi" target="_blank">vi</a>, here&#8217;s the command to do so:</p>
<p><font face="Courier New" color="#0000ff" size="2">:1,$s/old/new</font></p>
<blockquote><p><b>vi</b> is a <a href="http://en.wikipedia.org/wiki/Free_software">free software</a> screen-oriented <a href="http://en.wikipedia.org/wiki/Text_editor">text editor</a> <a href="http://en.wikipedia.org/wiki/Computer_program">computer program</a> written by <a href="http://en.wikipedia.org/wiki/Bill_Joy">Bill Joy</a> in <a href="http://en.wikipedia.org/wiki/1976">1976</a> for an early <a href="http://en.wikipedia.org/wiki/Berkeley_Software_Distribution">BSD</a> release.</p>
</blockquote>
<p>Peace!&nbsp; \m/</p>
]]></content:encoded>
			<wfw:commentRss>http://antonperez.com/2007/06/29/vi-global-search-and-replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Windows PowerShell course book</title>
		<link>http://antonperez.com/2007/05/15/free-windows-powershell-course-book/</link>
		<comments>http://antonperez.com/2007/05/15/free-windows-powershell-course-book/#comments</comments>
		<pubDate>Tue, 15 May 2007 19:03:35 +0000</pubDate>
		<dc:creator>anton</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://antonperez.com/?p=144</guid>
		<description><![CDATA[The Schweizer IT Professional and TechNet Blog is sharing a free Windows PowerShell course book that they&#8217;ve translated to English.&#160; The book seems to be pretty good.
From their blog entry:
&#160;Due to its great popularity, we have decided to translate the Windows PowerShell course book to English. So if your mother tongue is not German, maybe [...]]]></description>
			<content:encoded><![CDATA[<p>The <a title="Schweizer IT Professional and TechNet Blog" href="https://blogs.technet.com/chitpro-de/default.aspx" target="_blank">Schweizer IT Professional and TechNet Blog</a> is sharing a free Windows PowerShell course book that they&#8217;ve translated to English.&nbsp; The book seems to be pretty good.</p>
<p>From their blog entry:</p>
<blockquote><p>&nbsp;Due to its great popularity, we have decided to translate the Windows PowerShell course book to English. So if your mother tongue is not German, maybe you are interested in the English version instead. The book gives you a short introduction with many exercises about the interactive part of Windows PowerShell as well as some hints how to use other objects like WMI, .NET or COM objects like Excel or Internet Explorer.</p>
<p>The <a href="https://profile.microsoft.com/RegSysProfileCenter/wizard.aspx?wizid=adf74b41-ae6a-42f4-8445-db39ecabb8b3&amp;lcid=1033&amp;fu=http://download.microsoft.com/download/a/9/4/a94270c7-ed16-4c72-8280-658c66315719/Windows%20Powershell%20-%20EN.zip">book is available for free</a> and you can share it with all your colleagues or friends if you leave it as it is. The books can be used with or without the <a href="http://download.microsoft.com/download/a/9/4/a94270c7-ed16-4c72-8280-658c66315719/PowerShell-Demofiles.zip">demo files</a> available at this blog as well.</p>
</blockquote>
<p>Enjoy!&nbsp; =0)</p>
]]></content:encoded>
			<wfw:commentRss>http://antonperez.com/2007/05/15/free-windows-powershell-course-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing specific event logs on a remote server</title>
		<link>http://antonperez.com/2007/05/11/accessing-specific-event-logs-on-a-remote-server/</link>
		<comments>http://antonperez.com/2007/05/11/accessing-specific-event-logs-on-a-remote-server/#comments</comments>
		<pubDate>Fri, 11 May 2007 16:05:48 +0000</pubDate>
		<dc:creator>anton</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://antonperez.com/?p=142</guid>
		<description><![CDATA[An old friend and classmate of mine, Zahid Faisal, wanted to know how to access/read event logs on a remote server using Windows PowerShell. I thought it was an interesting challenge, so after some research and playing around I found that you can make use of the WMI objects to do this.
Follow along to try [...]]]></description>
			<content:encoded><![CDATA[<p>An old friend and classmate of mine, <strong>Zahid Faisal</strong>, wanted to know how to access/read event logs on a remote server using <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target="_blank">Windows PowerShell</a>. I thought it was an interesting challenge, so after some research and playing around I found that you can make use of the <a href="http://www.microsoft.com/whdc/system/pnppwr/wmi/default.mspx" target="_blank">WMI</a> objects to do this.
<p>Follow along to try it out:
<p>1. Open PowerShell and type in the following:
<p><font face="Courier New" color="#0000ff" size="2">PS C:\&gt; $logs = [System.Diagnostics.EventLog]::GetEventLogs(&#8217;servername&#8217;) </font>
<p>This will create a new <strong>EventLog</strong> object that uses the <strong>GetEventLogs</strong> method, which by the way, accepts a machine name as an argument. This is exactly what we&#8217;re looking for.
<p>2. If the command did not return any errors, continue with the following:
<p><font face="Courier New" color="#0000ff" size="2">PS C:\&gt; $logs[0]</font>
<p>You should get something like this:
<p><font face="Courier New" color="#0000ff" size="2"><u>Max(K)</u> <u>Retain</u> <u>OverflowAction</u>&nbsp;&nbsp;&nbsp;&nbsp; <u>Entries</u> <u>Name</u> </font>
<p><font face="Courier New" color="#0000ff" size="2">10,240&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 OverwriteAsNeeded&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;838 Application</font>
<p>The <strong>[0]</strong> after <strong>$logs</strong> is simply an array of the different types of event logs, which in this case, <strong>[0]</strong> equals the <strong>Application</strong> logs.
<p>3. Next, the bread-and-butter &#8211; filtering:
<p><font face="Courier New" color="#0000ff" size="2">PS C:\&gt; $logs[0].entries | where ` </font>
<p><font face="Courier New" color="#0000ff" size="2">&gt;&gt; {($_.Source -eq &#8220;Orion&#8221;) -AND ($_.TimeWritten -ge $recent)} </font>
<p><font face="Courier New" color="#0000ff" size="2">&gt;&gt;</font>
<p>By using the <strong>where</strong> object, we&#8217;re able to filter what we&#8217;re specifically looking for. In Zahid&#8217;s case, he wanted to grab the <strong>most recent logs</strong> that are only related to &#8220;<strong>Orion</strong>.&#8221;
<p>Take note that this will only work if you&#8217;re an administrator on the remote server.
<p>Hope this helps. =0) </p>
]]></content:encoded>
			<wfw:commentRss>http://antonperez.com/2007/05/11/accessing-specific-event-logs-on-a-remote-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Try Ruby online</title>
		<link>http://antonperez.com/2007/04/24/try-ruby-online/</link>
		<comments>http://antonperez.com/2007/04/24/try-ruby-online/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 17:24:27 +0000</pubDate>
		<dc:creator>anton</dc:creator>
				<category><![CDATA[Resource]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://antonperez.com/?p=123</guid>
		<description><![CDATA[Ruby has been getting a lot of praise for a while now, so I decided to give it a try.  I was surprised to find so many resources already out there, and one I think worth mentioning is this website.
Ruby is a programming language from Japan (available at ruby-lang.org) which is revolutionizing the web. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ruby-lang.org/en/" title="Ruby - A Programmer's Best Friend" target="_blank">Ruby</a> has been getting a lot of praise for a while now, so I decided to give it a try.  I was surprised to find so many resources already out there, and one I think worth mentioning is this <a href="http://tryruby.hobix.com/" title="Try Ruby!" target="_blank">website</a>.</p>
<blockquote><p>Ruby is a programming language from Japan (available at <a href="http://ruby-lang.org">ruby-lang.org</a>) which is revolutionizing the web.  The beauty of Ruby is found in its balance between simplicity and power.</p></blockquote>
<p>What&#8217;s cool about the <strong>Try Ruby! </strong>website is that it&#8217;s an interactive <strong>web-based </strong>Ruby shell.  And on top of that, it also offers a quick 15-minute tutorial as you go along.</p>
<p>Here&#8217;s a screenshot:</p>
<p><a href="http://antonperez.com/wp-content/uploads/2007/04/windowslivewritertryrubyonline-acc5image01.png" atomicselection="true"><img src="http://antonperez.com/wp-content/uploads/2007/04/windowslivewritertryrubyonline-acc5image0.png" style="border: 0px none " border="0" height="240" width="238" /></a></p>
<p>Pretty cool, ey?  Lastly, here&#8217;s an excellent <a href="http://www.ruby-doc.org/gettingstarted/" title="RUBY-DOC.ORG" target="_blank">help-and-documentation website</a>, specifically for Ruby if you want to delve and read more on it.</p>
<p>Catch you later.  =0)</p>
]]></content:encoded>
			<wfw:commentRss>http://antonperez.com/2007/04/24/try-ruby-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
