<?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>ubuntu &#8211; Nigel Babu</title>
	<atom:link href="https://nigelb.me/category/ubuntu/feed" rel="self" type="application/rss+xml" />
	<link>https://nigelb.me</link>
	<description>Professional Yak Shaver</description>
	<lastBuildDate>Wed, 05 Mar 2014 03:33:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>

<image>
	<url>https://nigelb.me/wp-content/uploads/2025/03/favicon-150x150.jpg</url>
	<title>ubuntu &#8211; Nigel Babu</title>
	<link>https://nigelb.me</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">151096231</site>	<item>
		<title>Goodbye Ubuntu</title>
		<link>https://nigelb.me/2014-03-05-goodbye-ubuntu</link>
					<comments>https://nigelb.me/2014-03-05-goodbye-ubuntu#respond</comments>
		
		<dc:creator><![CDATA[nigelb]]></dc:creator>
		<pubDate>Wed, 05 Mar 2014 03:33:04 +0000</pubDate>
				<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://nigelb.me/2014-03-05-goodbye-ubuntu</guid>

					<description><![CDATA[<p>On March 8th, my Ubuntu membersip will expire. I&#8217;ve been getting email notifications for a few days and I&#8217;ve decided not to renew my membership.</p>
]]></description>
										<content:encoded><![CDATA[<p>On March 8th, my Ubuntu membersip will expire. I’ve been getting email notifications for a few days and I’ve decided not to renew my membership. Ubuntu introduced me to open source. Thank you for the great operating system and the sense of community that I’ve had for a few years. I’ve made a lot of friends and I’ve had a lot of mentors who’ve helped me become a better person.</p>
<div style="text-align: center; padding: 10px 0;"><img decoding="async" src="https://i0.wp.com/nigelb.me/img/uds-o-with-hggdh.jpg?w=640&#038;ssl=1" alt="With hggdh at UDS-0" data-recalc-dims="1" /> </div>
<p>I won’t disappear entirely – I will still be in a few IRC channels and help in whatever little way I can.</p>
<p>Thank you everyone for the spectacular few years.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nigelb.me/2014-03-05-goodbye-ubuntu/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">909</post-id>	</item>
		<item>
		<title>Quick Tip: Ansible Debugging</title>
		<link>https://nigelb.me/2014-01-07-quick-tip-ansible-debugging</link>
					<comments>https://nigelb.me/2014-01-07-quick-tip-ansible-debugging#respond</comments>
		
		<dc:creator><![CDATA[nigelb]]></dc:creator>
		<pubDate>Tue, 07 Jan 2014 16:15:02 +0000</pubDate>
				<category><![CDATA[ansible]]></category>
		<category><![CDATA[quick-tip]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://nigelb.me/2014-01-07-quick-tip-ansible-debugging</guid>

					<description><![CDATA[Today I learned something about Ansible debugging from benno on #ansible. Occasionally, commands can get stuck, especially if it’s waiting for input. You can’t fix this until you recognize what’s going on and see the prompt. In other words, you want to see the stdout and stderr on the target machine. Here’s what you do: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today I learned something about Ansible debugging from <code>benno</code> on #ansible. Occasionally, commands can get stuck, especially if it’s waiting for input. You can’t fix this until you recognize what’s going on and see the prompt. In other words, you want to see the stdout and stderr on the target machine. Here’s what you do:</p>
<ul>
<li>Run ansible with <code>-vvv</code>.</li>
<li>Login to the remote host where the command is being executed.</li>
<li>Find the ansible process executing the command and kill them.</li>
<li>The stdout and stderr should be printed to the console where ansible was running.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://nigelb.me/2014-01-07-quick-tip-ansible-debugging/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">913</post-id>	</item>
		<item>
		<title>CIS Anniversary and Encyclopedia of Indian Cinema</title>
		<link>https://nigelb.me/2013-05-23-cis-anniversary-and-encyclopedia-of-indian-cinema</link>
					<comments>https://nigelb.me/2013-05-23-cis-anniversary-and-encyclopedia-of-indian-cinema#respond</comments>
		
		<dc:creator><![CDATA[nigelb]]></dc:creator>
		<pubDate>Thu, 23 May 2013 18:35:00 +0000</pubDate>
				<category><![CDATA[events]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://nigelb.me/2013-05-23-cis-anniversary-and-encyclopedia-of-indian-cinema</guid>

					<description><![CDATA[<p>Centre for Internet and Society celebrated their 5-year anniversary with an exhibition at their Bangalore and Delhi offices and&#8230;</p>
]]></description>
										<content:encoded><![CDATA[<p>Centre for Internet and Society <a href="http://cis-india.org/internet-governance/events/celebrating-5-years-of-cis">celebrated</a> their 5-year anniversary with an exhibition at their Bangalore and Delhi offices and a series of talks in Bangalore. I was there on Tuesday and managed to spend some time at the exhibition and attend the talks.</p>
<p>The exhibition showed off some of the work that CIS has been doing and the work of several independent artists. The bits that are particularly in my memory is Tara Kelton’s work as well as Sharath’s work.</p>
<p>Later in the day, Lawrence Liang talked about the Encyclopedia of Indian cinema. It was a very interesting talk, especially for me since it encompasses open data, open source software, and copyright issues! A convergence of a lot of my interests <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Lawrence talked about what they’ve built and the problems they’ve faced and how internet as a medium for a film encyclopedia is very powerful, but is limited by the legal issues surrounding copyright laws.</p>
<p><a href="http://indiancine.ma/">Indian Cinema</a></p>
<p><a href="https://wiki.indiancine.ma/">Indian Cinema Wiki</a></p>
<p>On that note, I’ll close with this video about copyright.</p>
<p>  <iframe width="560" height="315" src="http://www.youtube.com/embed/tk862BbjWx4" frameborder="0" allowfullscreen="1">&nbsp;</iframe>  </p>
<p>I know Disney is great, but I’m not sure I like them as much after this video.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nigelb.me/2013-05-23-cis-anniversary-and-encyclopedia-of-indian-cinema/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">935</post-id>	</item>
		<item>
		<title>The Migration &#8211; Part I: Database</title>
		<link>https://nigelb.me/2012-10-21-the-migration-part-i-database</link>
					<comments>https://nigelb.me/2012-10-21-the-migration-part-i-database#respond</comments>
		
		<dc:creator><![CDATA[nigelb]]></dc:creator>
		<pubDate>Sun, 21 Oct 2012 09:05:01 +0000</pubDate>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://nigelb.me/2012-10-21-the-migration-part-i-database</guid>

					<description><![CDATA[<p>I recently had to migrate a bunch of databases from MySQL to PostgreSQL. This is the process I&#8230;</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a series of posts on migration from Apache and MySQL to Nginx+uwsgi and PostgreSQL. In this post, I’ll be detailing the steps we took to migrate the database from MySQL to PostgreSQL, with as little downtime as possible. Please leave a comment if you have suggestions!</p>
<h3 id="one-time-pre-migration-steps">One-time Pre-migration Steps</h3>
<h4 id="utf-8">UTF-8</h4>
<p>The default encoding on PostgreSQL is SQL_ASCII and you probably want UTF-8. If you don’t know what you want, you want UTF-8 (trust me). The easiest way was to <a href="http://jacobian.org/writing/pg-encoding-ubuntu/">blow away the default cluster and re-create it</a> (Thanks jacobian!)</p>
<figure class="highlight">
<pre><code class="language-bash" data-lang="bash"><span></span>sudo pg_dropcluster --stop <span class="m">9</span>.1 main sudo pg_createcluster --start -e UTF-8 <span class="m">9</span>.1 main</code></pre>
</figure>
<h4 id="make-postgresql-listen-on-all-interfaces">Make PostgreSQL listen on all interfaces</h4>
<p>Edit <code>/etc/postgresql/9.1/main/postgresql.conf</code> and ensure PostgreSQL is listening on all interfaces.</p>
<figure class="highlight">
<pre><code class="language-text" data-lang="text"><span></span>listen_addresses = &#39;0.0.0.0&#39;</code></pre>
</figure>
<h4 id="allow-access-to-postgresql-from-the-old-server">Allow access to PostgreSQL from the old server</h4>
<p>Edit <code>/etc/postgresql/9.1/main/pg_hba.conf</code> and add an entry for the old server (where 123.123.123.123 is the IP address of the old server).</p>
<figure class="highlight">
<pre><code class="language-text" data-lang="text"><span></span>host    all             all             123.123.123.123/32       md5</code></pre>
</figure>
<h4 id="install-client-libraries-on-the-old-server">Install client libraries on the old server</h4>
<p>We use sqlalchemy for db access and I had to do <code>apt-get install python-psycopg2</code>.</p>
<h4 id="creating-users-and-databases">Creating Users and Databases</h4>
<p>Our process is to create a user for each app and have that app’s database be owned by this user, here’s a script that automated creating the user and database.</p>
<figure class="highlight">
<pre><code class="language-bash" data-lang="bash"><span></span><span class="ch">#!/bin/bash</span> sudo -u postgres createuser -d -R -S <span class="nv">$1</span> sudo -u postgres createdb <span class="nv">$1</span> -O <span class="nv">$1</span></code></pre>
</figure>
<div style="text-align: center; padding: 10px 0;"> <a href="http://www.flickr.com/photos/noodlefish/864841518/"> <img decoding="async" src="https://i0.wp.com/nigelb.me/img/migration.jpg?w=640&#038;ssl=1" alt="Migration.jpg by Noodlefish on Flickr" data-recalc-dims="1" /></a> </div>
<h3 id="the-move">The move</h3>
<h4 id="import-preparation">Import Preparation</h4>
<p>Create user and database on the new server with the script above. Remember to set a password for this new user.</p>
<h4 id="exporting">Exporting</h4>
<p>The most worrisome bit about the whole migration was exporting the data from MySQL and importing it into PostgreSQL. We used <a href="https://github.com/maxlapshin/mysql2postgres/">mysql2psql</a> and it didn’t give a lot of troubles except for the bit where floats got a little messed up. My personal recommendation is to not use <code>real</code>, but use <code>numeric(7,4)</code> with the accuracy adjusted for what you need (this particular definition is used for our lat/long definitions.</p>
<p>First, run <code>mysql2psql</code> on your command line, this will create the config file.</p>
<p>Now edit the <code>mysql2psql.yml</code> file and add your appropriate entries. Here’s what ours looked like</p>
<figure class="highlight">
<pre><code class="language-yaml" data-lang="yaml"><span></span><span class="l l-Scalar l-Scalar-Plain">mysql</span><span class="p p-Indicator">:</span>  <span class="l l-Scalar l-Scalar-Plain">hostname</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">localhost</span>  <span class="l l-Scalar l-Scalar-Plain">port</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">3306</span>  <span class="l l-Scalar l-Scalar-Plain">socket</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">/var/run/mysqld/mysqld.sock</span>  <span class="l l-Scalar l-Scalar-Plain">username</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">mysuperuser</span>  <span class="l l-Scalar l-Scalar-Plain">password</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">mypassword</span>  <span class="l l-Scalar l-Scalar-Plain">database</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">mydb</span>  <span class="l l-Scalar l-Scalar-Plain">destination</span><span class="p p-Indicator">:</span>  <span class="c1"># if file is given, output goes to file, else postgres</span>  <span class="l l-Scalar l-Scalar-Plain">file</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">mydb.sql</span>  <span class="l l-Scalar l-Scalar-Plain">postgres</span><span class="p p-Indicator">:</span>   <span class="l l-Scalar l-Scalar-Plain">hostname</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">localhost</span>   <span class="l l-Scalar l-Scalar-Plain">port</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">5432</span>   <span class="l l-Scalar l-Scalar-Plain">username</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">mysql2psql</span>   <span class="l l-Scalar l-Scalar-Plain">password</span><span class="p p-Indicator">:</span>   <span class="l l-Scalar l-Scalar-Plain">database</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">mysql2psql_test</span>  <span class="c1"># if tables is given, only the listed tables will be converted.  leave empty to convert all tables.</span> <span class="c1">#tables:</span> <span class="c1">#- table1</span> <span class="c1">#- table2</span> <span class="c1"># if exclude_tables is given, exclude the listed tables from the conversion.</span> <span class="c1">#exclude_tables:</span> <span class="c1">#- table3</span> <span class="c1">#- table4</span>   <span class="c1"># if supress_data is true, only the schema definition will be exported/migrated, and not the data</span> <span class="l l-Scalar l-Scalar-Plain">supress_data</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">false</span>  <span class="c1"># if supress_ddl is true, only the data will be exported/imported, and not the schema</span> <span class="l l-Scalar l-Scalar-Plain">supress_ddl</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">false</span>  <span class="c1"># if force_truncate is true, forces a table truncate before table loading</span> <span class="l l-Scalar l-Scalar-Plain">force_truncate</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">false</span></code></pre>
</figure>
<p>When you run <code>psql2mysql</code> again, it will export the database <code>mydb</code> into <code>mydb.sql</code>. Before we did that, we removed this particular site from /etc/apache2/sites-enabled and restarted apache. We didn’t want the sql file to go stale as soon as it was exported. This is where the downtime starts</p>
<h4 id="importing">Importing</h4>
<p>Copy the file over to the new server and import it into PostgreSQL with psql.</p>
<figure class="highlight">
<pre><code class="language-bash" data-lang="bash"><span></span>sudo -u mydb psql mydb &lt; mydb.sql</code></pre>
</figure>
<p>In retrospect, I should have just imported it directly with <code>mysql2psql</code>. I was initially hesitant because it involved creating a user that could access that machine from outside. But I later realized I needed it anyway.</p>
<h3 id="go-live">Go live!</h3>
<p>Now change the settings on the old server to use the postgres database as the backend, enable the site in Apache and you’re all set to serve this site from PostgreSQL!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://nigelb.me/2012-10-21-the-migration-part-i-database/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">859</post-id>	</item>
		<item>
		<title>Moving On</title>
		<link>https://nigelb.me/2012-09-17-moving-on</link>
					<comments>https://nigelb.me/2012-09-17-moving-on#respond</comments>
		
		<dc:creator><![CDATA[nigelb]]></dc:creator>
		<pubDate>Mon, 17 Sep 2012 15:00:00 +0000</pubDate>
				<category><![CDATA[mozilla]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://nigelb.me/2012-09-17-moving-on</guid>

					<description><![CDATA[<p>It&#8217;s been about 10 months since I&#8217;ve started working at HasGeek&#8230;</p>
]]></description>
										<content:encoded><![CDATA[<p>It’s been about 10 months since I’ve started working at <a href="http://hasgeek.com">HasGeek</a> and it’s been an amazing few months. I’ve been part of 4 amazing conferences, a workshop, and a bunch of  <a href="http://geekup.in">Geekups</a>. Among other things, I’ve <a href="http://github.com/hasgeek">written code</a>, <a href="http://rootconf.in">organized content</a>, and <a href="http://youtube.com/user/hasgeek">edited videos</a>. It’s probably the most intense job I’ve ever had.</p>
<div style="text-align: center; padding: 10px 0;"> <a href="http://www.flickr.com/photos/chumpolo/2425541572/"> <img decoding="async" src="https://i1.wp.com/nigelb.me/img/road.jpg?w=640&#038;ssl=1" alt="Bow Valley Parkway Ice Road by Matt Seppings on Flickr" data-recalc-dims="1" /></a> </div>
<p>When I joined HasGeek last year, I’d committed for a minimum of 6 months. After 10 months at HasGeek, I’m moving on. I’m very exicted to announce that starting Oct 2, I’ll be working for the <a href="http://okfn.org">Open Knowledge Foundation</a> a Data Wrangler and Web Developer! I’m very excited and looking forward to working with the amazing folks at OKFN. As <a href="https://twitter.com/sunil_abraham">Sunil</a> pointed out, I’m now in the non-profit sector <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://nigelb.me/2012-09-17-moving-on/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">860</post-id>	</item>
	</channel>
</rss>
