Backgrounding Processes in Linux

This is a post mostly for self-reference:

When you start a really long process (say, a backup) and forget to run it under a screen instance or using &, you can pause the process and resume it in the background with a couple of commands:

$ ./my_backup_script
^Z
[1]+  Stopped                 ./my_backup_script
$ bg 1
[1]+ ./my_backup_script &
$ disown -r

Running disown is important, because it tells the process to continue running after you close your current session.

Forcing file downloads with Apache, mod_rewrite, and mod_headers

The Problem: A link to a QuickTime file normally results in the Quicktime plugin opening the file within the browser, which is unhelpful for the user who wants to download the file.

The Solution: While a right-click ‚"Save As" is intuitive for the technical user, it makes life difficult for some.The easy solution is to send a Content-Disposition header using an .htaccess file:

<FilesMatch>
Header set Content-Disposition attachment
</FilesMatch>

This is fine, except it will always try to force the user to download the file, which might not be desirable. The solution to this is to use mod_rewrite and environmental variables to conditionally force the download:
In ./download/.htaccess

RewriteEngine On
RewriteRule (.*) ../$1 [L,NC,QSA,E=force_download:1]

In ./.htaccess

<filesmatch>
Header set Content-Disposition attachment env=REDIRECT_force_download
</filesmatch>

Now, when a user browses to http://example.org/movie.mp4, the QuickTime plugin will perform its default action, and when the user goes to http://example.org/download/movie.mp4, they will be prompted to download the file.