<?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>JADDOG &#187; Code</title>
	<atom:link href="http://www.jaddog.org/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jaddog.org</link>
	<description>Just Another Day Depending On Grace</description>
	<lastBuildDate>Wed, 01 Feb 2012 19:18:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Audrey Multi-instance Deployment Demo</title>
		<link>http://www.jaddog.org/2012/01/13/audrey-multi-instance-demo/</link>
		<comments>http://www.jaddog.org/2012/01/13/audrey-multi-instance-demo/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 19:02:12 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Just Another Day]]></category>
		<category><![CDATA[Planet Fedora]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=555</guid>
		<description><![CDATA[A screencast I created  has landed on youtube. It demonstrates using audrey to launch a multi-instance deployment in EC2 using the Aeolus Project. More info at https://www.aeolusproject.org/ https://www.aeolusproject.org/audrey.html]]></description>
			<content:encoded><![CDATA[<p>A screencast I created  has landed on youtube. It demonstrates using audrey to launch a multi-instance deployment in EC2 using the Aeolus Project.</p>
<p><iframe width="500" height="375" src="http://www.youtube.com/embed/mRlguptneCU?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>More info at<br />
<a title="Aeolus Project" href="https://www.aeolusproject.org/">https://www.aeolusproject.org/<br />
</a><a title="Audrey!" href="https://www.aeolusproject.org/audrey.html">https://www.aeolusproject.org/audrey.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2012/01/13/audrey-multi-instance-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenShift + Django + MySQL</title>
		<link>http://www.jaddog.org/2011/08/17/openshift-django-mysql/</link>
		<comments>http://www.jaddog.org/2011/08/17/openshift-django-mysql/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 21:06:23 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Planet Fedora]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=484</guid>
		<description><![CDATA[I&#8217;ve spent the past 3 years developing two django projects. Nushus: https://fedorahosted.org/nushus Loki: https://fedorahosted.org/loki When Red Hat released openshift I was interested to deploy django on it. I use MySQL with my django apps, mainly because that&#8217;s what I know well. The tutorial I was working through used sqlite so I&#8217;ve put this together to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent the past 3 years developing two <a title="The Django Project" href="https://www.djangoproject.com/">django</a> projects.<br />
Nushus: <a title="Nushus" href="https://fedorahosted.org/nushus">https://fedorahosted.org/nushus</a><br />
Loki: <a title="Loki" href="https://fedorahosted.org/loki">https://fedorahosted.org/loki</a></p>
<p>When Red Hat released openshift I was interested to deploy django on it. I use MySQL with my django apps, mainly because that&#8217;s what I know well. The tutorial I was working through used sqlite so I&#8217;ve put this together to show how I got MySQL working with django on openshift.</p>
<p>Run this quick start to get your account and domain setup<br />
<a title="OpenShift Express Quickstart" href="https://openshift.redhat.com/app/express#quickstart"> https://openshift.redhat.com/app/express#quickstart</a><br />
Then login to the website and open this turoial:<br />
<a title="Django on OpenShift Tutorial" href="https://www.redhat.com/openshift/kb/kb-e1010-show-me-your-django-getting-django-up-and-running-in-5-minutes"> https://www.redhat.com/openshift/kb/kb-e1010-show-me-your-django-getting-django-up-and-running-in-5-minutes</a><br />
Run the &#8216;Deploying a Django Application&#8217; section of this tutorial to get a basic django app setup and running. Then you&#8217;ll have Django setup but with no admin:<br />
<a href="http://www.jaddog.org/wp-content/uploads/2011/08/Screenshot.png"><img class="alignnone size-large wp-image-487" title="Screenshot" src="http://www.jaddog.org/wp-content/uploads/2011/08/Screenshot-1024x272.png" alt="" width="819" height="218" /></a></p>
<p>After you get here, continue the tutorial related to the usual code edits needed in your django project to enable the admin. Don&#8217;t setup the sqlite database as the tutorial suggests, we&#8217;ll get connected to MySQL next.<br />
Next lets setup the database:</p>
<blockquote>
<pre>testapp git:(master)➤ rhc-ctl-app -e add-mysql-5.1 -a testapp
Password:
Contacting https://openshift.redhat.com
Contacting https://openshift.redhat.com

RESULT:

Mysql 5.1 database added.  Please make note of these credentials:

   Root User: SuperSecretUser
   Root Password: SuperSecretPassword

Connection URL: mysql://127.XXX.XXX.XXXX:3306/</pre>
</blockquote>
<p>This will create the MySQL instance but not the database.<br />
This forum post suggests the current method to get the database setup: <a title="Thread: mysql DB name?" href="https://www.redhat.com/openshift/forums/express/mysql-db-name">https://www.redhat.com/openshift/forums/express/mysql-db-name</a><br />
We need to also run syncdb, which the django tuorial shows us how to do. It also shows us how to deploy the admin media. I don&#8217;t like how the django tutorial makes us commit static code that&#8217;s already deployed. Let&#8217;s copy it remotely from the egg that&#8217;s already deployed into the remote static dir without commiting it. All this is done via the openshift build hook. I&#8217;ve rewritten it a bit in process of testing things so it will look a bit different than the tutorials:</p>
<blockquote>
<pre>testapp git:(master)➤ cat .openshift/action_hooks/build
#!/bin/bash
# This is a simple build script, place your post-deploy but pre-start commands
# in this script.  This script gets executed directly, so it could be python,
# php, ruby, etc.

# create the database if it doesn't exist
# https://www.redhat.com/openshift/forums/express/mysql-db-name
if ! /usr/bin/mysql -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" -e "show tables;" $OPENSHIFT_APP_NAME &gt; /dev/null
then
    /usr/bin/mysqladmin -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" create "$OPENSHIFT_APP_NAME"
    echo "Created MySQL database $OPENSHIFT_APP_NAME"
fi

# copy the admin media into place
if [ ! -d "$DIRECTORY" ]; then
    if mkdir $OPENSHIFT_REPO_DIR/wsgi/static/admin
    then
        echo "Created directory $OPENSHIFT_REPO_DIR/wsgi/static/admin"
        echo "Copying admin media into $OPENSHIFT_REPO_DIR/wsgi/static/admin"
        cp -R $OPENSHIFT_APP_DIR/virtenv/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/contrib/admin/media/** $OPENSHIFT_REPO_DIR/wsgi/static/admin
    fi
fi

# cd into the project to run django manage.py commands
cd $OPENSHIFT_REPO_DIR/wsgi/testapp

# run syncdb
# https://www.redhat.com/openshift/kb/kb-e1010-show-me-your-django-getting-django-up-and-running-in-5-minutes
echo "Executing './manage.py syncdb --noinput'"
./manage.py syncdb --noinput</pre>
</blockquote>
<p>This gets us to the login page for the admin: <a href="http://www.jaddog.org/wp-content/uploads/2011/08/Screenshot-1.png"><img class="alignnone size-large wp-image-491" title="Screenshot-1" src="http://www.jaddog.org/wp-content/uploads/2011/08/Screenshot-1-1024x364.png" alt="" width="819" height="291" /></a></p>
<p>Now all that&#8217;s missing is a user. I toyed with a couple options to get a basic user in. The command line manage.py won&#8217;t let you pass a password and I had trouble getting fixtures to load. Though, both of those required sql to verify if the user existed. Settled on a simple management command to make sure we have a user. We have to put it in an app, but we&#8217;re going to need an app eventually anyways to make django so more than start. So here&#8217;s what I did.<br />
In the project directory run the django startapp command:</p>
<blockquote>
<pre>testapp/wsgi/testapp git:(master+)➤ ../manage.py startapp myapp</pre>
</blockquote>
<p>Then add it to the INSTALLED_APPS in your settings file</p>
<blockquote>
<pre>+     'testapp.myapp',</pre>
</blockquote>
<p>You have to put the projects name in there, otherwise things won&#8217;t work later. I got 500&#8242;s trying just to put just &#8216;myapp&#8217; in the installed apps. This app won&#8217;t really do anything for now. It&#8217;s just a container for our management command. You can make it into something else later. Next create the directory structure for the command in the myapp directory.</p>
<blockquote>
<pre>testapp/wsgi/testapp git:(master+)➤ mkdir -p myapp/management/commands
testapp/wsgi/testapp git:(master+)➤ touch myapp/management/__init__.py myapp/management/commands/__init__.py
testapp/wsgi/testapp git:(master+)➤ vim myapp/management/commands/ensuresuperuser.py
testapp/wsgi/testapp git:(master+)➤ tree myapp
myapp
|-- __init__.py
|-- management
|   |-- commands
|   |   |-- ensuresuperuser.py
|   |   `-- __init__.py
|   `-- __init__.py
|-- models.py
|-- tests.py
`-- views.py

2 directories, 7 files</pre>
</blockquote>
<p>You can see I called my command ensuresuperuser. The command will check if the user exists and create it with a password equal to the user&#8217;s username if the user doesn&#8217;t exist. Here&#8217;s it&#8217;s code:</p>
<blockquote>
<pre>testapp/wsgi/testapp git:(master+)➤ cat myapp/management/commands/ensuresuperuser.py
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User

class Command(BaseCommand):
    args = 'username'
    help = 'make sure a user exists with a password'

    def handle(self, *args, **options):
        try:
            user = User.objects.get(username=args[0])
        except:
            User.objects.create_superuser(args[0], email=args[0]+'@example.com', password=args[0])
            self.stdout.write('user %s created with password %s\n' % (args[0], args[0]))</pre>
</blockquote>
<p>Last thing to do is to add this command to your build hook so it executes when you push your code, so update your build hook. Here&#8217;s the whole contents of mine:</p>
<blockquote>
<pre>testapp git:(master+)➤ cat .openshift/action_hooks/build
#!/bin/bash
# This is a simple build script, place your post-deploy but pre-start commands
# in this script.  This script gets executed directly, so it could be python,
# php, ruby, etc.

# create the database if it doesn't exist
# https://www.redhat.com/openshift/forums/express/mysql-db-name
if ! /usr/bin/mysql -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" -e "show tables;" $OPENSHIFT_APP_NAME &gt; /dev/null
then
    /usr/bin/mysqladmin -u "$OPENSHIFT_DB_USERNAME" --password="$OPENSHIFT_DB_PASSWORD" -h "$OPENSHIFT_DB_HOST" create "$OPENSHIFT_APP_NAME"
    echo "Created MySQL database $OPENSHIFT_APP_NAME"
fi

# copy the admin media into place
if [ ! -d "$DIRECTORY" ]; then
    if mkdir $OPENSHIFT_REPO_DIR/wsgi/static/admin
    then
        echo "Created directory $OPENSHIFT_REPO_DIR/wsgi/static/admin"
        echo "Copying admin media into $OPENSHIFT_REPO_DIR/wsgi/static/admin"
        cp -R $OPENSHIFT_APP_DIR/virtenv/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/contrib/admin/media/** $OPENSHIFT_REPO_DIR/wsgi/static/admin
    fi
fi

# cd into the project to run django manage.py commands
cd $OPENSHIFT_REPO_DIR/wsgi/testapp

# run syncdb
# https://www.redhat.com/openshift/kb/kb-e1010-show-me-your-django-getting-django-up-and-running-in-5-minutes
echo "Executing './manage.py syncdb --noinput'"
./manage.py syncdb --noinput

# add an admin user
./manage.py ensuresuperuser admin</pre>
</blockquote>
<p>This time when you commit and push everything you will see it tell you &#8220;user admin created with password admin&#8221;. Obviously this is really insecure so go ahead and change that password right away. Wouldn&#8217;t want your throw away testapp become something it wasn&#8217;t intended for.<br />
<a href="http://www.jaddog.org/wp-content/uploads/2011/08/Screenshot-2.png"><img class="alignnone size-large wp-image-492" title="Screenshot-2" src="http://www.jaddog.org/wp-content/uploads/2011/08/Screenshot-2-1024x305.png" alt="" width="819" height="244" /></a></p>
<p>There you have it, OpenShift + Django + MySQL.<br />
It&#8217;s worth noting, If you get a 500 error you need to use the rhc-snapshot command like so:</p>
<p>testapp git:(master+)➤ rhc-snapshot -a testapp<br />
Password:<br />
Contacting https://openshift.redhat.com<br />
Pulling down a snapshot to testapp.tar.gz</p>
<p>This pulls down a tar ball of your running environment and has a logs directory in there that you can look at the apache logs. I&#8217;ll second <a title="rhc-logwatch pls" href="http://blog.ianweller.org/2011/05/12/openshift-express-first-thoughts/">Ian&#8217;s suggestion for a rhc-logwatch command</a>. That would be pretty handy.</p>
<p>Next steps for me:<br />
1. How to delete an OpenShift application (i.e. throw away testapp, I&#8217;m done with it)<br />
2. Install <a title="Nushus" href="https://fedorahosted.org/nushus">Nushus</a> in OpenShift!</p>
<p>*** Update ***<br />
I came across another blog post a day later that reference rhc-tail-files. i.e. the watchlog thing I mentioned above is already a feature:</p>
<blockquote>
<pre>testapp git:(master+)➤ rhc-tail-files -a testapp
Password:
Contacting https://openshift.redhat.com
Attempting to tail files: testapp/logs/*
Use ctl + c to stop

==&gt; testapp/logs/access_log-20110817-000000-EST &lt;==
... snip log files output ...
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2011/08/17/openshift-django-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gnome 3 two months later</title>
		<link>http://www.jaddog.org/2011/06/27/gnome-3-two-months-later/</link>
		<comments>http://www.jaddog.org/2011/06/27/gnome-3-two-months-later/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 14:24:50 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Planet Fedora]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=471</guid>
		<description><![CDATA[I&#8217;ve been using Fedora 15 and Gnome 3 for a little over  2 months now. I&#8217;ve learned a few things that have made my daily workflow a little easier, thought I&#8217;d share. 1. the alt key switches the Suspend menu item to &#8220;Power Off&#8221; I infrequently need it, but the alternative was to logout and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Fedora 15 and Gnome 3 for a little over  2 months now. I&#8217;ve learned a few things that have made my daily workflow a little easier, thought I&#8217;d share.</p>
<p>1. the alt key switches the Suspend menu item to &#8220;Power Off&#8221;<br />
I infrequently need it, but the alternative was to logout and power off from the login screen or to add a gnome-shell-extension.</p>
<p>2. gnome-tweak-tool<br />
There&#8217;s a couple settings in there that I was glad to be able to tweak</p>
<p>3. Drag to top of the screen to maximize.<br />
I keep a couple things maximized, It&#8217;s nice to just drag the window to the top of the screen and have it maximize.</p>
<p>4. gsettings<br />
I haven&#8217;t had too much need for this yet, but understanding it is relevant to writing extensions.</p>
<p>5. gnome-shell-extensions-dock<br />
yum install gnome-shell-extensions-dock<br />
gsettings set org.gnome.shell.extensions.dock position left<br />
alt-f2<br />
r<br />
enter</p>
<p>6. wrote a gnome-shell-extension</p>
<p>Part of my team at work is in Pune, India and our company also pass lots of times around in utc. The Fedora 14 Clock applet that listed what time it was in other timezones was helpful. So I set out last week to put something together in gnome 3 that would serve the same purpose.</p>
<p>In the process I also found some code to add apps to the top panel and decided to post the little bit of code I put together here: https://github.com/radez/gnome-shell-extensions</p>
<p>Here&#8217;s what my &#8220;clocks&#8221; extension looks like. It&#8217;s not much but it suits my needs. I need to plug into gsettings as some point so that Pune and UTC arn&#8217;t hard coded.</p>
<p><a href="http://www.jaddog.org/wp-content/uploads/2011/06/Screenshot-1.png"><img class="alignnone size-full wp-image-474" title="gnome-shell-extensions-clocks" src="http://www.jaddog.org/wp-content/uploads/2011/06/Screenshot-1.png" alt="" width="408" height="398" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2011/06/27/gnome-3-two-months-later/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django, Apache and Semaphores</title>
		<link>http://www.jaddog.org/2011/05/24/django-apache-and-semaphores/</link>
		<comments>http://www.jaddog.org/2011/05/24/django-apache-and-semaphores/#comments</comments>
		<pubDate>Tue, 24 May 2011 14:05:27 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=463</guid>
		<description><![CDATA[At work I use Loki to manage my buildbot infrastructure. It&#8217;s deployed on apache via mod_wsgi. Recenlty I&#8217;ve been having trouble with Apache crashing with one of two single error lines in the logs: [notice] seg fault or similar nasty error detected in the parent process or [emerg] (28)No space left on device: Couldn&#8217;t create [...]]]></description>
			<content:encoded><![CDATA[<p>At work I use <a title="Loki" href="https://fedorahosted.org/loki">Loki</a> to manage my <a title="Buildbot" href="http://trac.buildbot.net/">buildbot</a> infrastructure. It&#8217;s deployed on apache via mod_wsgi. Recenlty I&#8217;ve been having trouble with Apache crashing with one of two single error lines in the logs:</p>
<blockquote><p>[notice] seg fault or similar nasty error detected in the parent process<br />
or<br />
[emerg] (28)No space left on device: Couldn&#8217;t create accept lock</p></blockquote>
<p>I came across <a title="Apache: No space left on device: Couldn't create accept lock " href="http://rackerhacker.com/2007/08/24/apache-no-space-left-on-device-couldnt-create-accept-lock/">this post</a> and found it very helpful. Start with seeing if there are left over semaphores when you stop apache:</p>
<blockquote><p># ipcs -s | grep apache</p></blockquote>
<p>If that&#8217;s the case then first clear them:</p>
<blockquote><p># /usr/bin/ipcs -s | grep apache | awk &#8216; { print $2 } &#8216; | xargs ipcrm sem</p></blockquote>
<p>Then tell the kernel to allow more semaphores by adding the followings lines to /etc/sysctl.conf</p>
<blockquote><p>kernel.msgmni = 1024<br />
kernel.sem = 250 256000 32 1024</p></blockquote>
<p>then run</p>
<blockquote><p># sysctl -p</p></blockquote>
<p>Once I start everything back up this seems to have fixed my issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2011/05/24/django-apache-and-semaphores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nushus 0.12.7</title>
		<link>http://www.jaddog.org/2011/02/25/nushus-0-12-7/</link>
		<comments>http://www.jaddog.org/2011/02/25/nushus-0-12-7/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 16:49:10 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Planet Fedora]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=441</guid>
		<description><![CDATA[New version of nushus is available for download. Couple bug fixes and a couple small features. New cli plugin added as part of the standard distribution. https://fedorahosted.org/nushus Release Notes: https://fedorahosted.org/nushus/wiki/Release]]></description>
			<content:encoded><![CDATA[<p><img title="Nushus" src="https://fedorahosted.org/nushus/attachment/wiki/logo/logo-black-name.gif?format=raw" alt="" width="200" height="50" /><br />
New version of nushus is available for download.<br />
Couple bug fixes and a couple small features.<br />
New cli plugin added as part of the standard distribution.</p>
<p><a title="Nushus" href="https://fedorahosted.org/nushus">https://fedorahosted.org/nushus</a><br />
Release Notes: <a title="Nushus Release Notes" href="https://fedorahosted.org/nushus/wiki/Release">https://fedorahosted.org/nushus/wiki/Release</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2011/02/25/nushus-0-12-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loki 0.10.1</title>
		<link>http://www.jaddog.org/2010/12/02/loki-0-10-1/</link>
		<comments>http://www.jaddog.org/2010/12/02/loki-0-10-1/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 19:06:19 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Planet Fedora]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=411</guid>
		<description><![CDATA[Loki 0.10.1 https://fedorahosted.org/loki Just put a tarball out on the loki downloads page: https://fedorahosted.org/released/loki/ Check out the change log here: https://fedorahosted.org/loki/wiki/ChangeLog]]></description>
			<content:encoded><![CDATA[<p>Loki 0.10.1<br />
<a title="Loki" href="https://fedorahosted.org/loki">https://fedorahosted.org/loki</a></p>
<p>Just put a tarball out on the loki downloads page: <a title="Download Loki" href="https://fedorahosted.org/released/loki/">https://fedorahosted.org/released/loki/</a></p>
<p>Check out the change log here: <a title="Loki Change Log" href="https://fedorahosted.org/loki/wiki/ChangeLog">https://fedorahosted.org/loki/wiki/ChangeLog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2010/12/02/loki-0-10-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice Python Cheat Sheet</title>
		<link>http://www.jaddog.org/2010/11/24/nice-python-cheat-sheet/</link>
		<comments>http://www.jaddog.org/2010/11/24/nice-python-cheat-sheet/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 14:34:07 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Planet Fedora]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=404</guid>
		<description><![CDATA[I&#8217;m currently working on consuming some of the yum-utils package on Fedora/RHEL to add a repo &#8220;mirror&#8221; sort of functionality to nushus. One of the files in the package is /usr/bin/repodiff which defines a class that has some functionality that would be super helpful to not have to rewrite. Problem is that you can&#8217;t do [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on consuming some of the yum-utils package on Fedora/RHEL to add a repo &#8220;mirror&#8221; sort of functionality to <a title="Nushus" href="http://fedorahosted.org/nushus">nushus</a>. One of the files in the package is /usr/bin/repodiff which defines a class that has some functionality that would be super helpful to not have to rewrite. Problem is that you can&#8217;t do a straight import on that file because it doesn&#8217;t have a .py extension. A little googling for variants of &#8220;python import non .py&#8221; had a couple different ways to do the import. Best answer I&#8217;ve found that provides access to the class was found on a little cheat sheet. Just wanted to post a link and a copy, it has some good information for those new to python and a few little gems of &#8220;things you don&#8217;t do all the time&#8221;.</p>
<p>the link on google went directly to the pdf: <a title="All I ever needed to know about python scripting" href="http://www.socallinuxexpo.org/scale7x/sites/scale7x.socallinuxexpo.org/files/matt-harrison-pyhandout.pdf">All I ever needed to know about python scripting</a><br />
Here&#8217;s my copy of it: <a href="http://www.jaddog.org/wp-content/uploads/2010/11/matt-harrison-pyhandout.pdf">All I ever needed to know about python scripting</a></p>
<p>Answer to my question is on page one of the pdf:</p>
<blockquote><p>&gt;&gt;&gt; from types import ModuleType<br />
&gt;&gt;&gt; my_script = ModuleType(&#8216;my_script&#8217;)<br />
&gt;&gt;&gt; exec open(&#8216;bin/my_script&#8217;) in my_script.__dict__<br />
&gt;&gt;&gt; my_script.main(['-t', 'bar'])</p></blockquote>
<p>Thanks Matt Harrison! (no idea who you are, but thanks!)<br />
Maybe I&#8217;ll email him now <img src='http://www.jaddog.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In case anyone is looking to learn python, here&#8217;s the resource I learned on: <a title="Dive into Python" href="http://diveintopython.org/">Dive into Python</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2010/11/24/nice-python-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loki 0.8.0</title>
		<link>http://www.jaddog.org/2010/07/15/loki-0-8-0/</link>
		<comments>http://www.jaddog.org/2010/07/15/loki-0-8-0/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 18:11:52 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Planet Fedora]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=381</guid>
		<description><![CDATA[Rewrote the model in loki to separate builders from slaves in attempt to support multinode support. I&#8217;ve also submitted a package request for Django-loki to fedora. https://fedorahosted.org/loki]]></description>
			<content:encoded><![CDATA[<p>Rewrote the model in loki to separate builders from slaves in attempt to support multinode support. I&#8217;ve also submitted a package request for Django-loki to fedora.</p>
<p>https://fedorahosted.org/loki</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2010/07/15/loki-0-8-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nushus Screenshots</title>
		<link>http://www.jaddog.org/2010/06/30/nushus-screenshots/</link>
		<comments>http://www.jaddog.org/2010/06/30/nushus-screenshots/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 13:41:15 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Planet Fedora]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=363</guid>
		<description><![CDATA[I got some feedback yesterday that suggested the Nushus Fedorahosted.org page could mistakenly depict the application as CLI only. The feedback also suggested that some screenshots would be a welcome addition to the trac site and would help remedy this mis-perception. So here the are: some nushus screenshots]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="nushus" src="https://fedorahosted.org/nushus/attachment/wiki/logo/logo-black-name.gif?format=raw" alt="" width="200" height="50" /><br />
I got some feedback yesterday that suggested the <a title="nushus - Fedorahosted.org" href="https://fedorahosted.org/nushus/">Nushus Fedorahosted.org</a> page could mistakenly depict the application as CLI only. The feedback also suggested that some screenshots would be a welcome addition to the trac site and would help remedy this mis-perception.</p>
<p>So here the are: <a title="nushus Screenshots" href="https://fedorahosted.org/nushus/wiki/Screenshots">some nushus screenshots</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2010/06/30/nushus-screenshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nushus 0.12.5</title>
		<link>http://www.jaddog.org/2010/06/18/nushus-0-12-5/</link>
		<comments>http://www.jaddog.org/2010/06/18/nushus-0-12-5/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 18:28:12 +0000</pubDate>
		<dc:creator>radez</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Planet Fedora]]></category>

		<guid isPermaLink="false">http://www.jaddog.org/?p=358</guid>
		<description><![CDATA[New version of nushus is available for download. Just a couple bug fixes. https://fedorahosted.org/nushus Release Notes: https://fedorahosted.org/nushus/wiki/Release]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Nushus" src="https://fedorahosted.org/nushus/attachment/wiki/logo/logo-black-name.gif?format=raw" alt="" width="200" height="50" /><br />
New version of nushus is available for download. Just a couple bug fixes.</p>
<p><a title="Nushus" href="https://fedorahosted.org/nushus">https://fedorahosted.org/nushus</a><br />
Release Notes: <a title="Nushus Release Notes" href="https://fedorahosted.org/nushus/wiki/Release">https://fedorahosted.org/nushus/wiki/Release</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jaddog.org/2010/06/18/nushus-0-12-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

