Skip to content

Instantly share code, notes, and snippets.

View jheasly's full-sized avatar

John Heasly jheasly

View GitHub Profile
@palewire
palewire / pg_to_rds.sh
Last active July 16, 2018 19:45
Migrate PostgreSQL databases to Amazon RDS
pg_dump -Fc --no-acl --no-owner -h localhost -U <YOUR LOCAL DATABASE USER> <YOUR LOCAL DATABASE NAME> > <YOUR LOCAL DATABASE NAME>.dump;
pg_restore -v -h <YOUR RDS IP ADDRESS> -U <YOUR RDS DATABASE USER> -d <YOUR RDS DATABASE NAME> <YOUR LOCAL DATABASE NAME>.dump;
@jheasly
jheasly / goodies.md
Created November 20, 2012 21:26 — forked from mhulse/How to delete a story from Lightning, for keeps.md
Caché DTI ContentPublisher v7.7.3 and above: dt_cms_schema.SEOStoryLookup SQL goodies!

Add an entry to the SEOStoryLookup table:

INSERT INTO dt_cms_schema.SEOStoryLookup (cmsStoryId, created, internalStoryURL, seoURL, serverName, urlType, version)
VALUES (123456, getDate(),'/csp/cms/sites/publication/section/index.csp', '/some/funky/url.html', 'localhost', 0, 61)

Where:

  • created = When entry it was made. Used mainly for troubleshooting/cleanup (avoid searching on this).
@mhulse
mhulse / How to delete a story from Lightning, for keeps.md
Last active October 13, 2015 01:08
Caché DTI ContentPublisher v7.7.3 and above: dt_cms_schema.SEOStoryLookup SQL goodies!

Update (2013/06/17):

On top of deleting stories from dt_cms_schema.CMSStoryPubTracking and dt_cms_schema.SEOStoryLookup (see below), Craig M. recently discovered that one needs to delete "related" and/or "popular" stories as well.

Find orphaned SEO stories:

select distinct top 100 cmsStoryId as SEO_CMSStoryId from dt_cms_schema.seostorylookup seo where not exists (select pub.CMSStory from dt_cms_schema.CMSStoryPubTracking pub where seo.cmsStoryId = pub.CMSStory) and cmsStoryId is not null;
@dokterbob
dokterbob / admin.py
Created February 15, 2011 20:00
InlineAdmin mixin limiting the selection of related items according to criteria which can depend on the current parent object being edited.
class LimitedAdminInlineMixin(object):
"""
InlineAdmin mixin limiting the selection of related items according to
criteria which can depend on the current parent object being edited.
A typical use case would be selecting a subset of related items from
other inlines, ie. images, to have some relation to other inlines.
Use as follows::