Avatar
Rif'at Ahdi R
2b67e480b7f99d2835684a8f7276d86edbe8e318ea55cf77ccfd559c5f24f645
Special family-friendly relay with filter settings (Language, Safe For Work, Hate speech, Sentiment, Topic, etc) for Global Feed: https://github.com/atrifat/nostr-filter-relay/blob/main/USAGE.md wss://nfrelay.app Indonesian. Learning and interested in PHP, JS, Go, DevOps, Android, and Machine Learning
Replying to Avatar mattn

GitHub ใซใพใ‚‹ใฃใจใ‚ฝใƒผใ‚นใ‚’็ฝฎใใ€ใŒ git commit ใ‹ใ‚‰ใชใฎใ‹ใ€push ใ‹ใ‚‰ใชใฎใ‹ใซใ‚ˆใ‚Šใพใ™ใญใ€‚ใพใ  git commit ใ™ใ‚‰ใ—ใฆใ„ใชใ„ใฎใงใ‚ใ‚Œใฐ

$ git init

$ git add .

$ git commit -a -m "first import"

ใจใ™ใ‚Œใฐใ‚ˆใ„ใงใ™ใ€‚ใŸใ ใ—ใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชๅ†…ใซๅ…ฌ้–‹ใ—ใฆใฏใ„ใ‘ใชใ„ๆง˜ใชใƒ•ใ‚กใ‚คใƒซใŒ็„กใ„ใ‹ใฏ็ขบ่ชไธ‹ใ•ใ„ใ€‚ใ„ใฃใ‹ใ„ push ใ—ใกใ‚ƒใ†ใจๅ–ใ‚Šๆถˆใ™ใฎใŒๅคงๅค‰ใซใชใ‚Šใพใ™ใ€‚

ใ‚ณใƒŸใƒƒใƒˆใŒๅ‡บๆฅใŸใ‚‰ push ใงใ™ใŒใ€GitHub ใฎใƒšใƒผใ‚ธใงใƒชใƒใ‚ธใƒˆใƒชใ‚’ไฝœใ‚‹ๆ‰‹้ †้€šใ‚Šใซใ‚„ใฃใฆใ‚‚ใ„ใ„ใ‚“ใงใ™ใŒใ€ๅƒ•ใฏ gh ใจใ„ใ†ใ‚ณใƒžใƒณใƒ‰ใ‚’ไฝฟใฃใฆใ„ใพใ™ใ€‚ใ“ใฎใ‚ณใƒžใƒณใƒ‰ใ‚’ไฝฟใ†ใจใ€ๆ—ขใซ git ใง็ฎก็†ใ•ใ‚ŒใŸใƒญใƒผใ‚ซใƒซใƒชใƒใ‚ธใƒˆใƒชไธŠใง

$ gh create

ใ‚’ๅฎŸ่กŒใ™ใ‚‹ใ ใ‘ใงใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชๅใ‹ใ‚‰ใƒชใƒใ‚ธใƒˆใƒชใ‚’ไฝœใฃใฆ git ใฎ remote ใ‚‚็™ป้Œฒใ—ใฆใใ‚Œใ‚‹ใฎใง

$ gh create

$ git push origin main

ใ ใ‘ใง push ใงใใพใ™ใ€‚

mattnใ•ใ‚“ใ€ใ‚ใ‚ŠใŒใจใ†ใ”ใ–ใ„ใพใ™ใ€‚ feed2nostr ใงใฎ็งใฎๆœ€ๅˆใฎ PR ใ‚’ๅ—ใ‘ๅ…ฅใ‚Œใฆใ„ใŸใ ใใพใ—ใŸใ€‚ใ“ใ‚ŒใŒ็งใฎใ‚ชใƒผใƒ—ใƒณใ‚ฝใƒผใ‚นใฎๆ—…ใฎๅง‹ใพใ‚Šใงใ™ใ€‚ใจใฆใ‚‚ๆ„Ÿ่ฌใ—ใฆใ„ใพใ™ ๐Ÿ™‚

Oh jadi lebih stabil pake API itu? Lebih ok buat 'nyamar' ๐Ÿ˜„

Oh kirain duluan ๐Ÿ˜„

Sering update om buat ytmous? Kalo gak salah Youtube cukup sering ngerubah api mereka kan ya biar gak gampang discrape sama 3rd party (ytmous, invidious, yt-dlp, newpipe, dkk)? Ane inget newpipe pernah gak bisa dipake bentar gara-gara youtube update kode ๐Ÿ˜…

Males males gitu aja bisa buat banyak proyek ๐Ÿ˜„

ytmous mirip invidious ya? Tapi lebih duluan ytmous dari invidious?

Replying to Avatar Yonle

I also made other projects.

- ytmous - Lightweight YouTube proxy

https://github.com/ytmous/ytmous

- Novelscript - Small, simple, extensive novel script engine

https://github.com/Yonle/novelscript

- Toard/Tird - An imageboard

https://github.com/Yonle/Tird

(Also on my web: https://yonle.lecturify.net/discover.html )

- Live-Repeater - Livestream repeater / proxy

https://github.com/Yonle/live-repeater

(And other ... probably)

Udah berapa lama aktif proyek open source om? Banyak proyeknya ๐Ÿ‘€

^ True

I find putting an open source ROM on an older phone makes them run much faster. Especially Samsung's! Even a Galaxy S5 can have up-to-date #Android using https://lineageos.org/

And Amethyst flies on this old Pixel 5 I'm typing on. Flies straight into a segfault sometimes, but that's what "app under active development" actually means :-p

Yes, LineageOS is really great especially for older phones which usually don't have support for GrapheneOS. I wish my phone are supported by LineageOS ๐Ÿ˜…

I see. So the "point" you bring is related to "point" in physics. I thought it is about how dot symbol (46 in ASCII) represents "point" in computer display which shape is actually 2d round object or almost near round object if we print it ๐Ÿ˜…

What if we look the "point" in microscopic or even atomic level? Maybe the "point" will be shown as an irregular 2d or 3d object that just too small so we perceive it as 1d object ๐Ÿ˜…

Yes it is still working, if i'm not mistaken the minimum version required is Android 8.0. But yeah, older phone usually have low cpu performance so it is quite slow and much lag ๐Ÿ˜…

Android has similar problems. Even Amethyst sometimes makes my phone quite hot. Sorry, my phone is not that powerful ๐Ÿ˜…

There are lighweight alternatives such as Yana, Nostrmo, and Nozzle for Android.

Not sure if it is the same case that you want

Usually i just redirect stdout and stderr to proper files:

```

cat filetoread.log | while read -r line;do

echo $line | another_script.sh 1>>/tmp/stdout.log 2>>/tmp/stderr.log

done

```

and run another script tail the error log:

```

tail -F /tmp/stderr.log | while read -r line;do

echo $line | do_whatever.sh

done

```

PSA:

Public demo instance of nostr-filter-relay wss://nostr-id-relay.hf.space will be restarted shortly for 5-10 minutes at November 6, 2023 04:00:00 UTC. Temporary downtime for code update and small improvements. This updates should also make relay handle better websocket connections.

Starting from this week, i will also continue development to implement planned features such as:

- Sentiment analysis

- Hate speech detection

- Topic classification

Any suggestion? If you have found some problems during testing, please let me know. Thank you.

The difference between NIP-46 and how amber sign event is NIP-46 need signer to be 'online' while amber implementation is 'offline' signer right? I think based on that you can probably write new NIP.

> amber is android signer

I think this can be generalized. iOS probably can do similar things like amber uses android intents. Maybe there is similar mechanism. Probably need someone to make amber for iOS first though ๐Ÿ˜…

Did you connect using VPN? Maybe it can helps

Currently, I can connect and get stable connection to relays only when i'm using VPN. Direct connection using my ISP has some problems, easy to disconnect.

May Allah swt grant you with having a good and beautiful family here and hereafter ๐Ÿ™‚

I wish i can make it too

Today i learned that there are another contender to challenge the throne of Node.js modules as 'the heaviest object' in universe which are Python AI/ML dependencies.

You can try with:

pip install --no-cache-dir detoxify pandas Flask

and build docker image using those dependencies. ๐Ÿ˜…

Is there anyone know the tricks to solve that whenever you need to deploy and need those dependencies for your apps?

#asknostr #python #machinelearning

Yes, i think i will prefer this way since not every posts always stay in one language. It just needs good UI so it won't bother common users. They can manually or use auto detected language as default language value before posting. NIP-32 allows regular notes to embed 'l tag' to mark the language

Ideally, it needs to be implemented in some clients as part of their on-boarding process. Unfortunately, i think most clients even don't have clear/good on-boarding steps for new users. If user can pick their language preference (speak) correctly then we can use those with NIP-32 to include language tag in each notes. ๐Ÿ˜…

Replying to Avatar nym

The problem you're discussing is a Sybil attack against a Web of Trust. Here, malicious bots gain trust by connecting to trusted nodes and then abuse that trust for various nefarious activities. This is a significant concern for decentralized systems where centralized identity verification is not possible.

Countermeasures:

1. Trust Decay: Reduce trust over time unless it's reaffirmed.

2. Behavioral Analysis: Use ML to differentiate bots from humans.

3. Multi-Factor Authentication: Require additional verification steps.

4. Trust Isolation: Make it hard for trust to propagate freely.

5. Manual Review: Require human oversight for high-trust status.

6. Rate Limiting: Limit the speed of follower gains to slow down bots.

7. Alerting: Flag nodes gaining trust too quickly.

8. Blacklisting: Block known malicious nodes.

Python Libraries:

1. NetworkX: Useful for graph-based trust networks.

2. Scikit-learn: For implementing machine learning-based bot detection.

3. PyOTA: Useful for decentralized trust networks.

Sample Code:

Here's a Python snippet to implement trust decay in a trust network.

```python

import time

import networkx as nx

G = nx.Graph() # Graph for WoT

G.add_edge('A', 'B', trust=1.0, last_verified=time.time()) # Edge between A and B

def decay_trust(G, node1, node2, decay_factor=0.99):

edge = G[node1][node2]

elapsed_time = time.time() - edge['last_verified']

edge['trust'] *= decay_factor ** elapsed_time

edge['last_verified'] = time.time()

decay_trust(G, 'A', 'B') # Decay trust between A and B

```

Thank you nym (and GPT/LLM if they were used) for the responses. We can see that it is really challenging to make a robust and complex Web of Trust in decentralized network. Such a big homework for relay operator and clients developer to solve all of the issueย ๐Ÿ˜…

Replying to Avatar Sebastix

What are the best practices to handle languages on notes? Is this implemented on the protocol level or is it something a client should care of?

For example I'm wondering how I can filter notes and other events on just a specific language. Finding content in my native language is really hard at the moment.

I've found these related NIP proposals (I'm also a Mastodon user):

https://github.com/nostr-protocol/nips/pull/632

This seems somewhat more complicated and it's only the relay which can set the language for a specific event? I think it should be set by user / client and the relay feedback could be used as a fallback (but on the other hand: this makes relay smarter which have to kept as dumb as possible).

https://github.com/arthurfranca/nips/blob/nip-17/17.md#language

#askNostr #devNostr #NostrDev

We have to filter and classify on our own since no guideline probably to cover that ๐Ÿ˜…

Yes, nostr-filter comments come from upstream (imksoo/nostr-filter), haven't touch any of those yet. imksoo-san primarily makes this mainly for their Japanese relay at first. I can understand a bit based only on the code written ๐Ÿ˜‚

Thank you, hopefully the code will be quite easy to read, please bear with me if it is not quite clean ๐Ÿ˜…

Thank you. Yes, it acts like frontend proxy before forwarding any request into the backend (strfry internal relay). However, RELAYS_SOURCE determines where to fetch/aggregate Nostr events (kind 1) before classifying them into various category and send them into target relay (strfry internal relay). UPSTREAM_WS_URL is the correct one for settings which relay to be the target of proxy. I have run several tools in this docker image, maybe it makes a bit confusing ๐Ÿ˜…

Yes, it will be easier to use those libraries to start nostr project instead of writing all the things from scratch ๐Ÿ‘

Probably you have a higher chance to make it ๐Ÿ˜„

Hello #nostr, this is my first note, after mostly lurking as silent reader for a while ๐Ÿ˜„

Happy to introduce my first nostr project, https://github.com/atrifat/nostr-filter-relay , an aggregator filter relay which classify notes/posts into various category. This relay can be used mainly as "Global" relay in nostr clients, helping users to filter their global feed.

Currently, it has already several filtering features (also planned features listed):

- Language detection

- Not SFW or SFW image content detection

- User type filtering (Nostr non-bridged/regular user, activitypub/mostr pub bridged user)

- (Planned) Sentiment analysis

- (Planned) Topic classification

- (Planned) Hate speech detection

Feel free to check "USAGE" docs in Github for more information and examples on how to use the relay.

There is a public demo (beta/test) relay wss://nostr-id-relay.hf.space for those who can't run their own nostr-filter-relay software. Feel free to test the relay, although the performance is not always guaranteed, since this is only a test server.