<?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>Nick125.com</title>
	<atom:link href="http://nick125.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nick125.com</link>
	<description>The Rant, The Rave and The Occasional Useful Information</description>
	<lastBuildDate>Tue, 22 Dec 2009 21:56:05 +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>WebSense and their lack of sense</title>
		<link>http://nick125.com/2009/12/19/websense-and-their-lack-of-sense/</link>
		<comments>http://nick125.com/2009/12/19/websense-and-their-lack-of-sense/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 04:54:48 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=29</guid>
		<description><![CDATA[As I was browsing my lighttpd logs (something fun to pass time), I noticed a few weird entries. 62% of the visitors to my site use Firefox, so seeing quite a few IE visitors set off some alarm bells.

::ffff:208.80.193.40 nick125.com - [22/Sep/2009:07:47:52 -0600] "GET / HTTP/1.0" 200 15810 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT [...]]]></description>
			<content:encoded><![CDATA[<p>As I was browsing my lighttpd logs (something fun to pass time), I noticed a few weird entries. 62% of the visitors to my site use Firefox, so seeing quite a few IE visitors set off some alarm bells.</p>
<p><code></p>
<div id="_mcePaste">::ffff:208.80.193.40 nick125.com - [22/Sep/2009:07:47:52 -0600] "GET / HTTP/1.0" 200 15810 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; MEGAUPLOAD 1.0; ZangoToolbar 4.8.3; SpamBlockerUtility 4.8.4; MSN 9.0;MSN 9.1; MSNbQ002; MSNmen-us; MSNcOTH)"</div>
<div id="_mcePaste">::ffff:208.80.193.27 continental.nick125.com - [22/Sep/2009:07:50:16 -0600] "GET / HTTP/1.0" 200 3569 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; PeoplePal 3.0; ZangoToolbar 4.8.3)"</div>
<p></code></p>
<p><code>::ffff:208.80.193.40 nick125.com - [22/Sep/2009:07:47:52 -0600] "GET / HTTP/1.0" 200 15810 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FunWebProducts; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; MEGAUPLOAD 1.0; ZangoToolbar 4.8.3; SpamBlockerUtility 4.8.4; MSN 9.0;MSN 9.1; MSNbQ002; MSNmen-us; MSNcOTH)"::ffff:208.80.193.27 continental.nick125.com - [22/Sep/2009:07:50:16 -0600] "GET / HTTP/1.0" 200 3569 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; PeoplePal 3.0; ZangoToolbar 4.8.3)"<br />
</code></p>
<p>..and so on.</p>
<p>Odd. I decide to whois the IP&#8230;.and guess who it is!<br />
<code><br />
OrgName:    Websense, Inc<br />
OrgID:      WEBSE-6<br />
Address:    10240 Sorrento Valley Road<br />
City:       San Diego<br />
StateProv:  CA<br />
PostalCode: 92121<br />
Country:    US<br />
</code><br />
Hmm. Why are they spoofing their user-agent? Also, it appears that they ignore robots.txt, as they never tried to request it from my server:<br />
<code><br />
nick@lithium:~$ grep -i '208.80.19[2-9]' /var/log/lighttpd/access.log | grep -i 'robots'<br />
nick@lithium:~$<br />
</code><br />
Not only are they spoofing their UA, but they&#8217;re also disregarding robots.txt! How nice of them.</p>
<p>Anyone else notice this?</p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2009/12/19/websense-and-their-lack-of-sense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A neat little render_to_response trick</title>
		<link>http://nick125.com/2009/08/17/a-neat-little-render_to_response-trick/</link>
		<comments>http://nick125.com/2009/08/17/a-neat-little-render_to_response-trick/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 05:02:58 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=24</guid>
		<description><![CDATA[If you&#8217;ve used Django long enough, you will have noticed that render_to_response uses Context rather than RequestContext as the context instance. This is just no fun if you want to use things like auth, MEDIA_URL, etc in your templates. You could just add context_instance=RequestContext(request) to every render_to_response call, or you can use this little code [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve used Django long enough, you will have noticed that render_to_response uses Context rather than RequestContext as the context instance. This is just no fun if you want to use things like auth, MEDIA_URL, etc in your templates. You could just add <em>context_instance=RequestContext(request)</em> to every render_to_response call, or you can use this little code snippet. Not only does it set the default context instance to RequestContext, but it&#8217;s a little less typing. In my projects, I put this in Commons.utils.</p>
<pre style="padding-left: 30px;">from django.template import RequestContext
from django.shortcuts import render_to_response

def render(request, *kargs, **kwargs):
 kwargs["context_instance"] = RequestContext(request)
 return render_to_response(*kargs, **kwargs)</pre>
<p>Use it just as you would render_to_response, with the exception of setting context_instance. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2009/08/17/a-neat-little-render_to_response-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The &#8220;Better&#8221; settings.py</title>
		<link>http://nick125.com/2009/08/17/the-better-settings-py/</link>
		<comments>http://nick125.com/2009/08/17/the-better-settings-py/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 02:30:20 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=15</guid>
		<description><![CDATA[While working on my CRM, I had a bit of an issue: I wanted to keep my setup specific settings (Database information, timezone, secret key, etcs) separate from application settings (INSTALLED_APPS, ROOT_URLCONF, etc). This is useful since it keeps development configurations and production configurations separate and it keeps your setup specific settings out of your [...]]]></description>
			<content:encoded><![CDATA[<p>While working on my CRM, I had a bit of an issue: I wanted to keep my setup specific settings (Database information, timezone, secret key, etcs) separate from application settings (INSTALLED_APPS, ROOT_URLCONF, etc). This is useful since it keeps development configurations and production configurations separate and it keeps your setup specific settings out of your VCS. Well, less talk and more code!</p>
<pre style="padding-left: 30px;">
# local_settings.py
ADMINS = (
    ('Your Default User', 'nobody@example.com'),
)
MANAGERS = ADMINS

PRODUCTION = False
TIME_ZONE = 'America/Denver'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = False
SECRET_KEY = 'PutASecretKeyHere'

DATABASE_ENGINE = ''
DATABASE_NAME = ''
DATABASE_USER = ''
DATABASE_PASSWORD = ''
DATABASE_HOST = ''
DATABASE_PORT = ''

PROJECT_ROOT = '/path/to/your/project'
MEDIA_URL = 'http://your/media/path/'
</pre>
<pre style="padding-left: 30px;">
# Settings.py
from local_settings import *
if not PRODUCTION:
    DEBUG = True
    TEMPLATE_DEBUG = DEBUG
else:
    DEBUG = False
    TEMPLATE_DEBUG = False

MEDIA_ROOT = '%s/templates/media' % (PROJECT_ROOT)
ADMIN_MEDIA_PREFIX = '/media/'

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media')

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

TEMPLATE_DIRS = (
    '%s/templates' % (PROJECT_ROOT)
)

INSTALLED_APPS = (
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
)

from post_settings import *
</pre>
<pre style="padding-left: 30px;">
# post_settings.py

TEMPLATE_DIRS.append("/an/additional/template/path/")
</pre>
<p>So, how does it work? Quite simply. Put your database settings into local_settings.py and any other settings that aren&#8217;t set in settings.py will go there as well. Need to override something in settings.py? Use post_settings.py for that. Not cool enough? In local_settings.py, use a conditional to setup your database settings! This will look something like this:</p>
<pre style="padding-left: 30px;">if PRODUCTION:
    DATABASE_TYPE = 'mysql'
    [...]
else:
    DATABASE_TYPE = 'sqlite3'
    [...]</pre>
<p>Pretty nifty, eh? I figured it might make someone&#8217;s life a little easier.</p>
<p>Cheers!</p>
<p>Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2009/08/17/the-better-settings-py/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgraded to WP 2.8.4</title>
		<link>http://nick125.com/2009/08/13/upgraded-to-wp-2-8-4/</link>
		<comments>http://nick125.com/2009/08/13/upgraded-to-wp-2-8-4/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 15:54:46 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=11</guid>
		<description><![CDATA[Ah, it seems that Wordpress 2.8.3 has a nasty password reset issue, so I&#8217;ve upgraded to the new and shiny and password-reset-vulnerability-lacking 2.8.4. Wordpress makes it fairly easy to upgrade, so why not?
]]></description>
			<content:encoded><![CDATA[<p>Ah, it seems that Wordpress 2.8.3 has a nasty password reset issue, so I&#8217;ve upgraded to the new and shiny and password-reset-vulnerability-lacking 2.8.4. Wordpress makes it fairly easy to upgrade, so why not?</p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2009/08/13/upgraded-to-wp-2-8-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Archive.org</title>
		<link>http://nick125.com/2009/08/11/archive-org/</link>
		<comments>http://nick125.com/2009/08/11/archive-org/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 02:13:43 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=9</guid>
		<description><![CDATA[I just looked at the old versions of my site at Archive.org, and it&#8217;s kind of depressing. Oh, how immature I seem, looking at the old sites. I guess age does bring something to the party.
I&#8217;m going to go reminisce for a bit&#8230;..
Cheers,
Nick
]]></description>
			<content:encoded><![CDATA[<p>I just looked at the old versions of my site at <a href="http://web.archive.org/web/*/http://nick125.com">Archive.org</a>, and it&#8217;s kind of depressing. Oh, how immature I seem, looking at the old sites. I guess age does bring something to the party.</p>
<p>I&#8217;m going to go reminisce for a bit&#8230;..</p>
<p>Cheers,</p>
<p>Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2009/08/11/archive-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello!</title>
		<link>http://nick125.com/2009/08/04/hello/</link>
		<comments>http://nick125.com/2009/08/04/hello/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 00:03:30 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://nick125.com/?p=5</guid>
		<description><![CDATA[Here&#8217;s a new blog. Maybe this time I&#8217;ll actually update it with useful information. Ah well.
Cheers,
Nick
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a new blog. Maybe this time I&#8217;ll actually update it with useful information. Ah well.</p>
<p>Cheers,</p>
<p>Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://nick125.com/2009/08/04/hello/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

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