Skip to content

Instantly share code, notes, and snippets.

@mankuthimma
mankuthimma / ll2location.py
Created October 26, 2012 10:23
Latitude, Longitude to Geo Location
# depends on Google's API.
# So, YMMV
import sys
import pycurl
import simplejson as json
class RevCode:
def __init__(self):
self.contents = ''
@mankuthimma
mankuthimma / parsimoney.py
Created November 20, 2011 09:47
Scrape a bunch of html files to generate a pipe separated values file from selected content
from BeautifulSoup import BeautifulSoup
# Files list
afp = open('afp.txt', 'rb')
aes = afp.readlines()
afp.close()
list_o_attrs = ['nm', 'ttl', 'co_nm', 'eml', 'co_url', 'linkedin_url', 'twitter_url', 'bio']
for person in aes:
@mankuthimma
mankuthimma / all-dist-list-sync.sh
Created October 19, 2011 08:53
Shell script to sync all users in a zimbra domain to an org wide distribution list
#!/bin/bash
CURALL=`tempfile`
EMALL=`tempfile`
DIFFY=`tempfile`
ADDLIST=`tempfile`
zmprov -l gaa | sort | uniq > $EMALL
zmprov gdl all@example.com|grep "zimbraMailForwardingAddress:"|sed "s/zimbraMailForwardingAddress: //"|sort|uniq > $CURALL
diff --left-column $CURALL $EMALL | grep example.com | sed "s/> //g" > $DIFFY
diff /opt/zimbra/conf/all_list_ignore $DIFFY|grep example.com|sed "s/<//g"|sed "s/>//g"|sed "s/ //g" > $ADDLIST