<?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>Rusty Razor Blade &#187; tutorial</title>
	<atom:link href="http://www.rustyrazorblade.com/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Headless VM Server Using Ubuntu 11.10</title>
		<link>http://www.rustyrazorblade.com/2011/10/headless-vm-server-using-ubuntu-11-10/</link>
		<comments>http://www.rustyrazorblade.com/2011/10/headless-vm-server-using-ubuntu-11-10/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 21:19:37 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[kvm]]></category>
		<category><![CDATA[libvirt]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1509</guid>
		<description><![CDATA[<p>In this tutorial I&#8217;ll be guiding you through setting up a headless Ubuntu 11.10 box that you&#8217;ll manage using virt-manager, accessed via X11. My main machine is a Mac running OSX Lion. You&#8217;ll need the Ubuntu CD, and for the first part of the tutorial, physical access to the box with a keyboard and monitor. [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I&#8217;ll be guiding you through setting up a headless Ubuntu 11.10 box that you&#8217;ll manage using virt-manager, accessed via X11.  My main machine is a Mac running OSX Lion.  You&#8217;ll need the Ubuntu CD, and for the first part of the tutorial, physical access to the box with a keyboard and monitor.  </p>
<p><strong>Install Ubuntu on your server.  </strong></p>
<p>I installed Ubuntu Desktop so I could mess with virt-manager before I disconnected everything.  You won&#8217;t be using much of the deskop feature so it might not matter to you.  Just make sure you install openssh-server so you can connect later on.</p>
<p><strong>Check BIOS</strong></p>
<p>I had purchased an HP desktop that shipped with virtualization disabled in the BIOS.  You can check here to see if it&#8217;s enabled.  You&#8217;ll need to look this up for your vendor.</p>
<blockquote><p>egrep ‘(vmx|svm)’ /proc/cpuinfo</p></blockquote>
<p>At this point you shouldn&#8217;t need to work directly on the box and everything else can be done over SSH.  </p>
<p><strong>Install KVM</strong></p>
<p>They&#8217;ve done a fine job of documenting this in the <a href="https://help.ubuntu.com/community/KVM/Installation">Ubuntu guides</a>.  I won&#8217;t rehash what they&#8217;ve already done.</p>
<p>In addition to what they&#8217;ve provided, I suggest installing virt-manager.  It&#8217;s life changing if you don&#8217;t want to spend a lot of time working on the command line with vmbuilder.</p>
<p><strong>Set up bridged networking</strong></p>
<p>I wrote a post on <a href="http://www.rustyrazorblade.com/2011/01/setting-up-a-dhcp-bridge-in-ubuntu-10-10-for-virtualization/">how to set up bridged networking in 10.10</a>, the same instructions still apply.</p>
<p><strong>Install virt-manager (or vmbuilder)</strong></p>
<p>I&#8217;ve worked with both <a target="_blank" href="https://launchpad.net/vmbuilder">vmbuilder</a> and <a target="_blank" href="http://virt-manager.org/">virt-manager</a>.  Both are excellent tools.  Virt-manager has an easier learning curve since it&#8217;s a GUI.  Vmbuilder is great since it can do an automated build for you.   </p>
<blockquote><p>apt-get install virt-manager </p></blockquote>
<p><strong>Access virt-manager over X11</strong></p>
<p>If you&#8217;re on a Mac, you&#8217;ll need to fix your X11 Preferences.  I&#8217;ve done this under Lion &#8211; I think you might need to download XQuartz on older versions.Control &#8211; Alt won&#8217;t work to let you pop out of your virt-manager VNC sessions.  Make sure &#8220;Option keys send Alt_L and Alt_R&#8221; is checked.</p>
<p><a href="http://www.rustyrazorblade.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-23-at-1.16.49-PM.png"><img src="http://www.rustyrazorblade.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-23-at-1.16.49-PM.png" alt="" title="Screen Shot 2011-10-23 at 1.16.49 PM" width="483" height="364" class="alignnone size-full wp-image-1516" /></a></p>
<p>In X11, you should SSH to your VM box.  Open a new window (Applications -> Terminal) and do the following:</p>
<blockquote><p>bash-3.2$ ssh -X haddad-vmserver</p></blockquote>
<p>Once you&#8217;re in there, fire up virt-manager </p>
<blockquote><p>jhaddad@haddad-vmserver:~$ virt-manager </p></blockquote>
<p><strong>Create your new VM</strong> </p>
<p>You should now put your install ISO on your VM host, if you haven&#8217;t already.  Create your new VM, picking RAM, hard disk, etc. I changed my network to use br0, my network bridge, instead of NAT. </p>
<p>It seems there&#8217;s a bug with VNC (at least with the version I&#8217;m using and my US keyboard).  For some reason when connecting with VNC it couldn&#8217;t detect the &#8216;a&#8217; key.  Very strange.  To fix, make sure to edit configuration before starting up.  </p>
<p><a href="http://www.rustyrazorblade.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-23-at-1.55.26-PM.png"><img src="http://www.rustyrazorblade.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-23-at-1.55.26-PM.png" alt="" title="Screen Shot 2011-10-23 at 1.55.26 PM" width="470" height="562" class="alignnone size-full wp-image-1527" /></a></p>
<p><a href="http://www.rustyrazorblade.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-23-at-1.55.51-PM.png"><img src="http://www.rustyrazorblade.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-23-at-1.55.51-PM.png" alt="" title="Screen Shot 2011-10-23 at 1.55.51 PM" width="494" height="387" class="alignnone size-full wp-image-1528" /></a></p>
<p>You should now be looking at the install screen for whatever OS you&#8217;ve decided to boot up.  Install as normal.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2011/10/headless-vm-server-using-ubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ReadyNAS Rsync Tutorial</title>
		<link>http://www.rustyrazorblade.com/2010/11/readynas-rsync-tutorial/</link>
		<comments>http://www.rustyrazorblade.com/2010/11/readynas-rsync-tutorial/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 21:26:23 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[readynas]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1245</guid>
		<description><![CDATA[<p>The NETGEAR ReadyNAS is a pretty sweet product if you&#8217;ve got a small team like I do. It&#8217;s inexpensive and easy to set up. </p> <p>Log into the ReadyNAS and turn on Rsync for your backup share. Optionally, set a username and password. Your ReadyNAS will start up it&#8217;s rsync daemon.</p> <p>Replace the password and [...]]]></description>
			<content:encoded><![CDATA[<p>The NETGEAR ReadyNAS is a pretty sweet product if you&#8217;ve got a small team like I do.  It&#8217;s inexpensive and easy to set up.  </p>
<p>Log into the ReadyNAS and turn on Rsync for your backup share.  Optionally, set a username and password.  Your ReadyNAS will start up it&#8217;s rsync daemon.</p>
<p>Replace the password and IP below with the rsync password and IP of your NAS, and use the share name in the rsync command &#8211; mine was &#8220;backup&#8221;.</p>
<p><code><br />
export RSYNC_PASSWORD="BACKUP_PASSWORD_GOES_HERE"<br />
rsync -av /var/backups/  rsync://backup@192.168.1.1:/backup/</code></p>
<p>I threw that in a shell script and run it in a cron.  Good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/11/readynas-rsync-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>External Libraries in XCode</title>
		<link>http://www.rustyrazorblade.com/2008/02/external-libraries-in-xcode/</link>
		<comments>http://www.rustyrazorblade.com/2008/02/external-libraries-in-xcode/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 00:44:48 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/2008/02/06/external-libraries-in-xcode/</guid>
		<description><![CDATA[<p>I need to compile something and use the MySQL C++ library. I have mysql and mysql++ already compiled, I won&#8217;t go over how to do that now.</p> <p>I added the following code to the top of my source:</p> <p><br /> #include &#60;mysql++.h&#62;<br /> </p> <p>I got an error </p> <p>/Users/jhaddad/dev/search_engine/main.cpp:4:21: error: mysql++.h: No such file [...]]]></description>
			<content:encoded><![CDATA[<p>I need to compile something and use the MySQL C++ library.  I have mysql and mysql++ already compiled, I won&#8217;t go over how to do that now.</p>
<p>I added the following code to the top of my source:</p>
<p><code><br />
#include &lt;mysql++.h&gt;<br />
</code></p>
<p>I got an error </p>
<blockquote><p>/Users/jhaddad/dev/search_engine/main.cpp:4:21: error: mysql++.h: No such file or directory
</p></blockquote>
<p>Not cool.  </p>
<p>How to fix:</p>
<p>In XCode, open up the project settings (under the project menu).  Click the build tab.  Go down to search paths, and you can change your Header search paths to the correct locations where you installed whatever you&#8217;re looking for.  In this case, mine was /usr/local/includes and /usr/local/mysql/</p>
<p>Next time you try to recompile, you&#8217;ll get a different error, this time it should be during Linking.  Might look something like the below.</p>
<blockquote><p>  &#8220;mysqlpp::Query::store(mysqlpp::SQLQueryParms&#038;)&#8221;, referenced from:
</p></blockquote>
<p>Right click on your project in the left hand column (file listing), click &#8220;Add existing files&#8221;, then go to the prebuilt library (for me it was in /usr/local/lib), and add the file.  You don&#8217;t have to copy it into the directory, you can just add it and it should work.  Recompile and enjoy.</p>
<p>Edit: /usr/local/lib won&#8217;t be initially visible.  Type command-shift-g and it&#8217;ll bring up a text field you can type a path into to go directly to a directory.<br />
<img src="http://www.rustyrazorblade.com/wp-content/uploads/2008/02/xcode_header.png" alt="xcode_header" title="xcode_header" width="600" height="477" class="alignnone size-full wp-image-836" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2008/02/external-libraries-in-xcode/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to use CURL to Hit a Web Api Using HTTP Basic Authentication</title>
		<link>http://www.rustyrazorblade.com/2007/05/how-to-use-curl-to-hit-a-web-api-using-http-basic-authentication/</link>
		<comments>http://www.rustyrazorblade.com/2007/05/how-to-use-curl-to-hit-a-web-api-using-http-basic-authentication/#comments</comments>
		<pubDate>Wed, 30 May 2007 20:20:45 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/index.php/2007/05/30/how-to-use-curl-to-hit-a-web-api-using-http-basic-authentication/</guid>
		<description><![CDATA[<p><a href="http://curl.haxx.se/">Curl</a> is a fantastic application.</p> <p>The most basic use of curl is very straightforward, just put in a web site&#8217;s url:</p> <p>curl http://twitter.com</p> <p>If you copy and paste the above code, you&#8217;ll get the HTML output of twitter&#8217;s home page.</p> <p>In order to demo this, I created a <a href="http://twitter.com/">twitter</a> account. You can sign [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://curl.haxx.se/">Curl</a> is a fantastic application.</p>
<p>The most basic use of curl is very straightforward, just put in a web site&#8217;s url:</p>
<p><code>curl http://twitter.com</code></p>
<p>If you copy and paste the above code, you&#8217;ll get the HTML output of twitter&#8217;s home page.</p>
<p>In order to demo this, I created a <a href="http://twitter.com/">twitter</a> account.  You can sign up for one on your own.</p>
<p>Now, to hit their api and update your status, they require you use HTTP Basic Authentication.  No sweat, we can use the -u flag for that.  The request must be sent as a post, so you must use the -d flag (data).</p>
<p><code>curl -u username:password' -d "status=i%20am%20human" http://twitter.com/statuses/update.json</code></p>
<p>Substitute your username and password in the appropriate place.</p>
<p>There you have it.  The .json at the end of the url indicates what format you want your results returned in.  Twitter also supports XML, RSS, and ATOM.  </p>
<p>I&#8217;ll be posting a follow up on how to perform curl POST requests using PHP in the next few days.  </p>
<p>The <a href="http://groups.google.com/group/twitter-development-talk/web/api-documentation"> twitter documentation</a> is very well written, check it out for more examples and other calls.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2007/05/how-to-use-curl-to-hit-a-web-api-using-http-basic-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

