[-] Shadow@lemmy.ca 13 points 1 day ago

Hey now, thats not how we communicate on this instance.

[-] Shadow@lemmy.ca 1 points 1 day ago

Right, I misread the subject.

Paraquat causes Parkinson's. Glyphosate most likely causes diseases too.

[-] Shadow@lemmy.ca 3 points 1 day ago

Yes exactly. It might pull something like 5 - 20 watts if I had to guess.

[-] Shadow@lemmy.ca 5 points 1 day ago

The UPS only draws significant additional power when charging up. Otherwise it would have a negligible power draw. Just add up your devices.

15
DIY X-ray Machine (www.youtube.com)
submitted 1 week ago by Shadow@lemmy.ca to c/videos@lemmy.world
30
submitted 1 week ago by Shadow@lemmy.ca to c/canada@lemmy.ca
12
submitted 1 week ago by Shadow@lemmy.ca to c/world@lemmy.world
152
submitted 1 month ago by Shadow@lemmy.ca to c/canada@lemmy.ca
12
submitted 1 month ago* (last edited 1 month ago) by Shadow@lemmy.ca to c/lemmy@lemmy.ml

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

1
submitted 1 month ago* (last edited 1 month ago) by Shadow@lemmy.ca to c/main@lemmy.ca

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.

91
submitted 1 month ago by Shadow@lemmy.ca to c/canada@lemmy.ca
1
submitted 1 month ago by Shadow@lemmy.ca to c/main@lemmy.ca

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.

44
We Are Canadian (www.youtube.com)
submitted 1 month ago by Shadow@lemmy.ca to c/canada@lemmy.ca
151
submitted 1 month ago by Shadow@lemmy.ca to c/canada@lemmy.ca
1
submitted 2 months ago by Shadow@lemmy.ca to c/main@lemmy.ca

Sorry about the brief downtime there!

Wasn't related to the new users or high load, but was a combination of two problems:

  1. Our fw02 took over for some reason TBD
  2. Opnsense isn't keeping haproxy configs in sync and fw02 had a broken config

Still digging into the root cause, but shouldn't be any more issues =)

1
submitted 2 months ago by Shadow@lemmy.ca to c/main@lemmy.ca

Just a heads up that we're now running on lemmy 0.19.9.

Change log here - https://lemmy.ca/post/38913840

[-] Shadow@lemmy.ca 140 points 7 months ago* (last edited 7 months ago)

So, I worked on this. I built their in game support system (irc backed!), wrote a bunch of the web auth code, and accidentally once deleted the production user database from the secondary site (whew, disabled and re-replicated from primary).

It was a lot of fun and got me a trip to E3 back when it was the big thing.

It was an interesting concept because no matter what, you would play the american side and fight the terrorists. (you would look like a terrorist to the other team)

[-] Shadow@lemmy.ca 220 points 8 months ago

Sounds like they could use some more sites linking to them to improve SEO. https://clownstrike.lol/

[-] Shadow@lemmy.ca 133 points 8 months ago

https://en.m.wikipedia.org/wiki/Steven_van_de_Velde

Under a treaty between the Netherlands and UK, Van de Velde was transferred to the Netherlands to serve his sentence. The sentence was at that time adjusted in line with Dutch law, and the charge of rape was substituted for that of fornication.[11] After serving a year of his original four year sentence, he was released from prison.[8]

So basically the Dutch think it's ok for a 19 year old to get a 12 year old drunk and rape her.

The victim would eventually go on to self-harm and once overdosed.

Some people are saying it ok because it was consensual, this doesn't make it sound very consensual to me.

Wtf.

[-] Shadow@lemmy.ca 125 points 11 months ago

Oh fuck yes, finally.

[-] Shadow@lemmy.ca 237 points 1 year ago

Before everyone gets their pitchforks out - Person from the image posted on Hacker News, CEO replied and said this charge shouldn't have happened and they wouldn't be charging the client anything.

https://news.ycombinator.com/item?id=39520776

[-] Shadow@lemmy.ca 199 points 1 year ago* (last edited 1 year ago)

I personally hate all the reddit cross post stuff, and it seems like the majority of lemmy users do too. I don't understand why people obsess over this as a way to "grow" lemmy.

It doesn't contribute to active conversations, in fact it deters users who reply locally and then never get a response.

Just let lemmy grow organically by making good content and contributing, stop forcing it with mirrors from reddit.

I wonder if we could get the top admins to threaten defederation with any instance that doesn't flag automated posts as bots. This way at least the users have some visibility.

[-] Shadow@lemmy.ca 140 points 2 years ago

This is pretty normal, you get a surge of users and then it tapers off a bit as people don't like it.

Could be a lot worse, take a look at the user graph for threads.

view more: next ›

Shadow

joined 2 years ago
MODERATOR OF