The problem with moving phones from copper to fiber: power

If you can’t contact your loved ones, or government agencies and relief organizations can’t coordinate, you can’t get anything done. […] A communications system is only useful if you can connect to every other endpoint on the network. If you have power but no one else does, you have a well powered and expensive paperweight (assuming you still have paper). To that point, if your phone has power but the switching station does not, or the cell towers in half the city are down, you still aren’t able to communicate with anyone else.”

emtcharlie on ArsTechnica

The Secret Government Rulebook For Labeling You a Terrorist

A secret process that requires neither “concrete facts” nor “irrefutable evidence” …

“Instead of a watchlist limited to actual, known terrorists, the government has built a vast system based on the unproven and flawed premise that it can predict if a person will commit a terrorist act in the future,” says Hina Shamsi, the head of the ACLU’s National Security Project. “On that dangerous theory, the government is secretly blacklisting people as suspected terrorists and giving them the impossible task of proving themselves innocent of a threat they haven’t carried out.”

The Secret Government Rulebook For Labeling You a Terrorist

virtualenv-burrito 2.7

Yesterday, virtualenv-burrito 2.7 was released. There are two significant changes:

  1. All Python packages in the .venvburrito directory are now inside a versioned site-packages directory. For example, if you are running Python 2.7 during the install or upgrade, all packages will now live in lib/python2.7/site-packages.
  2. The pip program is no longer user accessible (i.e., in the PATH). You could easily figure out where it’s been moved, but that’s discouraged (and unsupported).

Python cron task – exit if already running

A simple way for Python cron tasks to exit if another process is currently running. Does not use a pidfile.

import os
import subprocess
import shlex

def bail_if_another_is_running():
    cmd = shlex.split("pgrep -u {} -f {}".format(os.getuid(), __file__))
    pids = subprocess.check_output(cmd).strip().split('\n')
    if len(pids) > 1:
        print "Exiting! Found {} is already running (pids): {}".format(
            __file__, " ".join(pids))
        raise SystemExit(1)