<?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>OSTalks &#187; rpm</title>
	<atom:link href="http://www.ostalks.com/tag/rpm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ostalks.com</link>
	<description>Open Source, Operating Systems, Offtopic Stuff!</description>
	<lastBuildDate>Wed, 08 Sep 2010 11:52:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How To Create Your Own Yum Repository in Moblin</title>
		<link>http://www.ostalks.com/2010/03/10/how-to-create-your-own-yum-repository-in-moblin/</link>
		<comments>http://www.ostalks.com/2010/03/10/how-to-create-your-own-yum-repository-in-moblin/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 14:32:28 +0000</pubDate>
		<dc:creator>clintcan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[meego]]></category>
		<category><![CDATA[moblin]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.ostalks.com/?p=350</guid>
		<description><![CDATA[I received a question from an email on how to create your own yum repository. I am basing it on Moblin/Meego, but should mostly work on Fedora/RedHat too. I am assuming that you have already installed the development tools of Moblin in your installed Moblin distribution by using this command: sudo yum groupinstall “Development Tools” [...]]]></description>
			<content:encoded><![CDATA[<p>I received a question from an email on how to create your own yum repository.</p>
<p>I am basing it on Moblin/Meego, but should mostly work on Fedora/RedHat too.</p>
<p>I am assuming that you have already installed the development tools of Moblin in your installed Moblin distribution by using this command:</p>
<p><code>sudo yum groupinstall “Development Tools”</code></p>
<p>To start, we install the createrepo package &#8211; we can get it from the Manage Apps application in the Moblin Applications->Settings tab.</p>
<p><a href="http://www.ostalks.com/wp-content/uploads/2010/03/addremove.png"><img src="http://www.ostalks.com/wp-content/uploads/2010/03/addremove-300x163.png" alt="" title="addremove" width="300" height="163" class="alignnone size-medium wp-image-352" /></a></p>
<p>Once installed we can now create the repository using the commands:</p>
<p>mkdir -p /[path of your moblin repository root]/Moblin/[moblin-release version]/{SRPMS,i586}</p>
<p>We use i586, because Intel atom processors are basically of arch type i586.</p>
<p>You may want to create i386 generic files for whatever use you want, so you can use {SRPMS,i386,i586} instead above.</p>
<p>If you do so, you may want to automate the process by creating a bash script named createrepo.sh and writing in the following code:</p>
<p><code><br />
#!/bin/sh<br />
destdir="[path of your moblin repository root]/[moblin-release version]"<br />
for arch in i386 i586<br />
do<br />
    pushd ${destdir}/${arch} >/dev/null 2>&#038;1<br />
        createrepo .<br />
    popd >/dev/null 2>&#038;1<br />
done<br />
</code></p>
<p>Every time you add a package, call this script and it will create the metadata using the createrepo tool in the i386 and i586 directories.</p>
<p>Upload this directory structure to the server where you&#8217;ll be hosting your repository.</p>
<p>The .repo file you will create will most like be similar to this:</p>
<p>[mymoblinrepo]<br />
name=My Repository<br />
baseurl=http://myserver.com/repo/Moblin/2/$basearch<br />
enabled=1</p>
<p>$basearch will be the arch type of the distribution.  For Moblin you can hardcode it to i586 instead.</p>
<p>Anyways, that&#8217;s about it.  Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ostalks.com/2010/03/10/how-to-create-your-own-yum-repository-in-moblin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moblin Repository Started</title>
		<link>http://www.ostalks.com/2010/02/22/moblin-repository-started/</link>
		<comments>http://www.ostalks.com/2010/02/22/moblin-repository-started/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 23:47:13 +0000</pubDate>
		<dc:creator>clintcan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[moblin]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://www.ostalks.com/?p=289</guid>
		<description><![CDATA[Hi there guys, I noticed moblin&#8217;s repository of packages are quite limited. Yes, I know, moblin is gonna be meego in Q2 2010, but for the moment, I need my application fix. Presenting a little moblin rpm repository until I meego comes, or whatever&#8230; Two applications are in there, GFtp and Gnumeric. Those applications fitted [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there guys,</p>
<p>I noticed moblin&#8217;s repository of packages are quite limited.  Yes, I know, moblin is gonna be meego in Q2 2010, but for the moment, I need my application fix.</p>
<p>Presenting a little moblin rpm repository until I meego comes, or whatever&#8230;</p>
<p>Two applications are in there, GFtp and Gnumeric.  Those applications fitted my requirements for a useable netbook system.</p>
<p><a href="http://www.ostalks.com/wp-content/uploads/2010/02/gnumeric.png"><img src="http://www.ostalks.com/wp-content/uploads/2010/02/gnumeric-300x168.png" alt="" title="gnumeric" width="300" height="168" class="alignnone size-medium wp-image-290" /></a></p>
<p><a href="http://www.ostalks.com/wp-content/uploads/2010/02/gftp.png"><img src="http://www.ostalks.com/wp-content/uploads/2010/02/gftp-300x168.png" alt="" title="gftp" width="300" height="168" class="alignnone size-medium wp-image-291" /></a></p>
<p>To use the repository, just enter this as ostalks_moblin.repo in the yum.repos.d folder (updated to ibiblio):</p>
<p>[ostalks_moblin]<br />
name=OStalks Moblin Repo $releasever – $basearch<br />
baseurl=http://mirrors.ibiblio.org/pub/mirrors/ostalks/moblin/RPMS/<br />
enabled=1<br />
gpgcheck=0</p>
<p>I am also willing to compile applications for you guys, when I do get the time &#8211; I&#8217;m doing this on my own free time.</p>
<p>Have fun installing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ostalks.com/2010/02/22/moblin-repository-started/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Import DBF Files To MySQL Using PHP</title>
		<link>http://www.ostalks.com/2009/12/31/import-dbf-files-to-mysql-using-php/</link>
		<comments>http://www.ostalks.com/2009/12/31/import-dbf-files-to-mysql-using-php/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 00:35:35 +0000</pubDate>
		<dc:creator>clintcan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[DBase]]></category>
		<category><![CDATA[dbf]]></category>
		<category><![CDATA[FoxPro]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://www.ostalks.com/?p=224</guid>
		<description><![CDATA[I recently had a task to do for a friend of mine to migrate Visual FoxPro data into a mysql database.]]></description>
			<content:encoded><![CDATA[<p>I recently had a task to do for a friend of mine to migrate Visual FoxPro data into a mysql database.</p>
<p>As a programmer that doesn&#8217;t like to re-invent the wheel, I tried searching through google, but was only partially successful in getting code to insert dbf data into mysql (it was public domain code, but only had code to insert data into a table that was created earlier).</p>
<p>This is the code modified to work with any dbf file &#8211; it creates the table, then inserts the dbf data into the created table.  The code was further modified to strip whitespaces from the text values (FoxPro/DBase pads text with spaces up to the length of the field).  You may want to change this further, since this is a quick and dirty code for the sole purpose of importing dbf tables.  This works with my rpms at the repository.</p>
<p><code><br />
<?php<br />
/*<br />
 * Part 2 code modified by Clint Christopher Canada from different public domain sources<br />
 * Part 1 code created by Clint Christopher Canada. BSD licensed.<br />
 */</p>
<p>// This is Part I of the code<br />
$tbl = "table to create";<br />
$db_uname = 'mysql username';<br />
$db_passwd = 'mysql password';<br />
$db = 'database';<br />
$conn = mysql_pconnect('localhost',$db_uname, $db_passwd); </p>
<p>// Path to dbase file<br />
$db_path = ".DBF";</p>
<p>// Open dbase file<br />
$dbh = dbase_open($db_path, 0)<br />
  or die("Error! Could not open dbase database file '$db_path'.");</p>
<p>// Get column information<br />
$column_info = dbase_get_header_info($dbh);</p>
<p>// Display information<br />
//print_r($column_info);</p>
<p>$line = array();</p>
<p>foreach($column_info as $col)<br />
{<br />
	switch($col['type'])<br />
	{<br />
		case 'character':<br />
			$line[]= "`$col[name]` VARCHAR( $col[length] )";<br />
			break;<br />
		case 'number':<br />
			$line[]= "`$col[name]` FLOAT";<br />
			break;<br />
		case 'boolean':<br />
			$line[]= "`$col[name]` BOOL";<br />
			break;<br />
		case 'date':<br />
			$line[]= "`$col[name]` DATE";<br />
			break;<br />
		case 'memo':<br />
			$line[]= "`$col[name]` TEXT";<br />
			break;<br />
	}<br />
}<br />
$str = implode(",",$line);<br />
$sql = "CREATE TABLE `$tbl` ( $str );";</p>
<p>mysql_select_db($db,$conn);</p>
<p>mysql_query($sql,$conn);<br />
set_time_limit(0); // I added unlimited time limit here, because the records I imported were in the hundreds of thousands.</p>
<p>// This is part 2 of the code</p>
<p>import_dbf($db, $tbl, $db_path);</p>
<p>function import_dbf($db, $table, $dbf_file)<br />
{<br />
    global $conn;<br />
    if (!$dbf = dbase_open ($dbf_file, 0)){ die("Could not open $dbf_file for import."); }<br />
    $num_rec = dbase_numrecords($dbf);<br />
    $num_fields = dbase_numfields($dbf);<br />
    $fields = array();</p>
<p>    for ($i=1; $i<=$num_rec; $i++){<br />
        $row = @dbase_get_record_with_names($dbf,$i);<br />
        $q = "insert into $db.$table values (";<br />
        foreach ($row as $key => $val){<br />
            if ($key == 'deleted'){ continue; }<br />
            $q .= "'" . addslashes(trim($val)) . "',"; // Code modified to trim out whitespaces<br />
        }<br />
        if (isset($extra_col_val)){ $q .= "'$extra_col_val',"; }<br />
        $q = substr($q, 0, -1);<br />
        $q .= ')';<br />
        //if the query failed - go ahead and print a bunch of debug info<br />
        if (!$result = mysql_query($q, $conn)){<br />
            print (mysql_error() . " SQL: $q<br />\n");<br />
            print (substr_count($q, ',') + 1) . " Fields total.
<p>";<br />
            $problem_q = explode(',', $q);<br />
            $q1 = "desc $db.$table";<br />
            $result1 = mysql_query($q1, $conn);<br />
            $columns = array();<br />
            $i = 1;<br />
            while ($row1 = mysql_fetch_assoc($result1)){<br />
                $columns[$i] = $row1['Field'];<br />
                $i++;<br />
            }<br />
            $i = 1;<br />
            foreach ($problem_q as $pq){<br />
                print "$i column: {$columns[$i]} data: $pq<br />\n";<br />
                $i++;<br />
            }<br />
            die();<br />
        }<br />
    }<br />
}</p>
<p>?><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ostalks.com/2009/12/31/import-dbf-files-to-mysql-using-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.332 seconds -->
