This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
__author__ = "Ryan McGuire ([email protected])" | |
__date__ = "Wed Sep 1 22:05:31 2010" | |
#Check the current external IP address | |
#If it has changed, email me the new one (via cron) | |
#Update the dynamic DNS provider |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calibredb list -f title,author_sort,formats | grep ".*\[\]\W*$" | cut -d " " -f 1 | xargs -iXX calibredb remove XX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Call this inside ~/.ipython/ipy_user_conf.py main() | |
import sys | |
import subprocess | |
from os import environ | |
if 'VIRTUAL_ENV' in environ: | |
#This is kludgy but it works; grab the right sys.path from the virtualenv python install: | |
path = subprocess.Popen(['python', '-c','import sys;print(repr(sys.path))'], | |
stdout=subprocess.PIPE).communicate()[0] |
Blogofile 1.0-DEV (soon to be 0.7.2) changed the blog controller so that all of the configuration is done in the controller itself. Users upgrading to 0.7.2 will have a choice to make: upgrade their _controllers directory to use the new controller, or install this hack to get all the defaults back that got lost in translation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import Timer | |
class SuicidalKey(object): | |
""" | |
>>> k = SuicidalKey("asdf",30) | |
>>> k.key | |
'asdf' | |
>>> # Before 30 seconds are up | |
>>> k.reset_expiration(30) | |
>>> # Wait 30 seconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import os.path | |
import urllib | |
import tarfile | |
import tempfile | |
import shlex | |
def easy_install_2to3(package_name): | |
"""A lot of packages work just fine in py3k if you run them | |
through 2to3, but for whatever reason the authors have been too |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
categories: Test | |
date: 2011/04/04 15:25:00 | |
title: Markdown lists | |
--- | |
These are some lists in Markdown: | |
* list item 1 | |
* list item 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
categories: General Stuff | |
date: 201/04/06 15:25:00 | |
title: Just a test | |
keywords: test, another test, more "tests" | |
--- | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Render TeX blocks to png | |
This is a Blogofile filter. Place it in your _filters directory. | |
""" | |
import tempfile | |
import subprocess | |
import shutil | |
import shlex | |
import os |