Skip to content

Instantly share code, notes, and snippets.

@goldenboy
goldenboy / gmaildomain.py
Created December 3, 2011 09:21 — forked from dstevensio/gmaildomain.py
Python Script To Add DNS Overrides For WebFaction Hosted Domains to use Google Apps Mail
'''
Run this script either by doing:
python gmaildomain.py
And you will be prompted for details, or you can save time by doing:
python gmaildomain.py WEBFACTION_USERNAME_HERE DOMAIN_TO_USE_GMAIL_FOR_HERE_WITHOUT_WWW
And you will only be prompted for your password.
@goldenboy
goldenboy / apps.py
Created December 3, 2011 09:34 — forked from code/apps.py
class App(object):
def __init__(id, name,
default=False, selected=False, groups=['misc'],
description="", icon="app-icons_default.png"):
self._id = id
self._name = name
self._groups = groups
self._default = default
self._selected = selected
@goldenboy
goldenboy / rename_google_apps.py
Created December 3, 2011 09:58 — forked from colinramsay/rename_google_apps.py
Change the username of one or more Google Apps users in your domain
import gdata.apps.service
service = gdata.apps.service.AppsService(email="admin@mydomain", domain="mydomain.com", password="password")
service.ProgrammaticLogin()
names = {'from':'to'}
for current, change_to in names.iteritems():
user_entry = service.RetrieveUser(current)
@goldenboy
goldenboy / google_login
Created December 3, 2011 10:03 — forked from dugger/google_login
Google Apps Login Link
<a href="https://www.myhaikuclass.com/do/openid/google?openid_identifier=your_google_domain.com" target='_blank'>
Sign In with your Google Apps Account
</a>
@goldenboy
goldenboy / gist:1426741
Created December 3, 2011 10:04 — forked from ion1/gist:344284
DNS records for Google Apps
@ MX 10 aspmx.l.google.com.
MX 20 alt1.aspmx.l.google.com.
MX 20 alt2.aspmx.l.google.com.
MX 30 aspmx2.googlemail.com.
MX 30 aspmx3.googlemail.com.
MX 30 aspmx4.googlemail.com.
MX 30 aspmx5.googlemail.com.
TXT "v=spf1 include:aspmx.googlemail.com ~all"
;
_xmpp-server._tcp SRV 5 0 5269 xmpp-server.l.google.com.
@goldenboy
goldenboy / configuration.yml
Created December 3, 2011 10:05 — forked from masom/configuration.yml
Email setup for google apps
production:
email_delivery:
delivery_method: :async_smtp
smtp_settings:
tls: true
enable_starttls_auto: true
address: "smtp.gmail.com"
port: '587'
domain: "smtp.gmail.com"
authentication: :plain
@goldenboy
goldenboy / google_hosts
Created December 3, 2011 10:06 — forked from agate/google_hosts
Hosts for google apps in China
203.208.46.166 www.google.com
203.208.46.166 www.google.com.hk
203.208.46.166 encrypted.google.com
203.208.46.166 encrypted.google.com.hk
203.208.46.166 mail.google.com
203.208.46.166 webcache.googleusercontent.com
203.208.46.166 plus.google.com
203.208.46.166 talkgadget.google.com
203.208.46.166 picasaweb.google.com
203.208.46.166 feedproxy.google.com
@goldenboy
goldenboy / microformats.py
Created December 8, 2011 20:57 — forked from k0001/microformats.py
Python microformats parser that supports hCard, hCalendar, hResume and rel-tag and provides an extensible model for other microformats.
# -*- coding: utf-8 -*-
#!/usr/bin/env python
"""
Model for microformat properties and parsers. A microformat parser can
parse an HTML element into a dictionary of properties, whose keys are
strings and whose values are strings or other dictionary of properties.
As an example, the main program of this script parses an hResume from
given URL.
@goldenboy
goldenboy / web2py-pythonanywhere-wsgi.py
Created January 30, 2012 07:07
1 Minute install WEB2PY on PythonAnywhere
# source: web2py.pythonanywhere.com
# ---------------------------------
# web2py IDE and Hosting on PythonAnywhere.com
# 1 Minute install
#
# '/home/web2py' is my home dir and 'web2py' my username
# 'unzip web2py_src.zip' on home and I get
# path='/home/web2py/web2py'
# Now in path is 'web2py.py' and other source '.py' files
# EDIT file 'var/www/wsgi.py'
@goldenboy
goldenboy / install-web2py-pythonanywhere.sh
Created January 30, 2012 07:12
Bash script to install web2py on pythonanywhere.com (web2py.pythonanywhere.com)
cd ~
wget -O web2py_src.zip http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
echo "
PATH = '/home/"`whoami`"/web2py'
import os
import sys
sys.stdout = sys.stderr
os.chdir(PATH)
if not './' in sys.path[:1]: sys.path.insert(0,'./')