https://piefed.social/topics is fun to look through.
Im on the fedi doin fedi things.
- 0 Posts
- 20 Comments
mesa@piefed.socialto
Sysadmin@lemmy.world•sysadmin community on different instancesEnglish
1·7 months agoWelcome. Hope you enjoy your stay.
mesa@piefed.socialto
Lemmy@lemmy.ml•Is there a good way to link to posts and coments?English
2·8 months agoYep! I just clicked om the above post in piefed snd it auto made it work so i can comment using piefed. Its so uncomplicated.
mesa@piefed.socialto
Lemmy@lemmy.ml•Is there a good way to link to posts and coments?English
6·8 months agoNot in lemmy, but on piefed i can comment and link to posts pretty easy. And stay within piefed.
Just made a test post.
Maybe lemmy can piggyback on the work done?
Awesome very nice!!
mesa@piefed.socialto
Sysadmin@lemmy.world•Is classic Outlook becoming worse and worse?English
3·10 months agoIll agree. But just FYI Azure AND aws have recently had downtime which funny enough can effect a lot of things with email. Since email in itself is more html nowadays than anything else. And ive had the same issue with 2FA and timeouts from Azure/cloud exchange. Fun times.
When I retire, im going to look forward to never touching MS product slop again. Should be fun!
from flask import Flask, request, abort from datetime import datetime, timedelta import sqlite3 import logging import os app = Flask(__name__) DB_FILE = "honeypot.db" #LOG_FILE = "/var/log/honeypot.log" LOG_FILE = "honeypot.log" TRAP_THRESHOLD = 3 # clicks before flagging FLAG_DURATION_HOURS = 24 # how long the flag lasts # --- Setup logging for Fail2Ban integration --- #os.makedirs(os.path.dirname(LOG_FILE), exist_ok=True) logging.basicConfig( filename=LOG_FILE, level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s", ) # --- Database setup --- def init_db(): with sqlite3.connect(DB_FILE) as conn: c = conn.cursor() c.execute(""" CREATE TABLE IF NOT EXISTS hits ( ip TEXT, ts DATETIME ) """) c.execute(""" CREATE TABLE IF NOT EXISTS flagged ( ip TEXT PRIMARY KEY, flagged_on DATETIME, expires DATETIME ) """) conn.commit() # --- Helper functions --- def record_hit(ip): now = datetime.utcnow() with sqlite3.connect(DB_FILE) as conn: c = conn.cursor() c.execute("INSERT INTO hits (ip, ts) VALUES (?, ?)", (ip, now)) conn.commit() def get_hit_count(ip): with sqlite3.connect(DB_FILE) as conn: c = conn.cursor() c.execute("SELECT COUNT(*) FROM hits WHERE ip = ?", (ip,)) return c.fetchone()[0] def flag_ip(ip): now = datetime.utcnow() expires = now + timedelta(hours=FLAG_DURATION_HOURS) with sqlite3.connect(DB_FILE) as conn: c = conn.cursor() c.execute("REPLACE INTO flagged (ip, flagged_on, expires) VALUES (?, ?, ?)", (ip, now, expires)) conn.commit() logging.warning(f"HONEYPOT flagged {ip} for {FLAG_DURATION_HOURS}h") # Fail2Ban picks this up def is_flagged(ip): now = datetime.utcnow() with sqlite3.connect(DB_FILE) as conn: c = conn.cursor() c.execute("SELECT expires FROM flagged WHERE ip = ?", (ip,)) row = c.fetchone() if not row: return False expires = datetime.fromisoformat(row[0]) if now < expires: return True # Expired flag, remove it c.execute("DELETE FROM flagged WHERE ip = ?", (ip,)) conn.commit() return False # --- Middleware --- @app.before_request def block_flagged(): ip = request.remote_addr if is_flagged(ip): abort(403, description="Access denied (you have been flagged).") # --- Routes --- @app.route('/') def home(): return ''' <h1>Welcome</h1> <p>Don’t click this unless you are a bot</p> ''' @app.route('/robots.txt') def robots_txt(): return "User-agent: *\nDisallow: /do_not_click\n", 200, {'Content-Type': 'text/plain'} @app.route('/do_not_click') def honeypot(): ip = request.remote_addr if is_flagged(ip): abort(403, description="Access denied (you’ve been flagged).") record_hit(ip) hit_count = get_hit_count(ip) logging.info(f"HONEYPOT triggered by {ip} (count={hit_count})") if hit_count >= TRAP_THRESHOLD: flag_ip(ip) return "You’ve been flagged for suspicious behavior.", 403 return f"Suspicious activity detected ({hit_count}/{TRAP_THRESHOLD})." if __name__ == "__main__": init_db() app.run(debug=True)Here I condensed this down to its parts. Hopefully this works well for you.
/etc/fail2ban/jail.d/honeypot.conf
[honeypot] enabled = true filter = honeypot logpath = /var/log/honeypot.log maxretry = 3 findtime = 86400 # Count hits within 24 hours bantime = 86400 # Ban for 24 hours backend = auto action = iptables-multiport[name=honeypot, port="http,https"]
It works well with fail2ban + nginx just FYI. That and a small DB.
I fail to see how prediction engines can do anything different.
I created a honeypot that is only accessible if they click the “don’t click this unless you are a bot”. If they do after 3 times, poof the IP gets banned for a day. Its worked well.
Simple little flask app. Robots.text as well but only google seems to actually read that and respect it.
mesa@piefed.socialto
Lemmy@lemmy.ml•Is there a way to view posts from a specific date range?English
5·1 year agoMaybe via the api? That would be a cool feature!
mesa@piefed.socialto
Lemmy@lemmy.ml•Lemmy community feedback: Should we fetch and combine comments from cross-posts on the post screen? · Issue #3415 · LemmyNet/lemmy-uiEnglish
6·1 year agoI like the way piefed does it. Have visual separation letting people know where the comment will go.
It would be nice for Lemmy too.
And if we get this, this is something even reddit doesn’t have. A killer feature.
mesa@piefed.socialto
Sysadmin@lemmy.world•How you automate tasks which have a gui app instead of CLI?English
6·1 year agoPython can do it quite well. Look for certain pixels, click if they have a certain value.
As others have said it’s better to use other methods like apis where there is context but it’s definitely doable.
If it’s on the web, I’ve used selenium for years to get around apis and websites that don’t support it.
I crosspost with popular communities. For example peertube@lemmy.world is an awesome place to fine federated videos from across the fediverse ;)
Also become the change you want to see. Post comment ect… Its a community, have fun with others that enjoy the same stuff you do.
Also if you hang out in New, you eventually see things you like and then subscribe.
mesa@piefed.socialto
Lemmy@lemmy.ml•[Discussion] Should Lemmy allow mods/admins to edit user post dataEnglish
9·1 year agoNope. And it wouldn’t work very well with activityhub.
Not everyone who is on Lemmy is actually on the platform. If things get changed retroactively, it will look extremely weird with only Lemmy showing the change but every other fediverse platform showing the original, modlog or not.
At that point, I wouldn’t trust Lemmy all that much anymore.
Edit: ah reread, tags and NSFW might be good for specific communities. Although again activityhub will be the issue.
I thought you were going with editing posts like on reddit that one time. That I’m opposed to.
Piefed already does this to a certain extent. Take a look at the topics: https://piefed.social/topic/arts-craft
It allows each community to stay “independent” but also have their posts come up in one big feed.
Welcome!