<?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>[LINICKX].com &#187; Linux</title>
	<atom:link href="http://www.linickx.com/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linickx.com</link>
	<description>Moments of Genius followed by Trash.</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:06:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hacking Cisco ISE UDI</title>
		<link>http://www.linickx.com/3550/hacking-cisco-ise-udi</link>
		<comments>http://www.linickx.com/3550/hacking-cisco-ise-udi#comments</comments>
		<pubDate>Tue, 07 Feb 2012 10:06:06 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[ISE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[VM]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3550</guid>
		<description><![CDATA[The back story&#8230; you&#8217;ve deployed your ISE appliance and the world is great! Your management need you to make a change &#8220;right now&#8221; but that virtual machine in the lab you have been using for testing is 91 days old &#8230; <a href="http://www.linickx.com/3550/hacking-cisco-ise-udi">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linickx.com/files/2012/02/ISE-CAM-VM-CLEAN.png" rel="lightbox[3550]"><img src="http://www.linickx.com/files/2012/02/ISE-CAM-VM-CLEAN-150x150.png" alt="ISE Virtual Machine that thinks it a CAM" title="ISE-CAM-VM-CLEAN" width="150" height="150" class="alignright size-thumbnail wp-image-3552" /></a><br />
The back story&#8230; you&#8217;ve deployed your <a href="http://www.cisco.com/go/ise">ISE appliance</a> and the world is great! Your management need you to make a change &#8220;right now&#8221; but that virtual machine in the lab you have been using for testing is 91 days old and the eval no longer works. You raise a case to get budget and a PO over to Cisco for a lab ISE appliance or license but this change is critical, if only there was a way to use your appliance license on your VM?</p>
<p>Perhaps you should log into your ISE appliance and make a note of the Product Identifier (PID), Version Identifier (VID) and the Serial Number (SN).</p>
<p>What you might want to do now is shutdown your ISE VM and mount the disk&#8230; I always have a <a href="http://centos.org/">CentOS</a> server kicking around for this kind of thing, so if I was to do this, I would mount the ISE virtual disk as an extra disk that CentOS has access to.</p>
<p>From within CentOS you can use fdisk -l to view the hard drive partitions&#8230; When you&#8217;re hacking a VM you mount as many of the ISE partitions as you can (<em>some will fail</em>) to see what&#8217;s there. On my test machine <code>/dev/sdb7</code> was the partition of interest as it had an <code>/opt</code> directory (<em>cisco always install stuff in opt</em>).</p>
<p>Inside <code>mount-point/opt/system/bin/</code> you might find a file called <code>cars_udi_util</code>, that&#8217;s the puppy that the license is bound to.</p>
<p>What you might want to do is rename that file and replace it with something that always gives the &#8220;right&#8221; answer. Attached is <a href="http://www.linickx.com/files/2012/02/cars_udi_util.txt">cars_udi_util.txt</a>, a shell script I have been testing, edit the top of the file and insert the PID/VID/SN you found earlier.</p>
<p>Now save the <a href="http://www.linickx.com/files/2012/02/cars_udi_util.txt">cars_udi_util.txt</a> to <code>mount-point/opt/system/bin/cars_udi_util</code>, that&#8217;s right <b>remember to remove the <code>.txt</code>!</b></p>
<p>Unmount the disk, shutdown Centos and boot up ISE. </p>
<p>Now I&#8217;ve been hacking my machine and after this change the services wouldn&#8217;t start (<code>show application status ise</code>) to fix that I ran <code>application reset-config ise</code> from the ISE CLI Shell, rebooted and Voila! &#8230;The machine booted up with a blank default config.</p>
<p>After changing the default admin password (<em>from cisco</em>) it would now be possible for you to use your proper appliance license on your VM&#8230; of course this is only a temporary thing and I fully expect &amp; recommend you undo these changes as soon as your new license arrives from Cisco.</p>
<p>Happy Hacking!</p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3550/hacking-cisco-ise-udi/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell based dropbox</title>
		<link>http://www.linickx.com/3532/shell-based-dropbox</link>
		<comments>http://www.linickx.com/3532/shell-based-dropbox#comments</comments>
		<pubDate>Thu, 12 Jan 2012 07:57:32 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[del.icio.us]]></category>
		<category><![CDATA[bookmark]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3532</guid>
		<description><![CDATA[I&#8217;m looking for an ad-hoc (easy) way to share files with my remote server&#8230; I want to call the uploader in a shell environment I created one script for that (maybe with less effort than using ruby or other language) &#8230; <a href="http://www.linickx.com/3532/shell-based-dropbox">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m looking for an <strong>ad-hoc</strong> (<em>easy</em>) way to share files with my remote server&#8230;</p>
<blockquote><p> I want to call the uploader in a shell environment I created one script for that (maybe with less effort than using ruby or other language) for that, it only needs Curl installed on system and standard Unix commands like grep, tr and sed.</p></blockquote>
<p><strong>Reference</strong>: <a href="http://www.pauloamgomes.net/blog/dropbox-shell-uploader">http://www.pauloamgomes.net/blog/dropbox-shell-uploader</a><br />
<strong>Download</strong>: <a href="http://dl.dropbox.com/u/885388/DropBoxSimpleUploader.sh">http://dl.dropbox.com/u/885388/DropBoxSimpleUploader.sh</a></p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3532/shell-based-dropbox/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OCFS2 issues</title>
		<link>http://www.linickx.com/3528/ocfs2-issues</link>
		<comments>http://www.linickx.com/3528/ocfs2-issues#comments</comments>
		<pubDate>Mon, 09 Jan 2012 10:36:12 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[DRBD]]></category>
		<category><![CDATA[OCFS2]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3528</guid>
		<description><![CDATA[This morning I&#8217;ve had issues with my linickx.com cluster, the file system on both nodes went to read-only and I ended up in a world of pain. What made this odd is that running fsck.ocfs2 as suggested made no difference, &#8230; <a href="http://www.linickx.com/3528/ocfs2-issues">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This morning I&#8217;ve had issues with my linickx.com cluster, the file system on both nodes went to read-only and I ended up in a world of pain.</p>
<pre class="brush: plain; title: ; notranslate">
[root@georgia ~]# sudo /etc/init.d/httpd start
Starting httpd:
[root@georgia ~]# tail -f /var/log/messages
Jan  9 09:48:35 georgia kernel: [  474.259265] (httpd,1712,0):ocfs2_reserve_clusters_with_limit:1190 ERROR: status = -22
Jan  9 09:48:35 georgia kernel: [  474.259271] (httpd,1712,0):ocfs2_lock_allocators:2546 ERROR: status = -22
Jan  9 09:48:35 georgia kernel: [  474.259276] (httpd,1712,0):ocfs2_write_begin_nolock:1732 ERROR: status = -22
Jan  9 09:48:35 georgia kernel: [  474.259282] (httpd,1712,0):ocfs2_write_begin:1856 ERROR: status = -22
Jan  9 09:49:31 georgia kernel: [  530.660071] o2net: no longer connected to node amy (num 1) at 10.176.128.7:7777
Jan  9 09:49:31 georgia kernel: [  530.661856] ocfs2: Unmounting device (147,0) on (node 2)
Jan  9 09:59:46 georgia kernel: [ 1145.772174] o2dlm: Nodes in domain E9447DBE28154DAEA1B988CEC573EB64: 2
Jan  9 10:01:05 georgia kernel: [ 1223.911192] o2net: connected to node amy (num 1) at 10.176.128.7:7777
Jan  9 10:01:09 georgia kernel: [ 1227.933348] o2dlm: Nodes in domain E9447DBE28154DAEA1B988CEC573EB64: 1 2
Jan  9 10:01:09 georgia kernel: [ 1227.938693] ocfs2: Mounting device (147,0) on (node 2, slot 1) with ordered data mode.
Jan  9 10:02:35 georgia kernel: [ 1314.467741] OCFS2: ERROR (device drbd0): ocfs2_validate_gd_self: Group descriptor #419328 has bit count 32256 but claims that 45941 are free
Jan  9 10:02:35 georgia kernel: [ 1314.467754] File system is now read-only due to the potential of on-disk corruption. Please run fsck.ocfs2 once the file system is unmounted.
Jan  9 10:02:35 georgia kernel: [ 1314.467764] (httpd,2389,0):ocfs2_search_chain:1729 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467771] (httpd,2389,0):ocfs2_claim_suballoc_bits:1902 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467778] (httpd,2389,0):__ocfs2_claim_clusters:2185 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467783] (httpd,2389,0):ocfs2_local_alloc_new_window:1204 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467790] (httpd,2389,0):ocfs2_local_alloc_slide_window:1306 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467798] (httpd,2389,0):ocfs2_reserve_local_alloc_bits:695 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467803] (httpd,2389,0):ocfs2_reserve_clusters_with_limit:1190 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467809] (httpd,2389,0):ocfs2_lock_allocators:2546 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467814] (httpd,2389,0):ocfs2_write_begin_nolock:1732 ERROR: status = -22
Jan  9 10:02:35 georgia kernel: [ 1314.467821] (httpd,2389,0):ocfs2_write_begin:1856 ERROR: status = -22
Jan  9 10:02:36 georgia kernel: [ 1315.046965] OCFS2: ERROR (device drbd0): ocfs2_validate_gd_self: Group descriptor #419328 has bit count 32256 but claims that 45941 are free
^C
[root@georgia ~]#
</pre>
<p>What made this odd is that running <code>fsck.ocfs2</code> as suggested made no difference, as the output said that the disk was clean.</p>
<pre class="brush: plain; title: ; notranslate">
[root@georgia ~]# fsck.ocfs2 /dev/drbd0
fsck.ocfs2 1.4.4
Checking OCFS2 filesystem in /dev/drbd0:
  Label:              linickxcluster
  UUID:               E9447DBE28154DAEA1B988CEC573EB64
  Number of blocks:   1048535
  Block size:         4096
  Number of clusters: 1048535
  Cluster size:       4096
  Number of slots:    4

/dev/drbd0 is clean.  It will be checked after 20 additional mounts.
[root@georgia ~]#
</pre>
<p>I learn that in fact the above output was a lie! For any future googlers seeing the same issue, run:</p>
<p><b><code>fsck.ocfs2 -fy /dev/drbd0</code></b></p>
<p>The f &amp; y force a check and fix any found issues, the force on my filesystem found the errors and we appear to be back online <img src='http://www.linickx.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3528/ocfs2-issues/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP to solve problems</title>
		<link>http://www.linickx.com/3484/php-to-solve-problems</link>
		<comments>http://www.linickx.com/3484/php-to-solve-problems#comments</comments>
		<pubDate>Sat, 17 Dec 2011 11:05:43 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3484</guid>
		<description><![CDATA[PHP make you think of web app&#8217;s right? &#8230; well, did you know you can run it from the CLI to? Recently I&#8217;ve been doing a lot of spreadsheet and sub-netting type stuff, whilst doing this mundane work I&#8217;ve realised &#8230; <a href="http://www.linickx.com/3484/php-to-solve-problems">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>PHP make you think of web app&#8217;s right? &#8230; well, did you know you can run it from the CLI to?</p>
<p>Recently I&#8217;ve been doing a lot of spreadsheet and sub-netting type stuff, whilst doing this mundane work I&#8217;ve realised that I can get scripts to work for me. I&#8217;ve started to post a few <a href="https://gist.github.com/1309388">PHP network functions</a> to github which I&#8217;ve been using.</p>
<p>Here&#8217;s an example: I have a nokia firewall, the routing table in voyager is shown in the following format -</p>
<pre class="brush: plain; title: ; notranslate">
Network / CIDR Mask , Gateway
10.0.0.0 / 8 , 10.0.0.1
</pre>
<p>I need that same routing in a Cisco ASA format -</p>
<pre class="brush: plain; title: ; notranslate">
Network , Mask , Gateway
10.0.0.0, 255.0.0.0, 10.0.0.1
</pre>
<p>Now this is not a problem for a few routes but the firewall I&#8217;m looking at now has 177 static routes, which I don&#8217;t want to convert manually.</p>
<p><b>Roll in PHP!</b><br />
Save the original routing table as a .csv file. ColA = ip/mask , ColB = gateway. </p>
<p>Save this a route_conv.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

	/**

		Change the below to your CSV File.

	**/

	$firewall_csv = &quot;./routes_cdr.csv&quot;; 

	/**

		Function to convert CIDRs such as &quot;23&quot; to decimall dotted like &quot;255.255.254.0&quot;
		I've got more of these: https://gist.github.com/1309388

	**/

	function cidr2mask($netmask) {

		$netmask_result=&quot;&quot;;
		for($i=1; $i &lt;= $netmask; $i++) {
		  $netmask_result .= &quot;1&quot;;
		}

		for($i=$netmask+1; $i &lt;= 32; $i++) {
		    $netmask_result .= &quot;0&quot;;
		}

		$netmask_ip_binary_array = str_split( $netmask_result, 8 );

		$netmask_ip_decimal_array = array();
		foreach( $netmask_ip_binary_array as $k =&gt; $v ){
		    $netmask_ip_decimal_array[$k] = bindec( $v ); // &quot;100&quot; =&gt; 4
		}

		$subnet = join( &quot;.&quot;, $netmask_ip_decimal_array );

		return $subnet;

	}

	ini_set('auto_detect_line_endings', true); // detect CR

	if (file_exists($firewall_csv)) {

		$file = fopen($firewall_csv, 'r');

		$counter = 0; // array counter

		while (($data = fgetcsv($file)) !== FALSE) {

			list($ip, $netmask) = split( &quot;/&quot;, $data[0] ); // SPLIT Col A into IP &amp; Mask

			$netmask = cidr2mask($netmask); // Covert Mask

			$gateway = $data[1]; // Col B

			/**
				This echo is the CSV style output, but you could change this to echo &quot;route add $ip $mask $ gateway \n&quot; for unix style output.
			**/

			echo $ip . &quot;,&quot; . $netmask . &quot;,&quot; . $gateway . &quot;\n&quot;;

		}

		fclose($file);

	} else {

		echo &quot;404: $firewall_csv \n&quot;; // FILE NOT FOUND.

	}
?&gt;
</pre>
<p>from your CLI run &#8220;<code>php route_conv.php</code>&#8221; and enjoy the output!</p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3484/php-to-solve-problems/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>port install ipcalc</title>
		<link>http://www.linickx.com/3476/port-install-ipcalc</link>
		<comments>http://www.linickx.com/3476/port-install-ipcalc#comments</comments>
		<pubDate>Wed, 14 Dec 2011 13:39:01 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[PICS]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[ipcalc]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3476</guid>
		<description><![CDATA[Copyright &#169; 2012 [LINICKX].com. This Feed is for personal non-commercial use only. Please check my Site Terms and Conditions for full details on copyrights. If you have any concerns with the content of this feed you may contact me here.WP &#8230; <a href="http://www.linickx.com/3476/port-install-ipcalc">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linickx.com/files/2011/12/ipcalc.png" rel="lightbox[3476]"><img src="http://www.linickx.com/files/2011/12/ipcalc.png" alt="" title="ipcalc" width="625" height="369" class="aligncenter size-full wp-image-3477" /></a></p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3476/port-install-ipcalc/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a free Dynamic DNS client with rackspace Cloud</title>
		<link>http://www.linickx.com/3442/building-a-free-dynamic-dns-client-with-rackspace-cloud</link>
		<comments>http://www.linickx.com/3442/building-a-free-dynamic-dns-client-with-rackspace-cloud#comments</comments>
		<pubDate>Sun, 30 Oct 2011 21:46:36 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[rsdns]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3442</guid>
		<description><![CDATA[As a cloud server customer you get access to rackspace&#8217;s free DNS service. When I fist saw this product I had an instance light-bulb moment, I could stop paying for a dynamic DNS service and build my own private one. &#8230; <a href="http://www.linickx.com/3442/building-a-free-dynamic-dns-client-with-rackspace-cloud">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rackspace.com/cloud/cloud_hosting_products/dns/"><img src="http://www.linickx.com/files/2011/10/rsdns.png" alt="" title="rsdns" width="200" height="173" class="alignright size-full wp-image-3447" /></a><br />
As a <a href="http://www.rackspace.co.uk/cloud-hosting/cloud-products/cloud-servers/">cloud server</a> customer you get access to <a href="http://www.rackspace.com/cloud/cloud_hosting_products/dns/">rackspace&#8217;s free DNS service</a>.</p>
<p>When I fist saw this product I had an instance light-bulb moment, I could stop paying for a dynamic DNS service and build my own private one. As a broadband (DHCP) user I have a very basic requirement of needing to regularly update an A record so that I can find my pc <img src='http://www.linickx.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To bring my idea into fruition I began researching; I need a cli tool which I could run from cron on my linux box (<em>to send the DNS update requests to rackspace</em>). In my research I found <a href="https://github.com/jsquared">rscurl</a>, a cli tool to control cloud servers, as rackspace have a standard API for all their products I have been able to use rscurl to develop <a href="https://github.com/linickx/rsdns">rsdns.</a></p>
<p>rsdns is a series of cli tools to adding/deleting/changing rackspace DNS records, as part of the tool development I have created a script called <code>rsdns-dc.sh</code> to run on my machine, below is a short how to:</p>
<p><strong>How to get free dynamic dns from rackspace.</strong></p>
<p><span id="more-3442"></span></p>
<p><u>Pre-requisit</u>: This is for linux/mac, if you want to do this on windows you&#8217;ll need bash, curl, awk, sed &amp; dig installed &#8211; google is your friend.</p>
<p>The instructions below assume that you (a) have a domain and (b) have already changed your NS records to point to dns1.stabletransit.com &#038; dns2.stabletransit.com. </p>
<p><a href="https://github.com/linickx/rsdns/tarball/master">Download the latest rsdns from gitgub</a> and unpack somewhere, I like <code>~/bin/rsdns</code>.</p>
<p>Go to your rackspace management portal and grap your username &amp; API key (<em>It&#8217;s under &#8220;Your Account&#8221; -&gt; &#8220;API Access&#8221;</em>)</p>
<p>Create a config file for rsdns (<code>~/.rsdns_config</code>) with your settings.</p>
<pre class="brush: bash; title: ; notranslate">
RSUSER=linickx
RSAPIKEY=123456
RSPATH=~/bin/rsdns/
</pre>
<p>You need your domain <em>created</em> on rackspace, you can either use rackspaces GUI to do this (<em>It&#8217;s under &#8220;Hosting&#8221; -&gt; &#8220;Cloud Servers&#8221; -&gt; &#8220;serverabc&#8221; -&gt; &#8220;DNS&#8221; </em>) or you can use rsdns, like so.</p>
<pre class="brush: bash; title: ; notranslate">
[LINICKX@SERVER rsdns]$./rsdns-domain.sh -d www.linickx.com -e spam@linickx.com
</pre>
<p>Once you have a domain setup you need an A record, this step was a deliberate design to avoid any rouge cron jobs from creating a million records, the dynamic client will only update an existing record &#8211; not create a new one. </p>
<p>To create the a record you going to need an IP address, it can be something random like the below, or you can use <a href="http://icanhazip.com">http://icanhazip.com</a> to get your actual current IP. Again to create a record, you can use the rackspace GUI (<em>It&#8217;s under &#8220;Hosting&#8221; -&gt; &#8220;Cloud Servers&#8221; -&gt; &#8220;serverabc&#8221; -&gt; &#8220;DNS&#8221; -&gt; &#8220;yourdomain&#8221; &gt; &#8220;Add&#8221;</em>) or you can use rsdns&#8230;.</p>
<pre class="brush: bash; title: ; notranslate">
[LINICKX@SERVER rsdns]$./rsdns-a.sh -n dynamichost.linickx.com -i 123.123.123.123 -t 3600
</pre>
<p>In the above the TTL is set to 1hr, this is so that DNS caches do not keep the record too long. That&#8217;s all the pre-work done, now lets get your dynamic host setup!</p>
<p>The script to update your a record is <code>rsdns-dc.sh</code>, and you run it like this&#8230;</p>
<pre class="brush: bash; title: ; notranslate">
[LINICKX@SERVER rsdns]$./rsdns-dc.sh -n dynamichost.linickx.com
</pre>
<p>Easy huh? The script uses icanhazip to get your current IP, it then update the A record with it.</p>
<p>I never switch off my router so I have create a created a cronjob to run that script every 2 hours, plus the 1hr TTL <em>should</em> mean that the record is roughly in sync with my IP without making unnecessary requests &#8211; You can run the script more often if you like, just stay under the limits &#8211;&gt; according to <a href="http://docs.rackspace.com/cdns/api/v1.0/cdns-devguide/content/Rate_Limits-d1e1222.html">the API guidelines</a> you can make upto 25 changes per min / 2 per second.</p>
<p>I use redhat based linux systems, so I can simply drop the following file called rsdns-dc into <code>/etc/cron.d/</code> with this&#8230;</p>
<pre class="brush: plain; title: ; notranslate">
* */2  * * *     linickx /home/linickx/bin/rsdns/rsdns-dc.sh -n dynamichost.linickx.com &amp;&gt;/dev/null
</pre>
<p>Now we are actually done! Free private Dynamic DNS on your own zone, what more could you want?</p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3442/building-a-free-dynamic-dns-client-with-rackspace-cloud/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Recover files or Undelete on mac/linux/windows</title>
		<link>http://www.linickx.com/3438/recover-files-or-undelete-on-maclinuxwindows</link>
		<comments>http://www.linickx.com/3438/recover-files-or-undelete-on-maclinuxwindows#comments</comments>
		<pubDate>Wed, 28 Sep 2011 12:22:19 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[del.icio.us]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[photorec]]></category>
		<category><![CDATA[undelete]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3438</guid>
		<description><![CDATA[Posted here so I can find it again, and yep worked on my SDcard! This Recovery example guides you through PhotoRec step by step to recover deleted files or lost data from a reformatted partition or corrupted file system. http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step &#8230; <a href="http://www.linickx.com/3438/recover-files-or-undelete-on-maclinuxwindows">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Posted here so I can find it again, and yep worked on my SDcard!</p>
<blockquote><p>This Recovery example guides you through PhotoRec step by step to recover deleted files or lost data from a reformatted partition or corrupted file system.</p></blockquote>
<p><a href="http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step">http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step</a></p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3438/recover-files-or-undelete-on-maclinuxwindows/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F5 BigIP LTM VE works in Virtual Box</title>
		<link>http://www.linickx.com/3340/f5-bigip-ltm-ve-works-in-virtual-box</link>
		<comments>http://www.linickx.com/3340/f5-bigip-ltm-ve-works-in-virtual-box#comments</comments>
		<pubDate>Tue, 26 Jul 2011 08:09:59 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[bigip]]></category>
		<category><![CDATA[f5]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ltm]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[ve]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3340</guid>
		<description><![CDATA[Something I discovered ages ago (so long ago that my trial license expired) but forgot to post is that you can get an LTM VE to work in Virtual Box. To get started download the ESX image from the F5 &#8230; <a href="http://www.linickx.com/3340/f5-bigip-ltm-ve-works-in-virtual-box">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[
<a href='http://www.linickx.com/3340/f5-bigip-ltm-ve-works-in-virtual-box/bigip-10-1-0-3341-1084-virtualbox' title='BIGIP-10.1.0.3341.1084 VirtualBox'><img width="150" height="150" src="http://www.linickx.com/files/2011/07/BIGIP-10.1.0.3341.1084-VirtualBox-150x150.png" class="attachment-thumbnail" alt="BIGIP-10.1.0.3341.1084 VirtualBox" title="BIGIP-10.1.0.3341.1084 VirtualBox" /></a>
<a href='http://www.linickx.com/3340/f5-bigip-ltm-ve-works-in-virtual-box/f5-ltm-ve-virtualbox-settings' title='F5 LTM VE Virtualbox Settings'><img width="150" height="150" src="http://www.linickx.com/files/2011/07/F5-LTM-VE-Virtualbox-Settings-150x150.png" class="attachment-thumbnail" alt="F5 LTM VE Virtualbox Settings" title="F5 LTM VE Virtualbox Settings" /></a>

<p>Something I discovered <em>ages ago</em> (<em>so long ago that my trial license expired</em>) but forgot to post is that you can get an <a href="http://www.f5.com/products/big-ip/local-traffic-manager-virtual-edition.html" title="F5 LTM VE Product Page">LTM VE</a> to work in Virtual Box.</p>
<p>To get started download the ESX image from the <a href="https://www.f5.com/trial/big-ip-ltm-virtual-edition.php">F5 VE Trial Page</a>, when you get the download import the OVA into virtualbox.</p>
<p>The only thing I needed to tweak after the import was the interface settings, you need two intels and a PCNet, the PCNet is the management interface. Set the PCNet to host only networking, give your laptop/pc an ip address on the host only network a 192.168.1 address and you&#8217;re good to go!</p>
<p>You may experience HIGH CPU issues after boot, but since these boxes are based on linux, you can use <a href="http://steve-brown.id.au/linux/centos-5-in-virtualbox-high-cpu-usage.html">the divider=10 centos trick</a>.</p>
<p>Enjoy your virtual load balancing!</p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3340/f5-bigip-ltm-ve-works-in-virtual-box/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beefy Miracle</title>
		<link>http://www.linickx.com/3265/beefy-miracle</link>
		<comments>http://www.linickx.com/3265/beefy-miracle#comments</comments>
		<pubDate>Tue, 05 Apr 2011 17:22:19 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3265</guid>
		<description><![CDATA[I really hope that the next version of fedora gets called &#8220;Beefy Miracle&#8221; You can vote for your favourite name at https://admin.fedoraproject.org/voting/about/relnamef16 but I can&#8217;t see how anything can beat the beef! Copyright &#169; 2012 [LINICKX].com. This Feed is for &#8230; <a href="http://www.linickx.com/3265/beefy-miracle">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I really hope that the next version of fedora gets called &#8220;Beefy Miracle&#8221;</p>
<p>You can vote for your favourite name at <a href="https://admin.fedoraproject.org/voting/about/relnamef16">https://admin.fedoraproject.org/voting/about/relnamef16</a> but I can&#8217;t see how anything can beat the beef!</p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3265/beefy-miracle/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lowing VirtualBox priorities</title>
		<link>http://www.linickx.com/3212/lowing-virtualbox-priorities</link>
		<comments>http://www.linickx.com/3212/lowing-virtualbox-priorities#comments</comments>
		<pubDate>Mon, 14 Feb 2011 17:30:01 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.linickx.com/?p=3212</guid>
		<description><![CDATA[One of the things I&#8217;d really like is process priorities for virtual box. In the forum I posted a couple of shell commands that I regularly type&#8230; which gets a bit tedious, following a recent article on lifehacker reviewing mac &#8230; <a href="http://www.linickx.com/3212/lowing-virtualbox-priorities">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the things <a href="http://forums.virtualbox.org/viewtopic.php?f=9&#038;t=34341">I&#8217;d really like</a> is process priorities for virtual box. In the forum I posted a couple of shell commands that I regularly type&#8230; which gets a bit tedious, following a recent article on lifehacker <a href="http://lifehacker.com/#!5749631/the-mac-text-expansion-face-off">reviewing mac text expanding</a> I&#8217;ve been prompted to automate a few things&#8230; below is a little shell script to lower the priority (<em>renice</em>) of all running virtual machines.</p>
<p>The advantage of doing this is that your host machine stays snappy, responsive and won&#8217;t get too over-loaded by jobs on your VMs!</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
ps -xo pid,command | grep -v grep | grep startvm | while read line ;
do
        procID=`echo $line | awk '{print $1}'`
        sudo renice +10 -p $procID
done
</pre>
<p>The above code works on a mac; although I haven&#8217;t tested it, I recon to get it running on Linux you need to update the PS command, by swapping the x for an e&#8230; like this&#8230;. </p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
ps -eo pid,command | grep -v grep | grep startvm | while read line ;
do
        procID=`echo $line | awk '{print $1}'`
        sudo renice +10 -p $procID
done
</pre>
<p>Have fun, suggestions and improvements welcome.</p>
<img src="http://www.linickx.com/wp/wp-content/themes/linickx_v2/images/nick_sig_bggrey.png" alt="Nick" /> <hr/>Copyright &copy; 2012 <strong><a href="http://www.linickx.com">[LINICKX].com</a></strong>. This Feed is for personal non-commercial use only. Please check my <a href="http://www.linickx.com/?page_id=63">Site Terms and Conditions</a> for full details on copyrights. If you have any concerns with the content of this feed you may <a href="http://www.linickx.com/contact">contact me here</a>.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">WP Copyright Plugin</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.linickx.com/3212/lowing-virtualbox-priorities/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

