Skip to content

Instantly share code, notes, and snippets.

@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
@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 rss_bot@pod.fractal.bz, spambot@c0unt.org, and
@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: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:1896884
Created February 24, 2012 03:02
Diaspora error when trying to ignore someone
Started POST "/blocks?block[person_id]=5406" for 68.4.205.245 at Fri Feb 24 02:56:41 +0000 2012 pid=28521 time=1330052201
Processing by BlocksController#create as HTML pid=28521 time=1330052201
Parameters: {"authenticity_token"=>"/MLWI/xa2vE/hJH+fqsQSwGbgTZk7z0znP72UDW8+nc=", "block"=>{"person_id"=>"5406"}} pid=28521 time=1330052201
event=disconnect user=davey@calispora.org target=perspicacious01@diasp0ra.ca pid=28521 time=1330052201
Completed 500 Internal Server Error in 244ms pid=28521 time=1330052201
** [Hoptoad] Failure: Net::HTTPClientError pid=28521 time=1330052201
** [Hoptoad] Environment Info: [Ruby: 1.8.7] [Rails: 3.0.11] [Env: production] pid=28521 time=1330052201
** [Hoptoad] Response from Hoptoad:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
@axavio
axavio / gist:1861031
Created February 18, 2012 21:11
Diaspora Federation Tests
Diaspora Federation Tests
Background:
A limited post with a photo and a limited post without a photo are send out from each of 5 pods
and should be seen by accounts on the remaining pods (a 5-way pool). Results are checked after
30 minutes. Federation FAILS are shown below. Otherwise, it should be assumed the federation
succeeded.
Pods: calispora.org, diasp0ra.ca, diasp.eu, diasp.org, and joindiaspora.com
The first two pods are running a variation of diaspora-pistos.
@axavio
axavio / gist:1802593
Created February 11, 2012 17:16
chat error
ActiveRecord::StatementInvalid in MultisController#index
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read = 1
) ORDER BY id DESC LIMIT 5' at line 6: SELECT `chat_messages`.* FROM `chat_messages` WHERE (
(
recipient_id = 3 AND author_id = 2
OR recipient_id = 2 AND author_id = 3
)
AND read = 1
) ORDER BY id DESC LIMIT 5
<div class='photo_attachments'>
<div class='big_stream_photo'>
<a href="/photos/12407" class="stream-photo-link"><img alt="Scaled_full_a32b35eb0af40faeed63" class="stream-photo" data-full-photo="https://calispora.s3.amazonaws.com/uploads/images/a32b35eb0af40faeed63.png" data-small-photo="https://calispora.s3.amazonaws.com/uploads/images/thumb_medium_a32b35eb0af40faeed63.png" src="https://calispora.s3.amazonaws.com/uploads/images/scaled_full_a32b35eb0af40faeed63.png" /></a>
</div>
</div>
<div class='ltr '>
@axavio
axavio / gist:1638290
Created January 19, 2012 06:09
Pistos/diaspora Issue #30: Switch from ILIKE to LOWER()'ed LIKE in Search Own Posts
search own comments and posts:
ISSUE:
This was giving a 500 error on my pod running mysql:
for example, where the query was for "single":
Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ILIKE '%single%') ORDER BY created_at desc LIMIT 30' at line 1: SELECT `posts`.* FROM `posts` WHERE (`posts`.author_id = 1) AND (text ILIKE '%single%') ORDER BY created_at desc LIMIT 30
@axavio
axavio / maxwell-robhogg-nsfw-shield.patch
Created January 17, 2012 16:56
maxwell-robhogg-nsfw-shield
From 39a86ebc2c91a6cbb4f27b7555be9c208d437d1d Mon Sep 17 00:00:00 2001
From: Dave Yingling <david.yingling@gmail.com>
Date: Tue, 17 Jan 2012 08:53:33 -0800
Subject: [PATCH] add nsfw shield by ms and rh
---
app/helpers/stream_element_helper.rb | 8 ++++++++
app/models/status_message.rb | 5 +++++
app/views/shared/_stream_element.html.haml | 16 +++++++++-------
.../status_messages/_status_message.html.haml | 1 -