Lacking Credibility

February 3, 2010

Mimicing source virtualenv/bin/activate in Emacs.

For a while now I've had a problem where at work we rely heavily on virtualenv and I occasionally want to do things like run pyflakes or run trial from the Twisted installed in that virtualenv. This following activate-virtualenv function appears to be all that is necessary to mimic source virtualenv/bin/activate for Emacs. Enjoy.


(defun add-to-PATH (dir)
"Add the specified path element to the Emacs PATH"
(interactive "DEnter directory to be added to PATH: ")
(if (file-directory-p dir)
(setenv "PATH"
(concat (expand-file-name dir)
path-separator
(getenv "PATH")))))

(defun activate-virtualenv (dir)
(setenv "VIRTUAL_ENV" dir)
(add-to-PATH (concat dir "/bin"))
(add-to-list 'exec-path (concat dir "/bin")))


Updated: I forgot to add my add-to-PATH implementation.

November 7, 2009

I don't write here much anymore…

My attempt to start writing again which led to switching to blogger as a platform has kind of failed. I also discovered I don't like blogger as a platform which led to me not writing very because it was an annoying task to actually get a well formatted post entered into the blog-o-drome.

I've also been going through some things. You can read about them here but I must you warn you that the writing is very unpolished.

I'm only really updating this because I saw that it was recently linked to from Twisted Matrix Laboratories. It might even be that the post I'm currently writing will get syndicated on Planet Twisted. I just didn't want people to click that link and be disappointed when they saw some lame posts from 6 months ago.

Eventually I'd like to get into Twisted development and start writing more about Twisted but I just don't have it in me right now.

April 14, 2009

McAfee apparently sends passwords to users in plaintext.

I have a very common name, which means I have a very common gmail address. I get a lot of mail for other people named David Reid. A lot of mail. Every once in a while a David Reid will sign up with my email address for some mailing list.

This morning I noticed an email from McAfee telling me how I could go about downloading some product that someone presumably just purchased. A few minutes later I get this email:

Picture 1 [REDACTED] by you.

So yeah, a so-called security company is storing and transmitting their customer's passwords in plaintext.

FUCKING AWESOME SECURITY FAIL.


March 30, 2009

Twisted + Django + Pinax: Hey, yeah that works.

Ok, so yeah. As of about 2 hours ago Pinax runs on top of Twisted trunk. These seems to indicate that Twisted is a pretty capable and correct WSGI implementation. I suggest you start serving stuff. It's great! Here is a screenshot.

Picture 3 by you.

-David

Twisted + Django: It won't burn down your house.

It's actually really easy to make these two things work together. Since ~8.2.0 Twisted has had a WSGI container runnable from the command line. So here is how you run Django on a supported version of Twisted.web.

  1. easy_install Twisted
  2. easy_install Django
  3. Profit!
  4. django-admin.py startproject foo
  5. Create a myapp.py with the following code:

    from django.core.handlers.wsgi import WSGIHandler

    application = WSGIHandler()
  6. export DJANGO_SETTINGS_MODULE=foo.settings
  7. twistd -no web --wsgi=myapp.application
And there you have it. There are probably a few compatibility problems but this mostly seems to work just fine. I'll be working with some Django weenies to figure out what, if anything is broken.

So look, this is really AWESOME.

Updated (3/30/2009 4:09pm): Twisted tickets #3585, #3721 are problems on Twisted 8.2.0 but are fixed or should be fixed in Twisted trunk soon.

Updated (3/30/2009 6:34pm): Both of the above tickets are done.

December 5, 2008

I've given up.

I've given up on Wordpress.
I've given up on postfix. 

For both blogging and email I've switched to google services.  I still control the dreid.org server but http://dreid.org/ is a redirect to http://blog.dreid.org/  Most of the old dreid.org URLs should still work and hopefully as I write some interesting code it'll get deployed to the server running dreid.org.