This file contains 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 | |
""" | |
A script to query the Amazon Web Services usage reports programmatically. | |
Ideally this wouldn't exist, and Amazon would provide an API we can use | |
instead, but hey - that's life. | |
Basically takes your AWS account username and password, logs into the | |
website as you, and grabs the data out. Always gets the 'All Usage Types' |
This file contains 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
<configure | |
xmlns="http://namespaces.zope.org/zope" | |
xmlns:five="http://namespaces.zope.org/five" | |
xmlns:i18n="http://namespaces.zope.org/i18n" | |
xmlns:browser="http://namespaces.zope.org/browser" | |
xmlns:genericsetup="http://namespaces.zope.org/genericsetup" | |
i18n_domain="sft.theme"> | |
<five:registerPackage package="." initialize=".initialize" /> |
This file contains 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
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyn9B9dr82CcXoGTckQcFU23BtJlR/JGAEmcP+vxED03TQdESMtUGDR75/BCeAXYjPLOYehW4xmCYL4yLSfWtFYTExi0FFE1NBEH5rVURY6ba4SwjtHNHRON1wP7HIIXbbgXjaIJpa7SXWxNNEf3Vp50gGl3oZQ0K718gDWRcEBQ5mTf4/wH0taucDNVrXk2S2XE3wU10eNMAV4drzbb/EZopu2FciI427CgSecT9xvPA33RVxITl4PmA4b1uaJgdh8QkbkaQIYokNPWHbLOTGiG+N+CGk6R2OapWbVOY/ZkY9hVZ+wIuIehspCHSct15wlujN1LiUgNs4bGIRD8cZQ== [email protected] |
This file contains 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
$ psql -d bmabr -f fixcity/sql/gis_community_board.sqlBEGIN | |
psql:fixcity/sql/gis_community_board.sql:9: NOTICE: CREATE TABLE will create implicit sequence "gis_community_board_gid_seq" for serial column "gis_community_board.gid" | |
psql:fixcity/sql/gis_community_board.sql:9: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "gis_community_board_pkey" for table "gis_community_board" | |
CREATE TABLE | |
psql:fixcity/sql/gis_community_board.sql:10: ERROR: AddGeometryColumns() - invalid SRID | |
CONTEXT: SQL statement "SELECT AddGeometryColumn('', $1 , $2 , $3 , $4 , $5 , $6 )" | |
PL/pgSQL function "addgeometrycolumn" line 5 at SQL statement | |
psql:fixcity/sql/gis_community_board.sql:11: ERROR: current transaction is aborted, commands ignored until end of transaction block |
This file contains 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
Traceback (most recent call last): | |
File "/cust/p00000013/bundle_p00000013_2011-03-26-23.09.07/thisbundle.py", line 52, in <module> | |
run_managepy() | |
File "/cust/p00000013/bundle_p00000013_2011-03-26-23.09.07/thisbundle.py", line 37, in run_managepy | |
management.execute_from_command_line() | |
File "/cust/p00000013/bundle_p00000013_2011-03-26-23.09.07/lib/python2.6/site-packages/django/core/management/__init__.py", line 429, in execute_from_command_line | |
utility.execute() | |
File "/cust/p00000013/bundle_p00000013_2011-03-26-23.09.07/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute | |
self.fetch_command(subcommand).run_from_argv(self.argv) | |
File "/cust/p00000013/bundle_p00000013_2011-03-26-23.09.07/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv |
This file contains 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
virtualenv --no-site-packages . | |
source bin/activate | |
bin/pip install Django psycopg2 django-sentry | |
bin/pip freeze > requirements.txt | |
bin/django-admin.py startproject mysite | |
cat >.gitignore <<EOF | |
bin/ | |
include/ | |
lib/ | |
EOF |
This file contains 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 tastypie.resources import ModelResource | |
from valentunes.models import Card, Track | |
class TrackResource(ModelResource): | |
class Meta: | |
queryset = Track.objects.all() | |
resource_name = 'track' | |
class CardResource(ModelResource): |
This file contains 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
class Card(models.Model): | |
""" Card is a valentine's day card that contains the information | |
about who the card is from and who it's to, what the recipients | |
interests are and a personal note. | |
""" | |
user = models.ForeignKey(User) | |
recipient_name = models.CharField(max_length=200, blank=True) | |
recipient_email = models.EmailField(max_length=200, null=True, blank=True) | |
recipient_phone = models.CharField(max_length=200, blank=True) | |
intro_note = models.TextField(max_length=1000, blank=True) |
This file contains 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 vt.valentunes.api import CardResource, TrackResource | |
card_resource = CardResource() | |
track_resource = TrackResource() | |
urlpatterns = patterns('', | |
... | |
(r'^api/', include(card_resource.urls)), | |
(r'^api/', include(track_resource.urls)), |
This file contains 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
class Card(models.Model): | |
""" Card is a valentine's day card that contains the information | |
about who the card is from and who it's to, what the recipients | |
interests are and a personal note. | |
""" | |
user = models.ForeignKey(User) | |
recipient_name = models.CharField(max_length=200, blank=True) | |
recipient_email = models.EmailField(max_length=200, null=True, blank=True) | |
recipient_phone = models.CharField(max_length=200, blank=True) | |
intro_note = models.TextField(max_length=1000, blank=True) |
OlderNewer