<?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>sigmapie.com</title>
	<atom:link href="http://sigmapie.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://sigmapie.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Nov 2009 06:42:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Upgrading ROMMON</title>
		<link>http://sigmapie.com/?p=45</link>
		<comments>http://sigmapie.com/?p=45#comments</comments>
		<pubDate>Tue, 24 Nov 2009 06:42:38 +0000</pubDate>
		<dc:creator>bhavesh</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[rommon]]></category>

		<guid isPermaLink="false">http://sigmapie.com/?p=45</guid>
		<description><![CDATA[After the last trouble without tftp-server in ROMMON, I figure I would upgrade it... it was a lot easier than updating the IOS, and I don't think you can screw it up.  By the looks of it, it has a primary and 'upgrade' (secondary) ROMMON... so if the upgrade ROMMON doesn't boot up... the [...]]]></description>
			<content:encoded><![CDATA[<p>After the last trouble without tftp-server in ROMMON, I figure I would upgrade it... it was a lot easier than updating the IOS, and I don't think you can screw it up.  By the looks of it, it has a primary and 'upgrade' (secondary) ROMMON... so if the upgrade ROMMON doesn't boot up... the original one does.</p>
<p>There is more screen output than commands here... there is only one command!</p>
<p>Before the upgrade we see that there is no upgraded rommon running.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">r2#show rom-monitor 
ReadOnly ROMMON version:
&nbsp;
System Bootstrap, Version 12.2(8r)T2, RELEASE SOFTWARE (fc1)
TAC Support: http://www.cisco.com/tac
Copyright (c) 2002 by cisco Systems, Inc.
&nbsp;
No upgrade ROMMON programmed or not yet run
Currently running ROMMON from ReadOnly region
ROMMON from ReadOnly region is selected for next boot</pre></div></div>

<p>The rommon is not like the IOS, a copy is not stored in flash to be uncompressed, so I had to download the ROMMON binary to the router's flash before I made the router as a TFTP server.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">r1(config)#tftp-server flash:C3725_RM2.srec.123-10r</pre></div></div>

<p>Then I upgraded R2 You can specify a new ROMMON directly from TFTP:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">r2#upgrade rom-monitor file tftp://10.0.0.1/C3725_RM2.srec.123-10r</pre></div></div>

<p>It downloads, and automatically asks if you want to restart.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Loading C3725_RM2.srec.123-10r from 10.0.0.1 (via FastEthernet0/0): !!!
[OK - 613864 bytes]
This command will result in a  'power-on reset' of the router! 
Continue? [yes/no]: yes
System configuration has been modified. Save? [yes/no]: yes
Building configuration...
[OK]
&nbsp;
ROMMON image upgrade in progress.
Erasing boot flash eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Programming boot flash pppp</pre></div></div>

<p>After the system reload, it boots the system rommon, followed by the new rommon.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Now Reloading
System Bootstrap, Version 12.2(8r)T2, RELEASE SOFTWARE (fc1)
TAC Support: http://www.cisco.com/tac
Copyright (c) 2002 by cisco Systems, Inc.
&nbsp;
Running new upgrade for first time
&nbsp;
System Bootstrap, Version 12.3(10r) [dchih 10r], RELEASE SOFTWARE (fc1)
Copyright (c) 2004 by cisco Systems, Inc.
c3725 processor with 262144 Kbytes of main memory
Main memory is configured to 64 bit mode with parity disabled
&nbsp;
Upgrade ROMMON initialized</pre></div></div>

<p>After the upgrade, here is the result of the 'show rom-mon'</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">r2#show rom-monitor
System Bootstrap, Version 12.2(8r)T2, RELEASE SOFTWARE (fc1)
TAC Support: http://www.cisco.com/tac
Copyright (c) 2002 by cisco Systems, Inc.
&nbsp;
Upgrade ROMMON version:
System Bootstrap, Version 12.3(10r) [dchih 10r], RELEASE SOFTWARE (fc1)
Copyright (c) 2004 by cisco Systems, Inc.
&nbsp;
Currently running ROMMON from Upgrade region
ROMMON from Upgrade region is selected for next boot</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://sigmapie.com/?feed=rss2&amp;p=45</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the EC2 Instance ID for this (current) machine in Ruby</title>
		<link>http://sigmapie.com/?p=5</link>
		<comments>http://sigmapie.com/?p=5#comments</comments>
		<pubDate>Thu, 12 Nov 2009 21:18:03 +0000</pubDate>
		<dc:creator>bhavesh</dc:creator>
				<category><![CDATA[amazon-ec2]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://sigmapie.com/?p=5</guid>
		<description><![CDATA[On Amazon EC2, if you are in ruby, and you want to get the current Instance ID for the machine you are running the script from, here is one way you can do it.

require 'net/http'
instance_id =  Net::HTTP.get URI.parse&#40;'http://169.254.169.254/2009-04-04/meta-data/instance-id'&#41;;

we are using 2009-04-04 API there.  If you want to see if there is a more recent version, [...]]]></description>
			<content:encoded><![CDATA[<p>On Amazon EC2, if you are in ruby, and you want to get the current Instance ID for the machine you are running the script from, here is one way you can do it.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/http'</span>
instance_id =  <span style="color:#6666ff; font-weight:bold;">Net::HTTP</span>.<span style="color:#9900CC;">get</span> <span style="color:#CC00FF; font-weight:bold;">URI</span>.<span style="color:#9900CC;">parse</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'http://169.254.169.254/2009-04-04/meta-data/instance-id'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</pre></div></div>

<p>we are using 2009-04-04 API there.  If you want to see if there is a more recent version, you can do this on the command line:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">wget http://169.254.169.254</pre></div></div>

<p>and replace the 2009-04-04. with whatever versions are listed.</p>
]]></content:encoded>
			<wfw:commentRss>http://sigmapie.com/?feed=rss2&amp;p=5</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Start up a Cisco IOS quickly without TFTP</title>
		<link>http://sigmapie.com/?p=10</link>
		<comments>http://sigmapie.com/?p=10#comments</comments>
		<pubDate>Thu, 05 Nov 2009 21:03:00 +0000</pubDate>
		<dc:creator>bhavesh</dc:creator>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[rommon]]></category>

		<guid isPermaLink="false">http://sigmapie.com/?p=10</guid>
		<description><![CDATA[While upgrading my IOS to 12.4T on my 3750, the IOS must have gotten corrupted,because on my reload I got this:

Readonly ROMMON initialized
program load complete, entry point: 0x80008000, size: 0xcac0
loadprog: bad file magic number:      0x0
boot: cannot load &#34;flash:c3725-adventerprisek9-mz.124-15.T9.bin

So I tried to load an IOS via TFTP server in ROMmon mode, [...]]]></description>
			<content:encoded><![CDATA[<p>While upgrading my IOS to 12.4T on my 3750, the IOS must have gotten corrupted,because on my reload I got this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Readonly ROMMON initialized
program load complete, entry point: 0x80008000, size: 0xcac0
loadprog: bad file magic number:      0x0
boot: cannot load &quot;flash:c3725-adventerprisek9-mz.124-15.T9.bin</pre></div></div>

<p>So I tried to <a href="http://www.ciscoblog.com/archives/2006/11/recovering_ios.html" target="_blank">load an IOS via TFTP server</a> in ROMmon mode, but my ROMmon was 12.2, so that was out of the question.</p>
<p>I could xmodem it... but that takes a really long time, which I didn't have at the time.</p>
<p>I upgraded 3 3750s and I took one of them off the rack, took the flash out, and put it into slot0 and then rebooted the router and the IOS from slot0 came up.</p>
<p>After, I tried to verify the hash of the IOS</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">router#verify flash:c3725-adventerprisek9-mz.124-15.T9.bin
router#</pre></div></div>

<p>nothing... came up.</p>
<p>When I verify the same file from slot0, it works.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">router#verify slot0:c3725-adventerprisek9-mz.124-15.T9.bin
Verifying file integrity of slot0:c3725-adventerprisek9-mz.124-15.T9.bin..
........... lots of dots later..............................Done!
Embedded Hash   MD5 : AE963FE294C20FAAA7B65C1F02E0E3FF
Computed Hash   MD5 : AE963FE294C20FAAA7B65C1F02E0E3FF
CCO Hash        MD5 : 3FA5B289DC2E9C1D760778200BA6465D</pre></div></div>

<p>So I deleted the corrupted IOS and copied the one from slot0 over.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">router#delete flash:c3725-adventerprisek9-mz.124-15.T9.bin
Delete filename [c3725-adventerprisek9-mz.124-15.T9.bin]?
Delete flash:c3725-adventerprisek9-mz.124-15.T9.bin? [confirm]
&nbsp;
router#copy slot0:c3725-adventerprisek9-mz.124-15.T9.bin flash:
Destination filename [c3725-adventerprisek9-mz.124-15.T9.bin]?
Copy in progress...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC</pre></div></div>

<p>Verify the new file is good</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">router#verify flash:c3725-adventerprisek9-mz.124-15.T9.bin
&nbsp;
Embedded Hash   MD5 : AE963FE294C20FAAA7B65C1F02E0E3FF
Computed Hash   MD5 : AE963FE294C20FAAA7B65C1F02E0E3FF
CCO Hash        MD5 : 3FA5B289DC2E9C1D760778200BA6465D</pre></div></div>

<p>Then take the memory card out of slot0 (you can do this while its running) and reboot.</p>
<p>I have never had a corrupted IOS, but I will verify from now on before rebooting.</p>
<p>Reading around, I didn't find this solution anywhere, and its by far the fastest one (if tftp isn't working).  I think it might even be faster than tftp for some people, depending on if you have to set a tftp server up or not.  Total time spent: about 15min.</p>
]]></content:encoded>
			<wfw:commentRss>http://sigmapie.com/?feed=rss2&amp;p=10</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mount the knoppix-data.img file inside Ubuntu (or any other Linux distro)</title>
		<link>http://sigmapie.com/?p=8</link>
		<comments>http://sigmapie.com/?p=8#comments</comments>
		<pubDate>Fri, 03 Jul 2009 14:04:19 +0000</pubDate>
		<dc:creator>bhavesh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[knoppix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://sigmapie.com/?p=8</guid>
		<description><![CDATA[If you are like me and you left some important files on your knoppix usb key and need to get that data out, you can mount the data.img file by using the following command:
sudo mount -o loop /media/KINGSTON/KNOPPIX/knoppix-data.img  /tmp/knoppix
]]></description>
			<content:encoded><![CDATA[<p>If you are like me and you left some important files on your knoppix usb key and need to get that data out, you can mount the data.img file by using the following command:</p>
<blockquote><p>sudo mount -o loop /media/KINGSTON/KNOPPIX/knoppix-data.img  /tmp/knoppix</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://sigmapie.com/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
