1. Thejesh GN
  2. text


text / fabfile.py

from __future__ import with_statement
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.colors import green
from fabric.contrib.files import sed
from fabric.operations import prompt

def publish(file):
    local('s3cmd put --acl-public '+file+' s3://text.thejeshgn.com/'+file)
    print(green("Published! - check http://text.thejeshgn.com/"+file))
def sign(file):
    local('gpg --clearsign '+file)
    local('rm '+file)
    local('cp '+file+".asc "+file)
    local('rm '+file+".asc ")
def rename(file):
def backup():
    commit_msg = prompt('backup message?', default='Latest changes.')
    local('hg add')
    local('hg commit -m "'+commit_msg+'"')
    local('hg push')

def verify(file):
    local('gpg --verify '+file)

def ls():
    local('s3cmd ls s3://text.thejeshgn.com')
def index():
    intro_txt = '''
Bunch of text files. You can find them at http://text.thejeshgn.com
and also as a mercurial repository http://code.thejeshgn.com/text
All of them are inline signed by my GPG keys. The mercurial reposiotry 
commits are also signed.

Thejesh GN <i@thejeshgn.com>
GPG keys are at : http://text.thejeshgn.com/BFFC8DD3C06DD6B0.txt
Fingerprint: C7D4 1911 9893 ADAF 27B0 FCAA BFFC 8DD3 C06D D6B0

How to validate :
1. Import my gpg keys
    >wget -O- http://text.thejeshgn.com/BFFC8DD3C06DD6B0.txt | gpg --import
    >gpg --recv-keys  0xBFFC8DD3C06DD6B0

2. Check finger print
    >gpg --fingerprint 0xBFFC8DD3C06DD6B0
        it should return    
    pub   4096R/C06DD6B0 2012-01-24
    Key fingerprint = C7D4 1911 9893 ADAF 27B0  FCAA BFFC 8DD3 C06D D6B0
3. Check the signature
    >gpg --verify readme.txt 
    >wget -O- http://text.thejeshgn.com/list.txt | gpg --verify
        if everything is okay it should return

    gpg: Signature made Sat 29 Sep 2012 06:12:36 PM IST using RSA key ID C06DD6B0
    gpg: Good signature from Thejesh GN (Thej) <i@thejeshgn.com>

=================== LIST OF AVAILABLE FILES ========================

    local(' echo "'+intro_txt+'"  > index.txt ')
    local('s3cmd ls s3://text.thejeshgn.com >> index.txt')
    local("sed -i 's/s3:/http:/' index.txt")