<?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>Midnight Oil &#187; System Admin</title>
	<atom:link href="http://tech.rehaniftikhar.com/category/system-admin/feed" rel="self" type="application/rss+xml" />
	<link>http://tech.rehaniftikhar.com</link>
	<description>Losing sleep on Open Source Software</description>
	<lastBuildDate>Tue, 03 Nov 2009 18:24:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Trac-BZR: installing on Ubuntu/Debian</title>
		<link>http://tech.rehaniftikhar.com/ubuntu/trac-bzr-installing-on-ubuntudebian</link>
		<comments>http://tech.rehaniftikhar.com/ubuntu/trac-bzr-installing-on-ubuntudebian#comments</comments>
		<pubDate>Tue, 15 Sep 2009 19:31:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Admin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://tech.rehaniftikhar.com/?p=30</guid>
		<description><![CDATA[A project I&#8217;m working on recently switched from Subversion (SVN) to Bazaar (BZR) for its Version Control System (VCS). Of the many things we didn&#8217;t like about Subversion (merging, line-ending conflicts, etc..), there were some things we&#8217;d grown to like, primarily the mature 3rd party ecosystem and its bread-winner Trac.Thankfully there are projects to extend [...]]]></description>
			<content:encoded><![CDATA[<p>A project I&#8217;m working on recently switched from <a href="http://subversion.tigris.org/" target="_blank">Subversion</a> (SVN) to <a href="http://bazaar-vcs.org/" target="_blank">Bazaar</a> (BZR) for its <a href="http://en.wikipedia.org/wiki/Revision_control" target="_blank">Version Control System</a> (VCS). Of the many things we didn&#8217;t like about Subversion (merging, line-ending conflicts, etc..), there were some things we&#8217;d grown to like, primarily the mature 3rd party ecosystem and its bread-winner <a href="http://trac.edgewall.org/">Trac</a>.Thankfully there are projects to extend Trac&#8217;s reach to other VCSs.</p>
<p>Of interest to me was <a href="https://launchpad.net/trac-bzr" target="_blank">trac-bzr</a>. Since Bazzar has the power of Canonical behind it, a cursory glance at the &#8220;universe&#8221; repository shows a package named &#8220;trac-bzr&#8221;. However a closer look reveals that this package is quite outdated:</p>
<pre>&gt;<strong>apt-cache show trac-bzr</strong>
Package: trac-bzr
Priority: optional
Section: universe/python
Installed-Size: 156
Maintainer: Ubuntu MOTU Developers &lt;ubuntu-motu@lists.ubuntu.com&gt;
Original-Maintainer: Chris Lamb &lt;chris@chris-lamb.co.uk&gt;
Architecture: all
Version: 0.2+<span style="color: #800000;"><strong>bzr31</strong></span>-3
...</pre>
<p>This seemed like a bad idea, seeing as the main branch was already at r69.</p>
<p>Here are the instructions on installing the latest version:</p>
<p>1. Make sure you have bzr installed</p>
<pre>sudo apt-get install bzr</pre>
<p>2. Get the latest version of trac</p>
<pre>sudo apt-get install trac</pre>
<p>3. Get the latest version of trac-bzr, and put it in a revisioned directory.</p>
<pre>bzr export ./trac-bzr-r`bzr revno lp:trac-bzr` lp:trac-bzr</pre>
<p>4. Install the plugin</p>
<pre>cd trac-bzr-r*
python setup.py install</pre>
<p>5. Configure trac to use the plugin as described in the trac-bzr README</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.rehaniftikhar.com/ubuntu/trac-bzr-installing-on-ubuntudebian/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svn2bzr and symlinks</title>
		<link>http://tech.rehaniftikhar.com/system-admin/svn2bzr-and-symlinks</link>
		<comments>http://tech.rehaniftikhar.com/system-admin/svn2bzr-and-symlinks#comments</comments>
		<pubDate>Wed, 26 Aug 2009 20:34:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://tech.rehaniftikhar.com/system-admin/svn2bzr-and-symlinks</guid>
		<description><![CDATA[I used svn2bzr to import an Subversion repository (via dump file) to a Bazaar repository. My code has some places where symlinks are used. After the import, the symlinks were converted from links to files with the contents:
link ../path/to/link
I ran this snippet to find all locations of this event so I could fix them:

find . [...]]]></description>
			<content:encoded><![CDATA[<p>I used <a href="https://launchpad.net/svn2bzr" target="_blank">svn2bzr</a> to import an Subversion repository (via dump file) to a Bazaar repository. My code has some places where symlinks are used. After the import, the symlinks were converted from links to files with the contents:</p>
<pre>link ../path/to/link</pre>
<p>I ran this snippet to find all locations of this event so I could fix them:<br />
<code><br />
find . -size 1k -exec grep -E "^link" '{}' \; -print</code></p>
<p>Hope that helps.</p>
<p><strong>Update:</strong> Wrote a script that will remove the old links and replace them for you.</p>
<pre>
#!/bin/bash

if [ $# -eq 1 ]
then
DIRNAME=$1
else
DIRNAME=`pwd`
fi

broken_links=`find $DIRNAME -size 1k -exec grep -Es "^link" '{}' \; -print \
| xargs -l2 echo -e "" | awk '{print $2 " " $3}'`

echo -e "$broken_links" | while read line; do
link=`echo "$line" | cut -d ' ' -f2`;
target=`echo "$line" | cut -d ' ' -f1`;
relative_dir=`dirname $link`

cd $relative_dir; rm $link; ln -s $target $link
done</pre>
]]></content:encoded>
			<wfw:commentRss>http://tech.rehaniftikhar.com/system-admin/svn2bzr-and-symlinks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding Out Your External IP Address from the Shell</title>
		<link>http://tech.rehaniftikhar.com/system-admin/finding-out-your-external-ip-address-from-the-shell</link>
		<comments>http://tech.rehaniftikhar.com/system-admin/finding-out-your-external-ip-address-from-the-shell#comments</comments>
		<pubDate>Sat, 11 Oct 2008 23:45:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://tech.rehaniftikhar.com/system-admin/finding-out-your-external-ip-address-from-the-shell</guid>
		<description><![CDATA[I&#8217;m writing a script that needs to know the external IP address of the current machine (ifconfig only gives the local network address)

wget -q -O - http://checkip.dyndns.org &#124; html2text \
&#124; sed s/Current\ IP\ Address\:\ //

What this does is:

hit http://checkip.dyndns.org, silencing wget&#8217;s output and redirecting the downloaded file to stdout
parse the html page as text
get rid [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing a script that needs to know the external IP address of the current machine (<strong>ifconfig</strong> only gives the <em>local</em> network address)<br />
<code><br />
wget -q -O - http://checkip.dyndns.org | html2text \<br />
| sed s/Current\ IP\ Address\:\ //<br />
</code></p>
<p>What this does is:</p>
<ol>
<li>hit http://checkip.dyndns.org, silencing wget&#8217;s output and redirecting the downloaded file to <strong>stdout</strong></li>
<li>parse the html page as text</li>
<li>get rid of the cruft (I was thinking about using a complex regex here, but the IP address prefix seems less of a dependency concern than the actual dyndns service)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tech.rehaniftikhar.com/system-admin/finding-out-your-external-ip-address-from-the-shell/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The closest thing to piping a password to SSH</title>
		<link>http://tech.rehaniftikhar.com/ubuntu/the-closest-thing-to-piping-a-password-to-ssh</link>
		<comments>http://tech.rehaniftikhar.com/ubuntu/the-closest-thing-to-piping-a-password-to-ssh#comments</comments>
		<pubDate>Tue, 26 Feb 2008 18:10:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[System Admin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://tech.rehaniftikhar.com/?p=6</guid>
		<description><![CDATA[There are a few cases in life where you want to connect to SSH without having to type in the password by hand. Most of the times you can use ssh-keygen and use private (or public) keys.
However, for the 0.5% of the time where you cannot use keys, you can use a little program called [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few cases in life where you want to connect to SSH <strong>without</strong> having to type in the password by hand. Most of the times you can use ssh-keygen and use private (or public) keys.</p>
<p>However, for the 0.5% of the time where you cannot use keys, you can use a little program called <a href="http://expect.nist.gov/">expect</a>.</p>
<p>BTW, this does not, and should NEVER work:<br />
<code>echo 'mypassword' | ssh user@server</code></p>
<p>Installing Expect:<br />
<code>sudo apt-get install expect</code></p>
<p>Create the expect script:<br />
<code>nano connect.sh</code></p>
<p>Paste the basic code:<br />
<code><br />
#!/usr/bin/expect<br />
set timeout 60<br />
spawn ssh -l username server<br />
expect "password: $"<br />
send "password\n"<br />
expect "$ $"<br />
interact<br />
</code></p>
<p><em>Replace &#8216;username&#8217; and &#8217;server&#8217; on line 3 and &#8216;password&#8217; on line 5.</em><br />
<em>The second to last line, &#8216;expect &#8220;$ $&#8221;&#8216; is for a bash shell. Replace the first &#8216;$&#8217; with whatever your prompt is.</em></p>
<p>Save ( ctrl + o ) and Exit ( ctrl + x )<br />
Make the script executable<br />
<code>chmod +x connect.sh</code></p>
<p><a href="http://modp.com/wiki/sshpasswords">Credits</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tech.rehaniftikhar.com/ubuntu/the-closest-thing-to-piping-a-password-to-ssh/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
