<?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>newthink.net &#187; Linux</title>
	<atom:link href="http://www.newthink.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.newthink.net</link>
	<description>Less Talk. More Do.</description>
	<lastBuildDate>Tue, 26 Jan 2010 18:28:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple Central Git Repository</title>
		<link>http://www.newthink.net/2009/09/20/simple-central-git-repository/</link>
		<comments>http://www.newthink.net/2009/09/20/simple-central-git-repository/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 23:09:29 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[dvcs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[source control]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.newthink.net/?p=154</guid>
		<description><![CDATA[I have a new project that I am starting, and instead of using the familiar subversion for source control, I figured this was a great time to check out Git. An added bonus is we are looking at switching over to it at work &#8211; two birds.
The first thing you need to do is install [...]]]></description>
			<content:encoded><![CDATA[<p>I have a new project that I am starting, and instead of using the familiar subversion for source control, I figured this was a great time to check out Git. An added bonus is we are looking at switching over to it at work &#8211; two birds.</p>
<div id="attachment_165" class="wp-caption aligncenter" style="width: 311px"><img class="size-full wp-image-165  " title="Distributed Source Control" src="http://www.newthink.net/wp-content/uploads/2009/09/drawing1.jpg" alt="" width="301" height="177" /><p class="wp-caption-text">Users can push and pull from other users or from a central repository. </p></div>
<p>The first thing you need to do is install git on both your clients and server. I am using Ubuntu, so you will have to figure out the equivalent commands and package names.</p>
<pre style="padding-left: 30px;">(client)$ sudo apt-get install git git-core

(server)$ sudo apt-get install git git-core</pre>
<p>Now that we have git on our server and client, we can start creating the git repository we want under source control.</p>
<p>The first thing we will do is create a git project. This can either be an existing code base you are already working on, or you can start a project from scratch. For the purposes of this example, we will start a new project.</p>
<pre style="padding-left: 30px;">(client)$ mkdir project
(client)$ cd project
(client)$ git init</pre>
<p>Git should reply with the message &#8216;<strong>Initialized empty Git repository in .git/</strong>&#8216;. Make a note of the .git directory created in our project &#8211; we will need it shortly.</p>
<p>I ran into my first issue here &#8211; the version of git I am using doesn&#8217;t seem to like to clone empty repositories. In order to allow me to clone (as you will see further down the page), we must have an initial commit.</p>
<pre style="padding-left: 30px;">(client)$ touch README
(client)$ git add README
(client)$ git commit -m "Initial commit." README</pre>
<p>We want this new project to be available on a central Git repository (centralized decentralized version control system &#8211; the irony is not lost on me). The easiest way is to just <strong>scp </strong>the .git directory to the server and place them in the directory you plan on containing your repositories. In my case, I created a <strong>git </strong>directory off of <strong>/</strong> on the server.</p>
<pre style="padding-left: 30px;">(server)$ sudo mkdir /git

(client)$ git clone --bare project project.git
(client)$ scp -r project.git user@server:/git/</pre>
<p>Essentially, we are finished adding the repository to the central server. We can now access the git repo from all clients so long as those users have ssh access to the central server. By default, we can access the repo from the clients using the ssh interface.</p>
<pre style="padding-left: 30px;">(client)$ git pull user@server:/git/project.git master</pre>
<p>And we can push changes to the repo in a similar fashion.</p>
<pre style="padding-left: 30px;">(client)$ git push user@server:/git/project.git master</pre>
<p>This is about as simple a set up as you can have. The Git server is really quite dumb. The real magic happens on the client side (which is left for another post when I have done a bit more research).</p>
<p>By default, this git server is private. Only users that have shell access to the server have access to push and pull changes. Push access requires private access, but for projects which you want public access, you can set up a <a href="http://www.kernel.org/pub/software/scm/git/docs/git-daemon.html">git-daemon</a> to serve git clone requests from the public. Rather than run it as a persistent process, you can quite simply tie it into <strong>xinetd </strong>with this simple configuration (remember, I am using Ubuntu).</p>
<pre style="padding-left: 30px;">(server)$ touch /git/project.git/git-daemon-export-ok
(server)$ sudo apt-get install xinetd
(server)$ sudo vi /etc/xinetd.d/git</pre>
<pre style="padding-left: 60px;">service git
{
    disable = no
    type = UNLISTED
    port = 9418
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/bin/git-daemon
    server_args = --inetd --export-all --base-path=/git
}</pre>
<pre style="padding-left: 30px;">(server)$ sudo /etc/init.d/xinetd restart</pre>
<p>This now gives us a public git repository url we can distribute to others.</p>
<pre style="padding-left: 30px;">(client)$ git clone git://server/project.git</pre>
<p>Just remember that you still need to push changes to the repo via ssh.</p>
<h2><strong>UPDATE</strong></h2>
<p>Talked to one of the guys in #git on irc.freenode.net and he informed me that the usual practice is to create the git repo on the central server first, then clone it to the client and push changes from the client.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2009/09/20/simple-central-git-repository/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>fcgi and mod_fcgid on CentOS4</title>
		<link>http://www.newthink.net/2008/03/09/fcgi-and-mod_fcgid-on-centos4/</link>
		<comments>http://www.newthink.net/2008/03/09/fcgi-and-mod_fcgid-on-centos4/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 00:27:25 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[RPM]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2008/03/09/fcgi-and-mod_fcgid-on-centos4/</guid>
		<description><![CDATA[I decided recently that I wanted to be able to run Ruby on Rails applications from my webserver. For those who don&#8217;t know me, RPM database integrity is a huge issue for me (I do not just install from source on my server!).
Since I had some time this weekend, I decided it was about time [...]]]></description>
			<content:encoded><![CDATA[<p>I decided recently that I wanted to be able to run Ruby on Rails applications from my webserver. For those who don&#8217;t know me, RPM database integrity is a huge issue for me (I do not just install from source on my server!).</p>
<p>Since I had some time this weekend, I decided it was about time I rolled some RPM&#8217;s so I could run Rails. Of course, it being over two years since I was last rolling RPM&#8217;s for work at Pason, it took me a bit to get back in the swing of things.</p>
<p>I followed the <a href="http://wiki.rubyonrails.org/rails/pages/Rails+on+CentOS+4.6+with+Apache+and+FastCGI+Simply">guide</a> found via the Ruby on Rails wiki, and modified it a bit for my server. The two main pieces of software that needed RPM&#8217;s were fastCGI and mod_fcgid (slightly different than mod_fastcgid).</p>
<p>Below you can download the RPM&#8217;s and the SRPM&#8217;s though I will be the first to acknowledge that I cheated a bit. I should have modified the Makefile on each of these programs to make use of an install_dir directive, but since I was building on a clean CentOS4.6 vmware OS, I decided not to go through the hassle. If someone really wants to do it properly, have at it &#8211; that&#8217;s what SRPMS are for.</p>
<p><strong>RPMS:</strong><br />
<a href="http://www.newthink.net/files/mod_fcgid-1.09-1.i386.rpm">mod_fcgid-1.09-1.i386.rpm</a><br />
<a href="http://www.newthink.net/files/fcgi-2.4.0-1.i386.rpm">fcgi-2.4.0-1.i386.rpm</a></p>
<p><strong>SRPMS:</strong><br />
<a href="http://www.newthink.net/files/mod_fcgid-1.09-1.src.rpm">mod_fcgid-1.09-1.src.rpm</a><br />
<a href="http://www.newthink.net/files/fcgi-2.4.0-1.src.rpm">fcgi-2.4.0-1.src.rpm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2008/03/09/fcgi-and-mod_fcgid-on-centos4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Subversion From xinetd</title>
		<link>http://www.newthink.net/2007/11/29/running-subversion-from-xinetd/</link>
		<comments>http://www.newthink.net/2007/11/29/running-subversion-from-xinetd/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 21:45:34 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2007/11/29/running-subversion-from-xinetd/</guid>
		<description><![CDATA[Now that we have Subversion installed on our server, we really need some way to have it always available. We could run subversion in daemon mode but we would have to write init.d scripts which can get rather complex (especially if you are writing one properly, and not just hacking one together).
Instead, we will add [...]]]></description>
			<content:encoded><![CDATA[<p>Now that we have Subversion installed on our server, we really need some way to have it always available. We could run subversion in daemon mode but we would have to write init.d scripts which can get rather complex (especially if you are writing one properly, and not just hacking one together).</p>
<p>Instead, we will add subversion to xinetd. The benefit of this is that subversion is only running when we need access to the repository rather than running all the time. By default, subversion is not set up in xinetd, so the following is how I set it up:</p>
<p>First make sure that xinetd is installed.<br />
<code><br />
# yum install xinetd<br />
</code><br />
Next we want to add the following to our /etc/xinetd.d/svnserve<br />
<code><br />
# default: off<br />
# description: svnserve is the server part of Subversion.<br />
service svn<br />
{<br />
&nbsp;&nbsp;disable	= no<br />
&nbsp;&nbsp;port	= 3690<br />
&nbsp;&nbsp;socket_type   = stream<br />
&nbsp;&nbsp;protocol      = tcp<br />
&nbsp;&nbsp;wait          = no<br />
&nbsp;&nbsp;user          = root<br />
&nbsp;&nbsp;server        = /usr/bin/svnserve<br />
&nbsp;&nbsp;server_args   = -i -r /svn<br />
}<br />
</code><br />
Finally, lets restart xinetd:<br />
<code><br />
/etc/init.d/xinetd restart<br />
</code><br />
Now xinetd will start the subversion repository server every time a subversion request is made.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2007/11/29/running-subversion-from-xinetd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Up Subversion On Fedora 8</title>
		<link>http://www.newthink.net/2007/11/28/setting-up-subversion-on-fedora-8/</link>
		<comments>http://www.newthink.net/2007/11/28/setting-up-subversion-on-fedora-8/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 22:14:59 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2007/11/28/setting-up-subversion-on-fedora-8/</guid>
		<description><![CDATA[After fighting with the corporate firewall (ssh tunnels were not successfully able to navigate to a SVN repo on a shared host) I decided I should set subversion up on my home server. Since I am a little paranoid about throwing caution to the wind with regard to server changes, I decided to set it [...]]]></description>
			<content:encoded><![CDATA[<p>After fighting with the corporate firewall (ssh tunnels were not successfully able to navigate to a SVN repo on a shared host) I decided I should set subversion up on my home server. Since I am a little paranoid about throwing caution to the wind with regard to server changes, I decided to set it up on my Fedora 8 vmware partition.</p>
<p>Here was my process.<br />
<code><br />
# yum install subversion<br />
</code><br />
Ok, that was pretty easy. I now have subversion installed on my system; both from a client and user&#8217;s perspective. Next I need to create a subversion repository location on my disk (/svn can be replaced with any location on your server).<br />
<code><br />
# svnadmin create /svn<br />
</code><br />
In /svn/conf/passwd add the following (it is in plaintext, but I am sure there is an encrypted solution):<br />
<code><br />
[users]<br />
achristopher = <em>some secret, yet plaintext password</em><br />
</code><br />
In the /svn/conf/svnserve.conf, you should set the following:<br />
<code><br />
[general]<br />
anon-access = read<br />
auth-access = write</p>
<p>password-db = passwd</p>
<p>realm = Test Repo<br />
</code><br />
There, our subversion repository has been set up. Now all we have to do is start the subversion daemon.<br />
<code><br />
# svnserv -r /svn -d<br />
</code><br />
We can test the subversion repo:<br />
<code><br />
# mkdir /tmp/test</p>
<p># svn import /tmp/test svn://localhost/svn/test -m "Initial creation."<br />
Committed revision 1.</p>
<p># svnlook tree /svn<br />
/<br />
 svn/<br />
  test/<br />
</code><br />
We have just added a directory to our subversion repository. Now lets checkout this project, and get to work:<br />
<code><br />
# rm -Rf /tmp/test<br />
# svn checkout svn://localhost/svn/test<br />
Checked out revision 1.<br />
</code></p>
<p>I cheated a little there, because I had entered my password before I created this posting, so you can expect to see something like the following:<br />
<code><br />
Authentication realm: <svn ://localhost:3690> Test Repo<br />
Password for 'achristopher':<br />
</svn></code><br />
Just enter your password (the one entered in plain text above) and continue working.</p>
<p><strong>To follow: How to set subversion to work with xinetd (it isnt that exciting, but definitely new post worthy).</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2007/11/28/setting-up-subversion-on-fedora-8/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SMARTHOST Authentication With Sendmail</title>
		<link>http://www.newthink.net/2007/05/18/smarthost-authentication-with-sendmail/</link>
		<comments>http://www.newthink.net/2007/05/18/smarthost-authentication-with-sendmail/#comments</comments>
		<pubDate>Fri, 18 May 2007 13:10:15 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[SMTP]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2007/05/18/smarthost-authentication-with-sendmail/</guid>
		<description><![CDATA[Rogers, one of Canada&#8217;s biggest ISP&#8217;s has this nasty habit of making life difficult for it&#8217;s customers. First they throttle BitTorrent traffic, and now in an attempt to curb spam, they block all outbound connections from port 25.
While this may not seem like a huge deal to most users, what this means is that you [...]]]></description>
			<content:encoded><![CDATA[<p>Rogers, one of Canada&#8217;s biggest ISP&#8217;s has this nasty habit of making life difficult for it&#8217;s customers. First they throttle BitTorrent traffic, and now in an attempt to curb spam, they block all outbound connections from port 25.</p>
<p>While this may not seem like a huge deal to most users, what this means is that you can&#8217;t connect to any other mail server when attempting to send emails because Rogers has blocked access. Jenna can&#8217;t send emails using her McMaster email from a Rogers account.</p>
<p>When I initially looked at setting up Internet, this was the first question I asked Rogers. They assured me that traffic shaping was the only limitation they put on the account. The customer service agent assured me that their literature even mentions this. Their literature is wrong.</p>
<p>As a way around this problem, you are going to want to set up a SMARTHOST on a linux box within the home network which is attached to the Rogers connection.</p>
<p>I did some testing and determined that Rogers doesn&#8217;t block all traffic over port 25, but only traffic that isn&#8217;t going to a Rogers controlled mail server.</p>
<p><code><br />
9:44 ash@galactica:[~]&gt; telnet smtp.broadband.rogers.com 25<br />
Trying 206.190.36.18...<br />
Connected to smtp.broadband.rogers.com (206.190.36.18).<br />
Escape character is '^]'.<br />
220 smtp107.rog.mail.re2.yahoo.com ESMTP<br />
</code></p>
<p>What we can do now, is set up a SMARTHOST in sendmail to basically forward emails from the server to Rogers SMTP server, then on to it&#8217;s destination. The following assumes you are the <em>root</em> user.</p>
<p>In your /etc/mail/sendmail.mc file, we need to add the following:<br />
<code><br />
define(`SMART_HOST',`smtp.broadband.rogers.com')<br />
</code></p>
<p>This defines what server we are going to use as a SMARTHOST. The other problem we are going to run into is that unlike other ISP&#8217;s which allow you to send via the SMARTHOST based on what your domain is (basically if you are connected on an ISP&#8217;s network, you can send using their server) Rogers requires that users authenticate.</p>
<p>To do this, we need to add the following to the /etc/mail/access file:</p>
<p><code><br />
AuthInfo:smtp.broadband.rogers.com "U:&lt;username&gt;" "P:&lt;password&gt;" "M:PLAIN"<br />
</code></p>
<p>I then changed the permissions to the file since I had my plaintext password in it:</p>
<p><code>chmod 660 /etc/mail/access</code></p>
<p>Next, we will regenerate the sendmail.cf and access.db files.</p>
<p><code><br />
m4 /etc/mail/sendmail.mc &gt; /etc.mail/sendmail.cf<br />
makemap hash /etc/mail/access &lt; /etc/mail/access<br />
</code></p>
<p>Now, restart sendmail, and you should be ready to go.</p>
<p>What you can do now, is set up all of your mail clients to point to the linux server as your outgoing mail server and it will forward all of your emails to Rogers and then on to it&#8217;s destination.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2007/05/18/smarthost-authentication-with-sendmail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Converting TV Shows To Play On Your iPod In Linux</title>
		<link>http://www.newthink.net/2007/03/02/converting-tv-shows-to-play-on-your-ipod-in-linux/</link>
		<comments>http://www.newthink.net/2007/03/02/converting-tv-shows-to-play-on-your-ipod-in-linux/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 20:30:40 +0000</pubDate>
		<dc:creator>Ash Christopher</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://newthink.net/blog/2007/03/02/converting-tv-shows-to-play-on-your-ipod-in-linux/</guid>
		<description><![CDATA[There are numerous Windows programs out there to convert video for use in your mobile devices. The problem however, is that unless you have a new dual-core machine your PC is more or less unusable until the conversion is complete.
Now, I know not everyone has a Linux machine just lying around, but I do, and [...]]]></description>
			<content:encoded><![CDATA[<p>There are numerous Windows programs out there to convert video for use in your mobile devices. The problem however, is that unless you have a new dual-core machine your PC is more or less unusable until the conversion is complete.</p>
<p>Now, I know not everyone has a Linux machine just lying around, but I do, and maybe in the future it might be enough to convince you to build your own file-server for your home (for media perhaps?).</p>
<p>Before starting, you need to make sure you have the <strong>ffmpeg</strong> binary installed on your Linux box. As of this posting, I have ffmpeg-0.4.9-0.3.20051207.2.el4.rf installed on my CentOS4 machine. I will leave it as an exercise to you to figure out how to install it if you don&#8217;t have it.</p>
<blockquote><p>ash@galactica:[/tmp]> ffmpeg -vcodec xvid -b 500 -qmin 1 -qmax 7 -bufsize 4096 -g 300 -acodec aac -ab 96 -i doctor.who.102.the.end.of.the.world.avi -s 320&#215;240 -aspect 16:9 doctor.who.102.the.end.of.the.world.mp4</p></blockquote>
<p>Here is a run down of what the switches mean and how they affect your converted video:</p>
<blockquote><p><em>-vcodec</em> &#8212; this is the video codec you want the converted video to use. For iPod use, I suggest xvid. It is basically the same codec as mpeg4 (except open source) and you don&#8217;t run into buffer-underflow problems as often.</p>
<p><em>-b</em> &#8212; this is the video bitrate in kbit/s (higher bitrate means higher quality).</p>
<p><em>-qmin &#038; -qmax</em> &#8212; this controls the quality when dealing with VBR (variable bit rate). Basically a range to keep the quality between.</p>
<p><em>-acodec</em> &#8212; the audio codec to use. When converting to iPod video, this must be aac since that is the only format the iPod supports.</p>
<p><em>-ab</em> &#8212; this is the audio bitrate in kbit/s. 96 kbit/s offers decent audio quality for iPod use.</p>
<p><em>-i</em> &#8212; input file (obviously?).</p>
<p><em>-s</em> &#8212; size of the output video. The iPod supports 320&#215;240, 480&#215;480 and with the newest firmware, now supports 640&#215;480. If you want to retain the source aspect ratio, make sure you calculate the new size to follow the sources aspect ratio.</p>
<p><em>-aspect</em> &#8212; aspect ratio for the converted video. This is especially important if your input video is 16:9 and you want to keep the ratio and replace the extra space with black bars. The aspect ratio is usually 4:3 or 16:9.</p></blockquote>
<p>Now,after you have run this command, your video should begin to be converted. The time it takes to convert depends greatly on the hardware being used. I often offload this task to a P-III 800 machine, and it seems to be able to encode a video in the same time it would take to watch it. Again, the nice thing about offloading this task is that you can now use your main system for other fun tasks.</p>
<p>Might I suggest maybe using your main machine to whip up a quick script to encode a list of videos, perhaps at night when spare cpu cycles are pleniful? The nice thing about batching up video conversions like this, is that it is also compatible with mac&#8217;s running OSX. Sure, you could use the mac-GUI program to do it, but that is going to require a whole lot more human interaction to convert 10 shows.</p>
<p>For mor information of supported codecs, see the <a href="http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html#SEC24">FFMPEG Documentation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.newthink.net/2007/03/02/converting-tv-shows-to-play-on-your-ipod-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
