Mail Server Fun

So I set up my own mail server a little over a year ago. I didn't get TLS connections set up to allow myself to use it remotely because I didn't get around to it when I initially set it up. I've noticed the amount of spam I receive steadily increasing as I participate in different mailing lists and open source projects. I figured that since my classes were over, I should spend the small amount of time, and paste in what I needed in my config file to get the behavior I wanted.

We use postfix at work, and I use postfix for my mail server. My server is largely inspired by the way the servers are set up at work. I know how things work if I make them work. I looked at the config file from at work, and more or less pasted in ...

Continue Reading

Permalink | Posted: Dec 25, 2008 | Tags: Servers Administration

Web Statistics Shortcoming

I recently read about django-webalizer http://github.com/arneb/django-webalizer/tree/master

I decided to set it up. I'd never really cared to analyze my log files before. I set up webalizer, and it was great. The django-webalizer app provides a good interface for my statistics. I'll definitely include it for any freelance work I might do in the future.

When I ran webalizer on my site for the first time, I realized there were a couple broken links, and I noticed there were some things I could do to better my site. I don't use a favicon, so I had several hundred 404s in my log. I also analyzed logs for a public facing site at work, and fixed quite a few things.

This was good, but all those errors that happened at the beginning of the month have been taken care of. webalizer doesn't ...

Continue Reading

Permalink | Posted: Dec 24, 2008 | Tags: Django Open Source Python

Django Gotchas - Static Media

I've been a semi-active participant in the Django community for over a year now. I've seen thousands of e-mails come through on the Django-users and Django-developers list. I've written a few patches, and helped revise some as well. I may not be the most seasoned Django community member, but I see the same questions pop up fairly frequently. Here are some of the solutions to some of those problems, and some helpful ideas that may be helpful. This is no substitution for the official docs. All of this is documented very well at http://docs.djangoproject.com/en/dev/howto/static-files/

Static media seems a little weird if you're new to web frameworks. It seems like Django should be responsible for serving that media. It shouldn't be. It can, however, be useful in some instances. Many questions about serving static files fall into two categories ...

Continue Reading

Permalink | Posted: Dec 09, 2008 | Tags: Django Python

cs240 Chess Project on a Mac

So, I use osx on my laptop. It's unix. My cs240 class at BYU uses Linux for all its projects. I've already done all of my projects in such a way that it works fine on mac and linux. The biggest issue is at compile time. The compiler needs a different include path, or the LD_PATH needs to be set differently. This isn't an issue for the autotools project I did, but when writing Makefiles by hand, I had to set paths appropriately.

I'm starting the second large project for cs240, in which I will implement the rules of chess on top of a gtkmm/glade GUI that is provided. I want to make it work on my mac. This shouldn't be difficult, but here's what I did to make it work.

I untarred the example project provided by the TAs. I ran make ...

Continue Reading

Permalink | Posted: Nov 11, 2008 | Tags: School

nvidia drivers woe

So a sad thing happened today. I upgraded my archlinux system, and when I rebooted for the new kernel, xorg didn't work.

NVRM: The NVIDIA GeForce FX 5700 Ultra GPU installed in this system is
NVRM:  supported through the NVIDIA 173.14.xx Legacy drivers. Please
NVRM:  visit http://www.nvidia.com/object/unix.html for more
NVRM:  information.  The 177.80 NVIDIA driver will ignore
NVRM:  this GPU.  Continuing probe...
NVRM: No NVIDIA graphics adapter found!

I've known that this was likely going to happen fairly soon, but it's still sad. My graphics card has been moved to legacy.

Nvidia used to have the best linux support. This legacy driver crap, while it makes sense in theory, causes lots of problems. I have a couple older nvidia cards that won't display at 1080p through their DVI port because the legacy driver that supports them doesn ...

Continue Reading

Permalink | Posted: Nov 08, 2008 | Tags: Open Source Hardware

Document Geek

All through High School, I struggled in English class. I never broke a C in any English class I ever took. When I got to college, I managed a B in my Freshman English class. I find myself looking up those pesky grammar rules, and even submitting tickets and patches to emerging open source projects which were written by people like me-- lots of spelling errors and some ugly grammar mistakes.

I've contributed to Django's documentation. I submitted a patch to fix "noone" ("no one" is correct.) in a couple places on the open source MMORPG called "The Mana World."

I've become almost a professional note taker, and I get irked when I have a teacher who uses all caps in an outline, or consistently spells something wrong that a spell checker is sure to have complained about.

I was driven nuts when I opened a handout ...

Continue Reading

Permalink | Posted: Oct 19, 2008 | Tags: Documents OCD School

Strange Django Error

I was porting Smug to work with Django 1.0, and I got a very, very, strange error when I'd try to go to the admin site. The template renderer was throwing TemplateSyntaxError when trying to access /admin/. I was very confused:

Template error:
In template /users/admin/jefferya/sandbox/django/django/contrib/admin/templates/admin/base.html, error at line 25
   Caught an exception while rendering: Non-reversible reg-exp portion: '(?x'
   25 :         <div id="user-tools">{% trans 'Welcome,' %} <strong>{% firstof user.first_name user.username %}</strong>. {% block userlinks %} {% url django-admindocs-docroot as docsroot %} {% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}<a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
Traceback:
...
...
File "/users/admin/jefferya/sandbox/django/django/template/debug.py" in render_node
  81.             raise wrapped

Exception Type: TemplateSyntaxError at /admin/
Exception Value: Caught an exception while rendering: Non-reversible reg-exp portion: '(?x ...

Continue Reading

Permalink | Posted: Sep 20, 2008 | Tags: Django Smug

git command of the day: #7

git-cherry-pick

This is useful for importing things from branches that haven't been merged.

If I have a large feature branch, and I commit a bug fix, I could "cherry pick" the commit with the bug fix, and apply only that to the master branch. I participate in helping with the Django project. There were several bugs fixed on the newforms-admin branch that would have been useful to have on the master branch. I could have cherry-picked those commits, and applied them to my own checkout. I was never bitten by any of these bugs, but cherry picking would have been the right solution.

Permalink | Posted: Sep 19, 2008 | Tags: git

git command of the day: #6

git-rebase -i

According to the man page, this is an interactive rebase. I haven't yet found a need for it, but it is able to edit a list of commits when rebasing, and can be used to split commits.

I like the fine-grained control of the interactive mode when adding changes. I've been playing with git-rebase on and off, and rebasing interactively helps me help git decide what to do.

Permalink | Posted: Sep 19, 2008 | Tags: git

git command of the day: #5

git commit --ammend

This is a very useful little tool. It can help relieve repositories of "doh!" commits.

Last night I was importing html documentation to a project, in ReST format. I wanted my ReST source to produce results as close as possible to the original. I decided to use one construct, but changed my mind later. I went through and changed everything to the new way of doing it, and did the initial ReST checkin. I realized I missed a couple places, so I fixed them, did a git add, and then git commit --ammend

Now my repository doesn't have a commit like "oh, just kidding... this needs to be here too." Very nice. Very useful.

Permalink | Posted: Sep 17, 2008 | Tags: git

git command of the day: #4

git-filter-branch

All I have to say is: wow

I knew it could be used for rewriting commit information-- say I commit and push as 'user@localhost'. I can use git-filter-branch to change it to the correct e-mail address.

I use a git repository to keep track of all my school work. I checked in the boost libraries for a CS project-- it provided a consistent version of boost across all the different environments that I had a working copy for. I regretted it later though. git-filter-branch can rewrite the entire history of my repository, and remove the files. Now when I clone repositories, I won't have to clone the boost libraries. It'll help save time, and keep the usage down on my accounts that have quotas.

Permalink | Posted: Sep 16, 2008 | Tags: git

git command of the day: #3

git-rerere

This seems like it might be useful. It streamlines merge conflicts when merging to keep up with master on a topic branch. I don't have much use for it, but I chose it because it has a cool name, and it seems like it'd be useful. I'll keep it in mind if I ever need it.

Permalink | Posted: Sep 16, 2008 | Tags: git

git command of the day: #2

git rebase --skip

git-rebase is a very nice way to develop things. I like some of its advantages over git-merge. I like being able to rebase my work against a newer HEAD. I think it creates a cleaner, easier to read patch when the time comes to submit it. There are, however, just some times when you don't want to deal with a conflict when rebasing. Maybe the HEAD against which you are rebasing has addressed an issue that you have in your patch, and did it in a better way. Using git-rebase --skip continues a previous rebase attempt.

Permalink | Posted: Sep 15, 2008 | Tags: git

git command of the day: #1

git-mergetool

I decided at work that I'd look up a command with git that I don't use on a regular basis, and share it with my co-workers. We run a small IRC server so we can still work together and collaborate, even if we are at home, in the office, or out of town. I just add the "command of the day" to the topic of the channel we use.

This was for yesterday's command. I just decided today that I may as well elaborate on why I chose the command and share my thoughts on my blog.

Git's merge process was the most confusing thing that came up when I was still learning git. It happens seldom enough that I have a hard time remembering exactly where to look and what to do. I can figure it out-- it just isn't clockwork like most ...

Continue Reading

Permalink | Posted: Sep 13, 2008 | Tags: git

Death to Optical Media

In the early 90s, a compact disc was a very new and cool concept. You could get better quality music out of a compact disc than with a more common cassette tape. On the computer side, CDs were nice because they had a very, very large capacity compared to other removable media. Even though CDs were read only, CD-rom drives were popular in new consumer-grade computers by the time the Pentium Processor was widely used. As the format evolved, the DVD was introduced. It was designed to play higher quality video. On the computer side, it provided an even larger capacity for software distribution.

We are now in the third generation of optical media. It was engineered to support Hi-Definition video content. Computers haven't widely adopted the use of blu-ray or hd-dvd drives. DVD media is by far more common, and a DVD disk has plenty of space for ...

Continue Reading

Permalink | Posted: Sep 10, 2008 | Tags: Hardware