<?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>Super Nerdy Cool</title>
	<atom:link href="http://blog.nguyenvq.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nguyenvq.com</link>
	<description>My (technical) adventures through the professional world...</description>
	<lastBuildDate>Fri, 11 May 2012 03:40:03 +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>Enable root account in Ubuntu?</title>
		<link>http://blog.nguyenvq.com/2012/04/29/enable-root-account-in-ubuntu/</link>
		<comments>http://blog.nguyenvq.com/2012/04/29/enable-root-account-in-ubuntu/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 07:00:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[passwd]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[su]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1270</guid>
		<description><![CDATA[After my recent experience with broken su and sudo commands in a failed system upgrade, I realized that although disabling the root account has many advantages, one of the disadvantage is that I can&#8217;t login as root in the terminal when I&#8217;m physically in front of the system. This is a major issue if su, <a href="http://blog.nguyenvq.com/2012/04/29/enable-root-account-in-ubuntu/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After my recent <a href="http://ubuntuforums.org/showthread.php?t=1967660">experience</a> with broken <code>su</code> and <code>sudo</code> commands in a failed system upgrade, I realized that although disabling the root account has many <a href="https://help.ubuntu.com/community/RootSudo">advantages</a>, one of the disadvantage is that I can&#8217;t login as root in the terminal when I&#8217;m physically in front of the system.  This is a major issue if <code>su</code>, <code>sudo</code>, and <code>passwd</code> binaries are broken somehow.  Luckily, <a href="https://help.ubuntu.com/community/BasicChroot">chroot</a> was there to the rescue for me.  Now, I contemplate whether I should <a href="https://help.ubuntu.com/community/RootSudo">enable</a> the root account on my systems&hellip; </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/04/29/enable-root-account-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free books at Project Gutenberg</title>
		<link>http://blog.nguyenvq.com/2012/04/26/free-books-at-project-gutenberg/</link>
		<comments>http://blog.nguyenvq.com/2012/04/26/free-books-at-project-gutenberg/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 07:00:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Researching]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Teaching]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[ebooks]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[project gutenberg]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1266</guid>
		<description><![CDATA[Project Gutenberg offers free books that are in the public domain (eg, copyright has expired). Some of the Math books are even typewritten using LaTeX. Cool!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gutenberg.org/wiki/Main_Page">Project Gutenberg</a> offers free books that are in the public domain (eg, copyright has expired).  Some  of the <a href="http://www.gutenberg.org/wiki/Mathematics_(Bookshelf)">Math books</a> are even typewritten using LaTeX.  Cool! </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/04/26/free-books-at-project-gutenberg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flipping the classroom: creating screencast lectures in Linux</title>
		<link>http://blog.nguyenvq.com/2012/04/25/flipping-the-classroom-creating-screencast-lectures-in-linux/</link>
		<comments>http://blog.nguyenvq.com/2012/04/25/flipping-the-classroom-creating-screencast-lectures-in-linux/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 07:00:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Teaching]]></category>
		<category><![CDATA[flip classroom]]></category>
		<category><![CDATA[Istanbul]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[RecordMyDesktop]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1261</guid>
		<description><![CDATA[I&#8217;m debating the idea (hype) of flipping the classroom for one of my classes next Fall where students watch lecture videos at home (or elsewhere) so I could spend class time doing more hands-on activities like discussing the art of data analysis and how to solve problems with statistics. I think Khan Academy, Udacity, and <a href="http://blog.nguyenvq.com/2012/04/25/flipping-the-classroom-creating-screencast-lectures-in-linux/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m debating the idea (hype) of flipping the classroom for one of my classes next Fall where students watch lecture videos at home (or elsewhere) so I could spend class time doing more hands-on activities like discussing the art of data analysis and how to solve problems with statistics.  I think <a href="http://www.khanacademy.org/">Khan Academy</a>, <a href="http://www.udacity.com/">Udacity</a>, and <a href="https://www.coursera.org/">Coursera</a> are doing a great service for humanity by offering high quality courses taught by excellent teachers online that are accessible to anyone with an internet connection. </p>
<p> I don&#8217;t claim to be a great teacher, but I think my own students <i>might</i> benefit from this pedagogical method.  My main concern with this approach is that not all students will watch the lectures, just as how not all students read the assigned readings (guilty as a student).  I guess I can give students short quizzes during lecture to push them to watch the videos.  Also, I&#8217;ll give my usual challenging homework so that only students that study the material well could excel.  By flipping the classroom, more material could be covered, students have access to the recordings in addition to my slides, and I could make sure everything I want to be said are recorded (as opposed to a live session where I could forget a few points).  Lecture times can then be more interactive as opposed to me lecturing them for an hour. </p>
<p> I think most of the online education sites use <a href="http://www.techsmith.com/camtasia.html">Camtasia</a> with a <a href="http://www.wacom.com/en/Products/Cintiq.aspx">Wacom Cintiq</a> to produce their videos.  I use Linux and cannot afford such an expensive device.  I plan on using a <a href="https://wiki.ubuntu.com/ScreenCasts">screencast</a> software like <a href="http://recordmydesktop.sourceforge.net/about.php">recordMyDesktop</a> or <a href="http://live.gnome.org/Istanbul">Istanbul</a> to record the desktop screen and audio.  For recordMyDesktop, I had issues with the <code>encode on the fly</code> option, which means recording very long videos could be an issue (1 minute of raw video takes up about 210MB, and 1 minute encoded video takes up about 8MB).  Istanbul records on the fly without problem (I think).  I haven&#8217;t tried recording for an hour and 20 minutes yet. </p>
<p> My plan is to create my lecture slides with <a href="http://www.latex-project.org/">LaTeX</a> <a href="https://bitbucket.org/rivanvx/beamer/wiki/Home">Beamer</a> and use <a href="http://xournal.sourceforge.net/">Xournal</a> to annotate the slides as I&#8217;m lecturing; hopefully my Asus T101MT netbook is strong enough to do the recording as I utilize it&#8217;s touchscreen capabilities.  I can just switch over to <a href="http://www.gnu.org/software/emacs/">Emacs</a> to illustrate data analysis in <a href="http://www.r-project.org/">R</a> when needed.  My main concern now is where I could host these (large) videos&hellip; </p>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1">Update 4/27/2012: Screencast with ffmpeg</h2>
<div class="outline-text-2" id="text-1">
<p> After some testing, I think the best screencast software on Linux would have to be ffmpeg.  First, remove ffmpeg and compile it from source based on the latest version per <a href="https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide">this</a> post.  Then, create <code>screencast.sh</code>: </p>
<pre class="src src-sh"><span style="color: #ff4500;">#</span><span style="color: #ff4500;">! /bin/</span><span style="color: #00ffff;">bash</span>
<span style="color: #eedd82;">DATE</span>=<span style="color: #fa8072;">`date +%Y%m%d`</span>
<span style="color: #eedd82;">TIME</span>=<span style="color: #fa8072;">`date +%Hh%M`</span>
ffmpeg -y -f alsa -ac 2 -i pulse -f x11grab -r 24 -s $(<span style="color: #fa8072;">xwininfo</span> -root | grep <span style="color: #ffa07a;">'geometry'</span> | awk <span style="color: #ffa07a;">'{print $2;}'</span>) -i :0.0 -c:v libx264 -preset veryfast -crf 22 -c:a libmp3lame -ar 44100 -ab 24k -threads 0 /tmp/screencast_$<span style="color: #eedd82;">DATE</span>-$<span style="color: #eedd82;">TIME</span>.mp4
</pre>
<p> For more libx264 options, see <a href="http://mewiki.project357.com/wiki/X264_Settings">this</a> page. </p>
</div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/04/25/flipping-the-classroom-creating-screencast-lectures-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use wget or curl to download files that require login</title>
		<link>http://blog.nguyenvq.com/2012/04/13/use-wget-or-curl-to-download-files-that-require-login/</link>
		<comments>http://blog.nguyenvq.com/2012/04/13/use-wget-or-curl-to-download-files-that-require-login/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 07:00:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1259</guid>
		<description><![CDATA[Some sites require a user to login or authenticate before a file could be downloaded. To do so with wget, make use of the --post-data and --save-cookies arguments as described here. We first have to view the source of the html file, determine the name of the variables to post, and pass these information onto <a href="http://blog.nguyenvq.com/2012/04/13/use-wget-or-curl-to-download-files-that-require-login/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some sites require a user to login or authenticate before a file could be downloaded.  To do so with <a href="http://www.gnu.org/software/wget/">wget</a>, make use of the <code>--post-data</code> and <code>--save-cookies</code> arguments as described <a href="http://wget.addictivecode.org/FrequentlyAskedQuestions#How_do_I_use_wget_to_download_pages_or_files_that_require_login.2BAC8-password.3F">here</a>.  We first have to view the source of the html file, determine the name of the variables to post, and pass these information onto the site via the <code>wget</code>.  Once we have a cookie file that&#8217;s authenticated, we can use this cookie file via the <code>--load-cookies</code> argument to download our files. </p>
<p> Some sites will also not allow wget to download the files.  To get around that, make use of the <code>--user-agent</code> argument as described <a href="http://www.askapache.com/linux/wget-header-trick.html">here</a>. </p>
<p> All this can also be done in <a href="http://curl.haxx.se/">curl</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/04/13/use-wget-or-curl-to-download-files-that-require-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Record streaming radio with streamripper</title>
		<link>http://blog.nguyenvq.com/2012/04/13/record-streaming-radio-with-streamripper/</link>
		<comments>http://blog.nguyenvq.com/2012/04/13/record-streaming-radio-with-streamripper/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 07:00:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[radio]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[shoutcast]]></category>
		<category><![CDATA[stream]]></category>
		<category><![CDATA[streamripper]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1257</guid>
		<description><![CDATA[Yes, many radio shows are available as podcasts. However, some are not. If a radio show is also broadcasted via a live stream online, then we could record it with streamripper. I did so as follow: sudo apt-get install streamripper ## install ## record for 60 seconds streamripper http://kpcclive1.publicradio.org:80/ -s -l 60 -a "Prarie - <a href="http://blog.nguyenvq.com/2012/04/13/record-streaming-radio-with-streamripper/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yes, many radio shows are available as podcasts.  However, some are not.  If a radio show is also broadcasted via a live stream online, then we could record it with <a href="http://streamripper.sourceforge.net/">streamripper</a>.  I did so as follow: </p>
<pre class="src src-sh">sudo apt-get install streamripper <span style="color: #ff4500;">## </span><span style="color: #ff4500;">install</span>
<span style="color: #ff4500;">## </span><span style="color: #ff4500;">record for 60 seconds</span>
streamripper http://kpcclive1.publicradio.org:80/ -s -l 60 -a <span style="color: #ffa07a;">"Prarie - %d"</span>
</pre>
<p> To have the show be recorded automatically, first create <code>record.sh</code>: </p>
<pre class="src src-sh"><span style="color: #ff4500;">#</span><span style="color: #ff4500;">! /bin/</span><span style="color: #00ffff;">bash</span>

<span style="color: #ff4500;">## </span><span style="color: #ff4500;">set in crontab:</span>
<span style="color: #ff4500;">## </span><span style="color: #ff4500;">59 17 * * 6 /path/to/record.sh</span>
<span style="color: #b0c4de;">cd</span> /path/to/save/; streamripper http://kpcclive1.publicradio.org:80/ -s -l 3720 -a <span style="color: #ffa07a;">"Prarie - %d"</span> &amp;&gt; /dev/null
</pre>
<p> Then add the following cron entry via <code>crontab -e</code>: </p>
<pre class="example">59 17 * * 6 /path/to/record.sh
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/04/13/record-streaming-radio-with-streamripper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OAuth explained in plain English</title>
		<link>http://blog.nguyenvq.com/2012/04/05/oauth-explained-in-plain-english/</link>
		<comments>http://blog.nguyenvq.com/2012/04/05/oauth-explained-in-plain-english/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 07:00:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1254</guid>
		<description><![CDATA[Excellent post.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.varonis.com/introduction-to-oauth/">Excellent post</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/04/05/oauth-explained-in-plain-english/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving academic talks</title>
		<link>http://blog.nguyenvq.com/2012/04/05/improving-academic-talks/</link>
		<comments>http://blog.nguyenvq.com/2012/04/05/improving-academic-talks/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 07:00:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Teaching]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[presenting]]></category>
		<category><![CDATA[slide show]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1252</guid>
		<description><![CDATA[This is an excellent post explaining why some presentations suck and how to succeed in your own oral presentations. I have much to work on.]]></description>
			<content:encoded><![CDATA[<p><a href="http://bactra.org/weblog/900.html">This</a> is an excellent post explaining why some presentations suck and how to succeed in your own oral presentations.  I have much to work on. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/04/05/improving-academic-talks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test ram with Memtest86+ and ignore bad parts with badram in grub</title>
		<link>http://blog.nguyenvq.com/2012/03/30/test-ram-with-memtest86-and-ignore-bad-parts-with-badram-in-grub/</link>
		<comments>http://blog.nguyenvq.com/2012/03/30/test-ram-with-memtest86-and-ignore-bad-parts-with-badram-in-grub/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 22:41:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[badram]]></category>
		<category><![CDATA[broken memory]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[freeze]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[grub2]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[memtest86]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1246</guid>
		<description><![CDATA[Recently, my computer kept freezing whenever I started conkeror (with 100+ buffers loading from a previous session). Folks over at #conkeror on freenode suggested that the problem might be due to faulty ram. They suggested testing my ram with Memtest86+. It is installed by default on Ubuntu. If you have multiple sticks of ram, test <a href="http://blog.nguyenvq.com/2012/03/30/test-ram-with-memtest86-and-ignore-bad-parts-with-badram-in-grub/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently, my computer kept freezing whenever I started <a href="http://conkeror.org/">conkeror</a> (with 100+ buffers loading from a previous session).  Folks over at <code>#conkeror</code> on <code>freenode</code> suggested that the problem might be due to faulty ram.  They suggested testing my ram with <a href="http://www.memtest.org/">Memtest86+</a>.  It is installed by default on Ubuntu. </p>
<p> If you have multiple sticks of ram, test one stick at a time.  It&#8217;s best to test one stick per night as  the test can take hours.  To test the ram, restart your computer and go to the <code>grub</code> menu (hold shift if your grub menu doesn&#8217;t display automatically).  Then, select the &#8220;Memtest86+&#8221; boot option.  Press &#8220;c&#8221;, &#8220;4&#8243;, and &#8220;3&#8243; to display the error locations according to the <a href="http://rick.vanrein.org/linux/badram/">BadRAM</a> syntax (converting the default faulty memory addresses is not obvious to me and <a href="http://ubuntuforums.org/archive/index.php/t-1689890.html">others</a>).  If you don&#8217;t do this, you will end up wasting time fixing your boot options (details later). </p>
<p> If you know which ram sticks are bad, replace them if they are under warranty.  If they are not under warranty and you can&#8217;t afford new ram, you can make use of BadRAM, incorporated by default in grub2, per <a href="https://help.ubuntu.com/community/BadRAM">these</a> documentations.  That is, edit <code>/etc/default/grub</code> and specify the faulty ram addresses with the <code>GRUB_BADRAM</code> option. </p>
<p> More information on running Linux with broken memory can be found <a href="http://www.linuxjournal.com/article/4489">here</a>. </p>
<p> When I tried this out, I did not use the proper memory address syntax so my computer failed to boot.  What made things even worse was that my hard drive was <a href="http://blog.nguyenvq.com/2011/09/15/backup-re-install-ubuntu-with-full-disk-encryption-and-restore-all-files-and-settings/">encrypted</a>.  Luckily, I can still access grub, and after many trials and tribulations, I fixed the problem by booting the computer with an Ubuntu live disk (usb), mounting the first, unencrypted partition (<code>/dev/sda1</code>) of the hard drive that stored <code>/boot</code>, and removing the <code>badram</code> option in <code>/boot/grub/grub.cfg</code> (replace &#8220;boot&#8221; with the mount path).  Before figuring out the solution, I was trying to mount <code>/dev/sda5</code>, the encrypted partition, according to <a href="http://ubuntuforums.org/showthread.php?t=611165">this</a> and <a href="http://karuppuswamy.com/wordpress/2010/06/02/how-to-chroot-to-ubuntu-using-live-cd-to-fix-grub-rescue-prompt/">this</a> as I thought that was where <code>/boot</code> resided.  I also thought I had to generate a new <code>initrd</code> image.  Luckily I didn&#8217;t have to (and didn&#8217;t succeed in trying) as that would have further complicate my boot options as I have experienced in the <a href="http://blog.nguyenvq.com/2011/09/15/backup-re-install-ubuntu-with-full-disk-encryption-and-restore-all-files-and-settings/">past</a>. </p>
<p> After removing the bad ram, conkeror still crashed for me.  Either something is wrong with other pieces of my hardware or something is going on with the xulrunner sucking up my system resources.  I was able to stop the crashes by placing <a href="http://retroj.net/git/conkerorrc/content-delay.js">this</a> in my conkeror rc file. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/03/30/test-ram-with-memtest86-and-ignore-bad-parts-with-badram-in-grub/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrate wordpress to nginx?</title>
		<link>http://blog.nguyenvq.com/2012/03/30/migrate-wordpress-to-nginx/</link>
		<comments>http://blog.nguyenvq.com/2012/03/30/migrate-wordpress-to-nginx/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 18:35:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[varnish]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1243</guid>
		<description><![CDATA[Read this interesting post where the author sets up a wordpress blog with nginx on an Amazon EC2 instance. Author claims he could handle 10 million hits a day. I should explore nginx some day.]]></description>
			<content:encoded><![CDATA[<p>Read <a href="http://www.ewanleith.com/blog/900/10-million-hits-a-day-with-wordpress-using-a-15-server">this</a> interesting post where the author sets up a wordpress blog with nginx on an Amazon EC2 instance.  Author claims he could handle 10 million hits a day.  I should explore nginx some day. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/03/30/migrate-wordpress-to-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build 32 bit R on 64 bit Ubuntu by utilizing chroot</title>
		<link>http://blog.nguyenvq.com/2012/03/30/build-32-bit-r-on-64-bit-ubuntu-by-utilizing-chroot/</link>
		<comments>http://blog.nguyenvq.com/2012/03/30/build-32-bit-r-on-64-bit-ubuntu-by-utilizing-chroot/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 17:54:00 +0000</pubDate>
		<dc:creator>Vinh Nguyen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[32 bit]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[multiarch]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.nguyenvq.com/?p=1241</guid>
		<description><![CDATA[In the past, I&#8217;ve described how one could build multiarch (64 bit and 32 bit) versions of R on a 64 bit Ubuntu machine. The method based on this thread no longer works as of R 2.13 or 2.14 I believe. I received advice from someone on #R over on freenode (forgot who) a few <a href="http://blog.nguyenvq.com/2012/03/30/build-32-bit-r-on-64-bit-ubuntu-by-utilizing-chroot/"> read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In the past, I&#8217;ve <a href="http://blog.nguyenvq.com/2011/08/11/build-multiarch-r-32-bit-and-64-bit-on-debianubuntu/">described</a> how one could build multiarch (64 bit and 32 bit) versions of R on a 64 bit Ubuntu machine.  The method based on <a href="http://comments.gmane.org/gmane.comp.lang.r.devel/28675">this</a> thread no longer works as of R 2.13 or 2.14 I believe.  I received advice from someone on <code>#R</code> over on <code>freenode</code> (forgot who) a few months ago that suggested the <a href="https://help.ubuntu.com/community/BasicChroot">chroot</a> route (see <a href="http://ubuntuforums.org/showthread.php?t=24575">this</a> also).  I recently tried it and wanted to document the procedures.  Although the solution isn&#8217;t as nice as the previous multiarch route, it will suffice for now.  With the <code>chroot</code> method, first compile the 64 bit version of R the <a href="http://blog.nguyenvq.com/2011/07/11/r-from-source/">usual</a> way.  For the 32 bit version of R, do: </p>
<pre class="src src-sh"><span style="color: #ff4500;">#### </span><span style="color: #ff4500;">change my.username to your username, or modify path per your taste</span>
<span style="color: #ff4500;">### </span><span style="color: #ff4500;">create chroot jail</span>
sudo apt-get install dchroot debootstrap
sudo mkdir ~/chroot-R32
sudo emacs -q -nw /etc/schroot/schroot.conf
<span style="color: #ff4500;">## </span><span style="color: #ff4500;">paste the following in the file: (no quotes)</span>
<span style="color: #ffa07a;">"</span>
<span style="color: #ffa07a;">[natty]</span>
<span style="color: #ffa07a;">description=Ubuntu Natty</span>
<span style="color: #ffa07a;">location=/home/my.username/chroot-R32</span>
<span style="color: #ffa07a;">priority=3</span>
<span style="color: #ffa07a;">users=my.username</span>
<span style="color: #ffa07a;">groups=sbuild</span>
<span style="color: #ffa07a;">root-groups=root</span>
<span style="color: #ffa07a;">"</span>

<span style="color: #ff4500;">## </span><span style="color: #ff4500;">build a basic Ubuntu system in the chroot jail</span>
sudo debootstrap --variant=buildd --arch i386 natty /home/my.username/chroot-R32 http://ubuntu.cs.utah.edu/ubuntu/ <span style="color: #ff4500;">## </span><span style="color: #ff4500;">pick a mirror from https://launchpad.net/ubuntu/+archivemirrors</span>

<span style="color: #ff4500;">## </span><span style="color: #ff4500;">copy my source locations for apt</span>
sudo cp /etc/apt/sources.list /var/chroot/etc/apt/sources.list <span style="color: #ff4500;">## </span><span style="color: #ff4500;">edit this new file if to reflect only the needed source</span>

<span style="color: #ff4500;">### </span><span style="color: #ff4500;">do following steps whenever you need to access 32 bit R</span>
<span style="color: #ff4500;">## </span><span style="color: #ff4500;">access to proc and dns</span>
sudo mount -o bind /proc /home/my.username/chroot-R32/proc
sudo cp /etc/resolv.conf /home/my.username/chroot-R32/etc/resolv.conf
<span style="color: #ff4500;">## </span><span style="color: #ff4500;">go into jail; do this whenever you want</span>
sudo chroot /home/my.username/chroot-R32
dpkg-architecture <span style="color: #ff4500;">## </span><span style="color: #ff4500;">make sure system is i386</span>
<span style="color: #ff4500;">### </span><span style="color: #ff4500;">now the root / location should reflect the jail</span>

<span style="color: #ff4500;">### </span><span style="color: #ff4500;">following happens in jail</span>
<span style="color: #ff4500;">## </span><span style="color: #ff4500;">tools needed to build R</span>
apt-get install gcc g++ gfortran libreadline-dev libx11-dev xorg-dev
<span style="color: #ff4500;">## </span><span style="color: #ff4500;">get svn to get latest r source code</span>
apt-get install git-core subversion

<span style="color: #ff4500;">## </span><span style="color: #ff4500;">compile 32 bit R</span>
<span style="color: #b0c4de;">cd</span> home/
mkdir R32
<span style="color: #b0c4de;">cd</span> R32
svn checkout https://svn.r-project.org/R/trunk/ r-devel
<span style="color: #b0c4de;">cd</span> r-devel/
apt-get install rsync
./tools/rsync-recommended
./configure
make
make install
R
</pre>
<p> How big is my <code>/home/my.username/chroot-R32</code> folder?  It is at 791 MB after the above steps.  Let me know if you have suggestions for having both 32 bit or 64 concurrently on Linux.  I believe Windows and Mac ships and compiles both 32 bit and 64 bit versions of R.  I&#8217;m surprised this isn&#8217;t the case for Linux. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nguyenvq.com/2012/03/30/build-32-bit-r-on-64-bit-ubuntu-by-utilizing-chroot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)

Served from: blog.nguyenvq.com @ 2012-05-20 08:17:56 -->
