Shadow

joined 2 years ago
MODERATOR OF
[–] Shadow 8 points 1 day ago (4 children)

I want to enjoy it, but I've tried multiple times and I just can't make it through.

[–] Shadow 25 points 1 day ago (1 children)

Oracle. We weren't even a customer. We just had an ip space with a bunch of customers on it. Yhey tried to claim we needed to pay for all their virtualbox downloads since we weren't a home isp.

[–] Shadow 18 points 2 days ago (1 children)

Yeah, feels like a child's drawing or something.

[–] Shadow 11 points 2 days ago* (last edited 2 days ago)

Interesting, I've got some reading to do. Thanks for the links.

[–] Shadow 15 points 2 days ago* (last edited 2 days ago) (2 children)

FYI I saw the same deadlocks on lemmy.ca when I tried to do a similar hot upgrade, which seems odd since that alter is innocuous enough.

80
submitted 2 days ago* (last edited 2 days ago) by Shadow to c/main
 

For anyone that noticed the 30 seconds of downtime a few minutes ago, that was to upgrade us to lemmy 0.19.10.

Changes are listed here - https://join-lemmy.org/news/2025-03-19_-_Lemmy_Release_v0.19.10_and_Developer_AMA

This is not the version with breaking API changes, there should be no impact to any clients.

Enjoy!

[–] Shadow 45 points 3 days ago (1 children)

I want to see him hang up on Trump if/when he calls him "governor", and then publish the phone call.

35
RIP mcbarge (www.ctvnews.ca)
submitted 3 days ago by Shadow to c/vancouver
 

F

[–] Shadow 55 points 4 days ago* (last edited 4 days ago) (3 children)

That's a massive drop!

[–] Shadow 9 points 5 days ago

Please tell me your cat is named Dhalsim

[–] Shadow 6 points 5 days ago (1 children)

I pasted a specific screenshot elsewhere in this thread showing how to filter on just requests with a range header

[–] Shadow 11 points 5 days ago (1 children)

Turns out cloudflare was responsible for breaking the 206 range requests for lemmy.ca, and probably quite a few of these other broken sites too.

Here's how to fix with a caching rule:

[–] Shadow 12 points 6 days ago

You know what they say, life's a bitch and then you die.

56
Magic smoke (en.wikipedia.org)
12
submitted 2 weeks ago* (last edited 2 weeks ago) by Shadow to c/[email protected]
 

cross-posted from: https://lemmy.ca/post/40761824

Sorry everyone I know how much you love the attention she gives you, but I've implemented some quick and dirty filtering for private messaging.

We now have the ability to automatically mark PM's as deleted or read, depending on content inside of them. If we accidentally filter something you legitimately wanted (ie, not Nicole) please let me know.

If any other instances would like to implement this, here's the code. Note that you'll need to set your hostname at the top here for some reason I haven't exactly identified.

SET lemmy.protocol_and_hostname = 'https://lemmy.ca/';

CREATE TABLE private_message_filters (
    id SERIAL PRIMARY KEY,
    phrase TEXT NOT NULL,
    behavior VARCHAR(10) NOT NULL CHECK (behavior IN ('delete', 'mark_read'))
);

CREATE OR REPLACE FUNCTION filter_private_messages()
RETURNS trigger AS $$
DECLARE
    banned_phrase_record private_message_filters%ROWTYPE;
BEGIN
    FOR banned_phrase_record IN 
        SELECT * FROM private_message_filters
    LOOP
        IF LOWER(TRIM(NEW.content)) ILIKE '%' || LOWER(TRIM(banned_phrase_record.phrase)) || '%' THEN
            IF banned_phrase_record.behavior = 'delete' THEN
                NEW.deleted := true;
                RETURN NEW;
            ELSIF banned_phrase_record.behavior = 'mark_read' THEN
                NEW.read := true;
                RETURN NEW;
            END IF;
        END IF;
    END LOOP;
    RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER trg_filter_private_messages
AFTER INSERT ON private_message
FOR EACH ROW
EXECUTE FUNCTION filter_private_messages();

To add filter words:

insert into private_message_filters (behavior, phrase) values ('delete', 'spamtestdelete');
insert into private_message_filters (behavior, phrase) values ('mark_read', 'spamtestread');

If you want to quickly disable / enable filtering while testing:

ALTER TABLE private_message DISABLE TRIGGER trg_filter_private_messages;
ALTER TABLE private_message ENABLE TRIGGER trg_filter_private_messages;

I'll leave it up to you to figure out what phrases to filter on. MAKE SURE YOU TEST. If there's an error, private messaging could break completely. You should not get an error message from the UI while sending a message with a banned word.

Edit: I like flamingos-cant's solution here better: https://lemmy.ca/post/40761824/15209462

166
submitted 2 weeks ago* (last edited 2 weeks ago) by Shadow to c/main
 

Sorry everyone I know how much you love the attention she gives you, but I've implemented some quick and dirty filtering for private messaging.

We now have the ability to automatically mark PM's as deleted or read, depending on content inside of them. If we accidentally filter something you legitimately wanted (ie, not Nicole) please let me know.

If any other instances would like to implement this, here's the code. Note that you'll need to set your hostname at the top here for some reason I haven't exactly identified.

SET lemmy.protocol_and_hostname = 'https://lemmy.ca/';

CREATE TABLE private_message_filters (
    id SERIAL PRIMARY KEY,
    phrase TEXT NOT NULL,
    behavior VARCHAR(10) NOT NULL CHECK (behavior IN ('delete', 'mark_read'))
);

CREATE OR REPLACE FUNCTION filter_private_messages()
RETURNS trigger AS $$
DECLARE
    banned_phrase_record private_message_filters%ROWTYPE;
BEGIN
    FOR banned_phrase_record IN 
        SELECT * FROM private_message_filters
    LOOP
        IF LOWER(TRIM(NEW.content)) ILIKE '%' || LOWER(TRIM(banned_phrase_record.phrase)) || '%' THEN
            IF banned_phrase_record.behavior = 'delete' THEN
                NEW.deleted := true;
                RETURN NEW;
            ELSIF banned_phrase_record.behavior = 'mark_read' THEN
                NEW.read := true;
                RETURN NEW;
            END IF;
        END IF;
    END LOOP;
    RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER trg_filter_private_messages
AFTER INSERT ON private_message
FOR EACH ROW
EXECUTE FUNCTION filter_private_messages();

To add filter words:

insert into private_message_filters (behavior, phrase) values ('delete', 'spamtestdelete');
insert into private_message_filters (behavior, phrase) values ('mark_read', 'spamtestread');

If you want to quickly disable / enable filtering while testing:

ALTER TABLE private_message DISABLE TRIGGER trg_filter_private_messages;
ALTER TABLE private_message ENABLE TRIGGER trg_filter_private_messages;

I'll leave it up to you to figure out what phrases to filter on. MAKE SURE YOU TEST. If there's an error, private messaging could break completely. You should not get an error message from the UI while sending a message with a banned word.

 

You just end up creating an desolate community full of noise, since the op will never see the replies.

It hurts lemmy users who don't realize this and wonder why there's no engagement.

For example: https://lemmy.ml/comment/17284093

Blindly copying posts from reddit is not the way to grow a healthy lemmy community.

135
submitted 2 weeks ago by Shadow to c/main
 

Sorry for the downtime! Unfortunately our secondary firewall took over for some reason, and haproxy failed to properly come up.

I'll be scheduling a maintenance window in the next few days to do some further digging, so I can make sure this is fully resolved.

19
Locust Plague of 1874 (en.m.wikipedia.org)
submitted 3 weeks ago by Shadow to c/[email protected]
44
We Are Canadian (www.youtube.com)
submitted 3 weeks ago by Shadow to c/canada
view more: next ›