Posts tagged: UNIX

Django management commands, remotely

Django management commands, remotely

I love Django management commands.

For dpaste.com I’ve written several management commands for things that I don’t need a web UI for, like:

  • expire - delete expired pastes (invoked by cron)
  • expunge - manage TOS violations like spam
  • stats - useful metrics on the current corpus of pastes, and on user activity

In running the site I also use management commands from my django-blocklist app, for tasks like deleting expired entries (via cron) or generating reports.

The standard unix password manager you never heard of

Recently I switched my work environment from OS X to Ubuntu (a post on that project is in the works).

For years I’ve been using the standard Apple Keychain app, which has several points in its favor: it’s included with the OS, it integrates well with a lot of applications, and is not trying to “freemium” me into a paid tier. However, it’s OS X only, which meant I had to find something new.

Keeping emacs backup files tidy

In the shell, emacs is my editor of choice. However, it has one default behavior that has gotten in the way more often than it has helped – automatic generation of backup files in the same directory as the original.

Emacs is great for making quick edits to files on the web server. But I don’t want or need all those *~ files sitting around. The material is all in version control, so I can already revert to any point in history.

A tiny little dpaste.com API

When I created dpaste, I tried to make it both a simple browser-based tool and a simple RESTful API. With very little work you could write a script that created a new paste item with a single POST.

Over the life of the site a few people have discovered and played with that “secret” API. I’ve now made it a bit more official. The new API has its own URL (versioned, even!) and is more tolerant of missing data, just like the web form.