<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Brandon Checketts</title> <link>http://www.brandonchecketts.com</link> <description>Web Programming, Linux System Administation, and other geeky stuff</description> <lastBuildDate>Sun, 25 Jul 2010 00:50:58 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/BrandonChecketts" /><feedburner:info uri="brandonchecketts" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Quick PHP Script to Generate a Barcode</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/6jnwaRpaiEg/quick-php-script-to-generate-a-barcode</link> <comments>http://www.brandonchecketts.com/archives/quick-php-script-to-generate-a-barcode#comments</comments> <pubDate>Wed, 21 Jul 2010 04:41:48 +0000</pubDate> <dc:creator>Brandon</dc:creator> <guid isPermaLink="false">http://www.brandonchecketts.com/?p=470</guid> <description><![CDATA[This is a really quick script I came up with to generate a Code-39 Barcode.  Many thanks to
Matthew Welch who created the Free 3 of 9 Barcode Font.  PHP&#8217;s imagettftext function makes this pretty simple.
The $barcode_font referenced below is available from the link above &#8216;3 of 9&#8242; font.  The $plain_font is just [...]]]></description> <content:encoded><![CDATA[<p>This is a really quick script I came up with to generate a Code-39 Barcode.  Many thanks to<br
/> Matthew Welch who created the <a
href="http://www.barcodesinc.com/free-barcode-font/">Free 3 of 9 Barcode Font</a>.  PHP&#8217;s <a
href="http://php.net/imagettftext">imagettftext function</a> makes this pretty simple.</p><p>The $barcode_font referenced below is available from the link above &#8216;3 of 9&#8242; font.  The $plain_font is just a font file that I copied from /usr/share/fonts/default/Type1/ on a Linux box.</p><p>This script create a nice looking barcode with the text underneath it like this:</p><p><img
src="http://www.brandonchecketts.com/barcodes/barcode.php?number=1234567890" /></p><pre>
< ?php

$number = isset($_GET['number']) ? $_GET['number'] : '';

$barcode_font = dirname(__FILE__).'/fonts/FREE3OF9.TTF';
$plain_font   = dirname(__FILE__).'/fonts/plain.pfb';

$width = 200;
$height = 80;

$img = imagecreate($width, $height);

// First call to imagecolorallocate is the background color
$white = imagecolorallocate($img, 255, 255, 255);
$black = imagecolorallocate($img, 0, 0, 0);

// Reference for the imagettftext() function
// imagettftext($img, $fontsize, $angle, $xpos, $ypos, $color, $fontfile, $text);
imagettftext($img, 36, 0, 10, 50, $black, $barcode_font, $number);

imagettftext($img, 14, 0, 40, 70, $black, $plain_font, $number);

header('Content-type: image/png');

imagepng($img);
imagedestroy($img);

?>
</pre><img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/6jnwaRpaiEg" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/quick-php-script-to-generate-a-barcode/feed</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/quick-php-script-to-generate-a-barcode</feedburner:origLink></item> <item><title>UPS-PHP Patch to Log Requests and Responses</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/s-NSpdbuiz8/ups-php-patch-to-log-requests-and-responses</link> <comments>http://www.brandonchecketts.com/archives/ups-php-patch-to-log-requests-and-responses#comments</comments> <pubDate>Wed, 23 Jun 2010 01:39:19 +0000</pubDate> <dc:creator>Brandon</dc:creator> <guid isPermaLink="false">http://www.brandonchecketts.com/?p=468</guid> <description><![CDATA[UPS doesn&#8217;t seem to be too big of a fan of Perl or PHP.  They provide some powerful functionality through their API&#8217;s and their documentation is sufficient, but doesn&#8217;t contain examples of anything except for Visual Basic or Java.  Fortunately their is an open source project called UPS-PHP that aims to fill that [...]]]></description> <content:encoded><![CDATA[<p>UPS doesn&#8217;t seem to be too big of a fan of Perl or PHP.  They provide some powerful functionality through their API&#8217;s and their documentation is sufficient, but doesn&#8217;t contain examples of anything except for Visual Basic or Java.  Fortunately their is an open source project called <a
href="http://code.google.com/p/ups-php/">UPS-PHP</a> that aims to fill that gap by providing some classes for interacting with UPS&#8217;s APIs.  The UPS-PHP project seems to have lost steam though as the latest updates were over a year ago.</p><p>The latest version of the UPS shipping API requires the user to go through a process of creating test transactions, then voiding some transactions in a sandbox environment prior to allowing you access to the production environment.  You have to email them every request and response that you send and received for the test transactions as well as various images and HTML documents that were created from their responses.</p><p>I added some logging ability to the UPS-PHP class responsible for sending and receiving the responses.  A patch is available <a
href="http://www.brandonchecketts.com/downloads/ups.patch">here</a> if anybody else wants to try it.   You basically call the new methods setDebugDir() and setTransaction() on the &#8216;ups&#8217; object.  Those tell it which directory to log to, and which filename to use respectively.</p><p>Usage would look something like this:</p><pre>
    $debug_dir = "{$_SERVER['DOCUMENT_ROOT']}/upsdebug/".date('Y')."/".date('m');
    // make sure that $debugdir exists... Create it if necessary
    $upsConnect->setDebugDir($debug_dir);
    $upsConnect->setTransaction(time());
    $upsConnect->setTemplatePath('../../xml/');
    $upsConnect->setTestingMode(1); // Change this to 0 for production
    $upsVoid = new upsVoid($upsConnect);
    $upsVoid->buildRequestXML($ShipmentIdentificationNumber);
</pre><p>At this point your $debugdir would have two files in it.  One with the XML request and the other with the XML response, suitable for zipping up and sending to UPS for approval.</p> <img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/s-NSpdbuiz8" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/ups-php-patch-to-log-requests-and-responses/feed</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/ups-php-patch-to-log-requests-and-responses</feedburner:origLink></item> <item><title>PROCEDURE can’t return a result set in the given context</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/D0GJBK8vmIg/procedure-cant-return-a-result-set-in-the-given-context</link> <comments>http://www.brandonchecketts.com/archives/procedure-cant-return-a-result-set-in-the-given-context#comments</comments> <pubDate>Tue, 22 Jun 2010 18:48:27 +0000</pubDate> <dc:creator>Brandon</dc:creator> <guid isPermaLink="false">http://www.brandonchecketts.com/?p=462</guid> <description><![CDATA[I ran into a problem today when dealing with a very simple SQL Query.  The query simply calls a stored procedure on the MySQL server.  This is a trivial app, so I was using the very basic mysql_connect(), mysql_query() functions.   The result wasn&#8217;t being returned an mysql_error() was saying that the [...]]]></description> <content:encoded><![CDATA[<p>I ran into a problem today when dealing with a very simple SQL Query.  The query simply calls a stored procedure on the MySQL server.  This is a trivial app, so I was using the very basic mysql_connect(), mysql_query() functions.   The result wasn&#8217;t being returned an mysql_error() was saying that the error was:</p><pre>
PROCEDURE db.procedure_name can't return a result set in the given context
</pre><p>Of course &#8216;db.procedure_name&#8217; was the actual name of the procedure I was calling. <a
href="http://www.google.com/search?q=can't+return+a+result+set+in+the+given+context">Googling</a> for the error seemed to indicate that the MySQL client library was old, but this is on a fairly modern CentOS 5.5 server with the php-mysql package at version 5.1.6.</p><p>After a bit of experimenting, I found that I was able to change to using the mysql improved versions of the PHP functions and that worked fine</p><pre>
     $dbconn = mysql_connect($dbhost, $dbuser, $dbpass);
     $result = mysql_query("CALL db.procedure_name('arg1', 'arg2', 'arg3')", $dbconn)
     $row    = mysql_fetch_assoc($result);
</pre><p>Becomes</p><pre>
    $dbconn = mysqli_connect($dbhost, $dbuser, $dbpass);
    $result = mysqli_query($dbconn, "CALLdb.procedure_name('arg1', 'arg2', 'arg3')");
    $row    = mysqli_fetch_assoc($result);
</pre><p>Note that changing from mysql_query to myqli_query needs the parameters reversed.</p><p>After making that change I&#8217;m able to run the stored procedure correctly.</p> <img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/D0GJBK8vmIg" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/procedure-cant-return-a-result-set-in-the-given-context/feed</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/procedure-cant-return-a-result-set-in-the-given-context</feedburner:origLink></item> <item><title>Southeast Linux Fest Presentation on MySQL Replication</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/f3mPmXqK5uk/southeast-linux-fest-presentation-on-mysql-replication</link> <comments>http://www.brandonchecketts.com/archives/southeast-linux-fest-presentation-on-mysql-replication#comments</comments> <pubDate>Mon, 14 Jun 2010 02:01:51 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[LUG]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[MySQL]]></category><guid isPermaLink="false">http://www.brandonchecketts.com/?p=460</guid> <description><![CDATA[I was fortunate to be selected to give a presentation at the 2010 Southeast Linux Fest held this year in Greenville, SC. The topic was MySQL replication which I picked from a similar presentation I gave about about 1.5 years ago at my local LUG.   I&#8217;ve configured plenty of replicated servers and I [...]]]></description> <content:encoded><![CDATA[<p>I was fortunate to be selected to give a presentation at the 2010 <a
href="http://www.southeastlinuxfest.org/">Southeast Linux Fest</a> held this year in Greenville, SC. The topic was MySQL replication which I picked from a similar presentation I gave about about 1.5 years ago at my <a
href="http://www.uga.edu/chugalug/">local LUG</a>.   I&#8217;ve configured plenty of replicated servers and I think that I understand it well enough to explain it to others.</p><p>The 2-hour presentation is about half slides and half demo.  Throughout the course of the presentation I set up a simple master-slave.  Then I add a second slave.   Taking it a step farther I set up the three servers to replicate in a chain, and finally I configure them to replicate in a full circle so that changes made on one are propagated to all of the others.  I intentionally do things that break replication at certain points to show some of the limitations and configurable features that can help it to work.</p><p>Slides for the presentation are available <a
href="/downloads/self2010-mysql-replication.odp">OpenOffice format</a>.</p><p>The presentation was recorded, so hopefully the SELF team will have those videos available shortly.</p> <img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/f3mPmXqK5uk" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/southeast-linux-fest-presentation-on-mysql-replication/feed</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/southeast-linux-fest-presentation-on-mysql-replication</feedburner:origLink></item> <item><title>Script to Import Static Pages into GetSimple CMS</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/uq2Zb-m8x_I/script-to-import-static-pages-into-getsimple-cms</link> <comments>http://www.brandonchecketts.com/archives/script-to-import-static-pages-into-getsimple-cms#comments</comments> <pubDate>Thu, 13 May 2010 04:30:52 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Websites]]></category><guid isPermaLink="false">http://www.brandonchecketts.com/?p=457</guid> <description><![CDATA[I&#8217;ve recently been impressed with a very simple Content Management System called GetSimple.  It provides just the very basics that allows a user to edit their own website content.  For brochure sites with owners who don&#8217;t want the complexity of a larger CMS, I think it is pretty ideal.
When I develop a site [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve recently been impressed with a very simple Content Management System called <a
href="http://get-simple.info/">GetSimple</a>.  It provides just the very basics that allows a user to edit their own website content.  For brochure sites with owners who don&#8217;t want the complexity of a larger CMS, I think it is pretty ideal.</p><p>When I develop a site though, I typically have a header and footer, and then all of the content pages exist as PHP files that simply include that header and footer.  Converting a static site like that into the CMS takes a bunch of copy/pasting.  I always try to avoid such tedious jobs, and so developed a script  that will import those static pages into a GetSimple installation.</p><p>To run this script, I wanted to import a bunch of files in a &#8217;static&#8217; directory where I had moved all of the static files to.  I then ran this from the command line to import all of the content into GetSimple</p><pre>
# for file in `find static -type f`
> do
> ./getsimple_import_file.php $file
> done
</pre><p>The script is available as <a
href="http://www.brandonchecketts.com/downloads/getsimple_import_file.php">getsimple_import_file.php</a></p><p>It takes a little configuration before running it.   It works by simulating the data that you would submit when creating the page through the web interface, so we have to fake the necessary session cookie.  Uncomment the bit in the middle that will display your cookie and run the script once.  You&#8217;ll need to copy your cookie name and value into the script before doing any actual imports.</p><p>Once you&#8217;ve done that, you will probably want to change the regular expression that attempts to grab the page title from your file.  You may also want to manipulate how it figures the URL to use.</p><p>Feel free to post comments here if  you found this useful, or made any changes  you&#8217;d like to share with other users</p> <img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/uq2Zb-m8x_I" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/script-to-import-static-pages-into-getsimple-cms/feed</wfw:commentRss> <slash:comments>3</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/script-to-import-static-pages-into-getsimple-cms</feedburner:origLink></item> <item><title>Enabling HTTP Page Caching with PHP</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/9oN3dv34rUM/enabling-http-page-caching-with-php</link> <comments>http://www.brandonchecketts.com/archives/enabling-http-page-caching-with-php#comments</comments> <pubDate>Thu, 29 Apr 2010 16:54:30 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Websites]]></category><guid isPermaLink="false">http://www.brandonchecketts.com/?p=454</guid> <description><![CDATA[I&#8217;ve been doing a lot of work on BookScouter.com lately to reduce page load time and generally increase the performance of the website for both users and bots.  One of the tips that the load time analyzer points out is to enable an expiration time for static content.  That is easy enough for [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of work on <a
href="http://bookscouter.com/">BookScouter.com</a> lately to reduce page load time and generally increase the performance of the website for both users and bots.  One of the tips that the <a
href="https://addons.mozilla.org/en-US/firefox/addon/3371">load time analyzer</a> points out is to enable an expiration time for static content.  That is easy enough for images and such by using an Apache directive such as:</p><pre>
    ExpiresActive On
    ExpiresByType image/gif A2592000
    ExpiresByType image/jpg A2592000
    ExpiresByType image/png A2592000
</pre><p>But pages generated with PHP by default have the Pragma: no-cache header set, so that the users&#8217; browsers do not cache the content at all.  In most cases, even hitting the back button will generate another request to the server which must be completely processed by the script.  You may be able to cache some of the most intensive operations inside your script, but this solution will eliminate that request completely.  Simply add this code to the top of any page that contains semi-static content.  It effectively sets the page expiration time to one hour in the future.  So if a visitor hits the same URL within that hour, the page is served locally from their browser cache instead of making a trip to the server.  It also sends an HTTP 304 (Not Modified) response code if the user requests to reload the page within the specified time.  That may or may-not be desired based on your site.</p><pre>
$expire_time = 60*60; // One Hour
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + $expire_time));
header("Cache-Control: max-age={$expire_time}");
header('Last-Modified: '.gmdate('D, d M Y H:i:s \G\M\T', time()));
header('Pragma: public');

if ((!empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) &#038;&#038; (time() - strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) < = $expire_time)) {
    header('HTTP/1.1 304 Not Modified');
    exit;
}
</pre></pre> <img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/9oN3dv34rUM" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/enabling-http-page-caching-with-php/feed</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/enabling-http-page-caching-with-php</feedburner:origLink></item> <item><title>Skipping the DROP TABLE, CREATE TABLE statements in a large mysqldump file.</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/KlMfqb5zmcg/skipping-the-drop-table-create-table-statements</link> <comments>http://www.brandonchecketts.com/archives/skipping-the-drop-table-create-table-statements#comments</comments> <pubDate>Wed, 28 Apr 2010 14:03:52 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Programming]]></category><guid isPermaLink="false">http://www.brandonchecketts.com/?p=451</guid> <description><![CDATA[I have a large table of test data that I&#8217;m copying into some development environments.  I exported the table with a mysqldump which has a DROP TABLE and CREATE TABLE statements at the topDROP TABLE IF EXISTS `mytable`;
CREATE TABLE `mytable` (
`somecol` varchar(10) NOT NULL default '',
... other columns ...
[...]]]></description> <content:encoded><![CDATA[<p>I have a large table of test data that I&#8217;m copying into some development environments.  I exported the table with a mysqldump which has a DROP TABLE and CREATE TABLE statements at the top</p><pre>
DROP TABLE IF EXISTS `mytable`;
CREATE TABLE `mytable` (
  `somecol` varchar(10) NOT NULL default '',
   ... other columns ...
  PRIMARY KEY  (`somecol`),
  KEY `isbn10` (`somecol`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
</pre><p>The problem is that the developer has altered the table and re-importing the test data would undo those changes.  Editing the text file is impractical because of its size (500 MB gzipped).  So I came up with this workaround which just slightly alters the SQL using sed so that it doesn&#8217;t try to drop or recreate the table.  It comments out the DROP TABLE line, and creates the new table in the test database instead of the real database.</p><pre>
zcat bigfile.sql.gz |sed "s/DROP/-- DROP/"|sed "s/CREATE TABLE /CREATE TABLE test./"|mysql databasename
</pre><img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/KlMfqb5zmcg" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/skipping-the-drop-table-create-table-statements/feed</wfw:commentRss> <slash:comments>2</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/skipping-the-drop-table-create-table-statements</feedburner:origLink></item> <item><title>Sleeping for a random amount of time in a shell script</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/uII4t1bq7U0/sleeping-for-a-random-amount-of-time-in-a-shell-script</link> <comments>http://www.brandonchecketts.com/archives/sleeping-for-a-random-amount-of-time-in-a-shell-script#comments</comments> <pubDate>Fri, 26 Mar 2010 21:17:05 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category><guid isPermaLink="false">http://www.brandonchecketts.com/?p=444</guid> <description><![CDATA[You can use the special $RANDOM environment variable to get a random number and divide it by the maximum number of seconds that you want to wait.  Use the remainder as the number of seconds to sleep since it will always be between zero and the max you specified.  This example will sleep [...]]]></description> <content:encoded><![CDATA[<p>You can use the special $RANDOM environment variable to get a random number and divide it by the maximum number of seconds that you want to wait.  Use the remainder as the number of seconds to sleep since it will always be between zero and the max you specified.  This example will sleep anywhere between zero and 10 minutes (600 seconds)</p><pre>
 /bin/sleep/sleep   `/usr/bin/expr $RANDOM % 600`
</pre><p>Purists will note that it isn&#8217;t truly random.  The maximum value for $RANDOM is 32767 which is not evenly divisible by most likely values, but it is close enough.</p> <img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/uII4t1bq7U0" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/sleeping-for-a-random-amount-of-time-in-a-shell-script/feed</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/sleeping-for-a-random-amount-of-time-in-a-shell-script</feedburner:origLink></item> <item><title>Installing SVN and Trac on a CentOS 5 server</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/eEY2xkq3BEg/installing-svn-and-trac-on-a-centos-5-server</link> <comments>http://www.brandonchecketts.com/archives/installing-svn-and-trac-on-a-centos-5-server#comments</comments> <pubDate>Fri, 19 Mar 2010 20:13:35 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[Programming]]></category><guid isPermaLink="false">http://www.brandonchecketts.com/?p=442</guid> <description><![CDATA[Make sure that you have the RPMForge repository enabled.  Install Subversion, mod_dav_svn, and trac.  This will install a few required dependencies (ie: neon and some python utils)# yum install subversion mod_dav_svn mod_python tracCreate a directory for your repositories, and an initial repository for testing, and create your htpasswd file.  Then create a [...]]]></description> <content:encoded><![CDATA[<p>Make sure that you have the <a
href="https://rpmrepo.org/RPMforge/Using">RPMForge repository enabled</a>.  Install Subversion, mod_dav_svn, and trac.  This will install a few required dependencies (ie: neon and some python utils)</p><pre>
# yum install subversion mod_dav_svn mod_python trac
</pre><p>Create a directory for your repositories, and an initial repository for testing, and create your htpasswd file.  Then create a trac environment and set it up.</p><pre>
# mkdir /home/svn/
# svnadmin create testrepo
# chown -R apache:apache /home/svn/*
# htpasswd -c  /home/svn/.htpasswd brandon

#mkdir /home/trac/
# trac-admin /home/trac/ initenv
    ... answer questions as appropriate ...
# chown apache:apache /home/trac/*
# htpasswd -c  /home/svn/.htpasswd brandon
</pre><p>Add this to your Apache configuration in the relevant place (I like to put it under an SSL VirtualHost)</p><pre>
    &lt;Location /svn&gt;
        DAV svn
        SVNParentPath /home/svn/
        #SVNListParentPath on
        # Authentication
        AuthType Basic
        AuthName "RoundSphere SVN Repository"
        AuthUserFile /home/svn/.htpasswd
        Order deny,allow
        Require valid-user
    &lt;/Location&gt;
    &lt;Location /trac&gt;
        SetHandler mod_python
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnv /home/trac
        PythonOption TracUriRoot /trac
        # Authentication
        AuthType Basic
        AuthName “MyCompany Trac Environment"
        AuthUserFile /home/svn/.htpasswd
        Require valid-user
    &lt;/Location&gt;
</pre><p>Now test to make sure that you can view your test repository in a browser and that it prompts for a username and password as desired:</p><p>https://your-hostname/svn/testrepo/</p><p>You should retrieve a plain looking page that mentions the name of your repository and that it is at Revision 0</p><p>You should also be able to access your trac installation at</p><p>https://your-hostname/trac/</p><p>Customize your logo, change the home page, start making some tickets, using the wiki and get to work.</p> <img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/eEY2xkq3BEg" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/installing-svn-and-trac-on-a-centos-5-server/feed</wfw:commentRss> <slash:comments>3</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/installing-svn-and-trac-on-a-centos-5-server</feedburner:origLink></item> <item><title>Pear Upgrade Installer</title><link>http://feedproxy.google.com/~r/BrandonChecketts/~3/c5CgfUEAsag/pear-upgrade-installer</link> <comments>http://www.brandonchecketts.com/archives/pear-upgrade-installer#comments</comments> <pubDate>Thu, 18 Mar 2010 21:19:56 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[General]]></category><guid isPermaLink="false">http://www.brandonchecketts.com/?p=440</guid> <description><![CDATA[I was trying to install PHPUnit today, but the box wouldn&#8217;t allow me because the Pear Installer version wasn&#8217;t current.  But there was no obvious way to upgrade the pear installer.[root@ci /]# pear install phpunit/PHPUnit
Did not download optional dependencies: pear/Image_GraphViz, pear/Log, channel://pear.symfony-project.com/YAML, use --alldeps to download automatically
phpunit/PHPUnit requires PEAR Installer (version >= 1.8.1), installed [...]]]></description> <content:encoded><![CDATA[<p>I was trying to install PHPUnit today, but the box wouldn&#8217;t allow me because the Pear Installer version wasn&#8217;t current.  But there was no obvious way to upgrade the pear installer.</p><pre>
[root@ci /]# pear install phpunit/PHPUnit
Did not download optional dependencies: pear/Image_GraphViz, pear/Log, channel://pear.symfony-project.com/YAML, use --alldeps to download automatically
phpunit/PHPUnit requires PEAR Installer (version >= 1.8.1), installed version is 1.4.9
phpunit/PHPUnit can optionally use package "pear/Image_GraphViz" (version >= 1.2.1)
phpunit/PHPUnit can optionally use package "pear/Log"
phpunit/PHPUnit can optionally use package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2)
phpunit/PHPUnit can optionally use PHP extension "json"
phpunit/PHPUnit can optionally use PHP extension "xdebug" (version >= 2.0.5)
No valid packages found
install failed
</pre><p>The trick is to install the PEAR package with &#8211;force to make it go through</p><pre>
[root@ci /]# pear upgrade --force PEAR
warning: pear/PEAR dependency package "pear/Archive_Tar" installed version 1.3.6 is not the recommended version 1.3.3
warning: pear/Archive_Tar requires PEAR Installer (version >= 1.5.4), installed version is 1.4.9
downloading PEAR-1.9.0.tgz ...
Starting to download PEAR-1.9.0.tgz (291,634 bytes)
.............................................................done: 291,634 bytes
downloading Archive_Tar-1.3.6.tgz ...
Starting to download Archive_Tar-1.3.6.tgz (17,600 bytes)
...done: 17,600 bytes
upgrade ok: channel://pear.php.net/Archive_Tar-1.3.6
upgrade ok: channel://pear.php.net/PEAR-1.9.0
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
To install use "pear install pear/PEAR#featurename"
</pre><p>From there, you can continue on the the PHPUnit Install</p> <img src="http://feeds.feedburner.com/~r/BrandonChecketts/~4/c5CgfUEAsag" height="1" width="1"/>]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/pear-upgrade-installer/feed</wfw:commentRss> <slash:comments>1</slash:comments> <feedburner:origLink>http://www.brandonchecketts.com/archives/pear-upgrade-installer</feedburner:origLink></item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk
Database Caching 7/11 queries in 0.093 seconds using disk

Served from: www.brandonchecketts.com @ 2010-09-01 14:50:35 -->
