Skip to content

Instantly share code, notes, and snippets.

@axavio
axavio / gist:1936719
Created February 29, 2012 01:10
Error trying to delete contact
One that crashes from share_visibilities:
ActiveRecord::InvalidForeignKey (PGError: ERROR: update or delete on table "contacts" violates foreign key constraint "share_visibilities_contact_id_fkey" on table "share_visibilities"
DETAIL: Key (id)=(2123) is still referenced from table "share_visibilities".
: DELETE FROM "contacts" WHERE "contacts"."id" = 2123):
lib/diaspora/user/connecting.rb:49:in `remove_contact'
lib/diaspora/user/connecting.rb:69:in `disconnect'
app/models/aspect_membership.rb:14:in `_callback_before_683'
app/controllers/aspect_memberships_controller.rb:20:in `destroy'
lib/chrome_frame.rb:39:in `call'
@axavio
axavio / gist:2019340
Created March 12, 2012 02:29
Weird Reshare Error
Started GET "/stream" for 68.4.205.245 at Mon Mar 12 02:24:16 +0000 2012 pid=10007 time=1331519056
Processing by MultisController#index as HTML pid=10007 time=1331519056
Rendered aspects/_aspect_listings.haml (249.9ms) pid=10007 time=1331519056
Rendered tags/_followed_tags_listings.haml (65.6ms) pid=10007 time=1331519056
Rendered shared/_public_explain.haml (3.4ms) pid=10007 time=1331519056
Rendered photos/_new_photo.haml (1.5ms) pid=10007 time=1331519056
Rendered shared/_publisher.html.haml (22.6ms) pid=10007 time=1331519056
Rendered aspects/_no_posts_message.haml (0.4ms) pid=10007 time=1331519056
Rendered status_messages/_status_message.html.haml (3.5ms) pid=10007 time=1331519057
Rendered likes/_likes_container.haml (0.3ms) pid=10007 time=1331519057
@axavio
axavio / gist:2212971
Created March 27, 2012 05:52
Sample bot-post delete SQL for Diaspora
### Use at your own risk! ###
No warranty is implied.
This is a sample set of SQL statements (2 to be exact) that will delete old posts from bots on Diaspora pod.
It is intended as a starting point for more sophisticated scripts. Everything is hard-coded right now.
1. It is for PostgreSQL.
2. It will delete posts (and their taggings) from the bots [email protected], [email protected], and
@axavio
axavio / gist:3028885
Created July 1, 2012 16:34
Dump Single Diaspora User's Stuff
# Handy commands to download a single user's data from a diaspora database by the podmin
#
# These are strictly manual. No attempt is made to make things nice for a production
# environment where these scripts/commands might by run frequently.
#
# Original Source: gist by Pistos for posts and comments
#
# Caveats:
#
# POSTGRESQL ONLY! The psql command may be modified to a mysql command, but the flags/options are likely very different