dontblink

joined 2 years ago
[–] [email protected] 4 points 12 hours ago

Maybe search engines idk, something like Yucy?

[–] [email protected] 3 points 12 hours ago* (last edited 12 hours ago)

Exactly! I don't see why we have to rely on the old internet infrastructure for a completely differently conceived type of distributing content!

There's stuff like ipfs, and I'm sure there are many ways to make self hosting easier..

We normalize everyone has a modem/router/access point at home: we should normalize everyone having his own server hosted, bitcoin node, ipfs node etc etc..

And your right, these services have to be super easy to deploy.. I think containerization might be helping with this.. Think about docker or Nixos.. Make a nice GUI and simplify docker even more and you get packages that can run on any distro in any OS, that even a complete noob could spin up! Maybe paired with repos that host most of the self hostable stuff.

But yeah I think the whole structure might be have to be rethought, from the way we host to the way we can connect to each other.. We got to give everyone the possibility to decide which web they want to be part of, and federation definitely allows this!

 

Since being on Lemmy I feel like I finally found a place I can consider more similar to my home on the web.. I feel like this is the real decentralized web, not the next capitalism nightmare which is the so called "web3"..

Give me some guidance! How is the federation thing going? What are some cool projects I need to know about? I know Lemmy, Friendica, Matrix, Bookwyrm, Mastodon, but I'm sure there's more!

[–] [email protected] 1 points 14 hours ago

Do you think a Proxy would be better in this regard compared to a firewall? I was trying to watch the logs of ufw today and see if I could do something there but the incoming and outgoing connections are A LOT, and I would essentially like to whitelist both per domain and per IP.

How much maintainance would this require? I wonder how often IPs change today, but with all the NAT, dynamic DNS and CDNs there around maintaining a whitelist only with IP addresses looks like a nightmare..

Squid proxy with squidguard could be a better option than trying to work with a forewall maybe?

[–] [email protected] 0 points 18 hours ago (2 children)

Any suggestions on the how?

[–] [email protected] 1 points 23 hours ago* (last edited 23 hours ago) (1 children)

It looks really complicated, very different from Linux! I cannot understand properly all the sandboxing thing.. But I guess it's years of development and policies enforcement.. Now I can see why Android it's much more closed compared to a normal Linux distro, I guess this provides a lot of security but less customization. I also have to understand the role of the device manager in all of this. Is there any Linux distro that behaves similarly?

Why so much effort into securing it? Isn't the Linux behaviour with users etc enough?

[–] [email protected] 1 points 1 day ago* (last edited 1 day ago) (2 children)

No it's more a user management thing, I would need users to access a certain list of whitelisted websites only..

Maybe proxy or dns? I've been looking in squid proxy but it looks fairly complicated, especially if I wanna be able to access it from wan.. But Idk if with DNS I could block ips as well. Setting up an hosts file seems like a lot of continuous work since I would have to specify entries for each ip address associated with domain.. Maybe firewall?

 

With all the CDNs and content been served from several locations for a single web page for example, would it be possible to implement a maintainable whitelist in something like a proxy? Does it makes sense? Or I would break half of the websites?

 

How can it have a system partition which is read only and still make the user create and use its files? How does it differ from Linux in terms of permissions and user management? How are the users kind of "confined" in android?

[–] [email protected] 1 points 6 days ago

Yes it's more something like that, making certain type of content a lot less accessible.

I think it's all a problem of time: if we have more time to carefully think about what we are doing on our devices, we usually make better choices.

We need better tools to give us more time to actually evaluate and decide.

I'll make an example: I installed an android device manager which let me set a block timer for each new installed app, that means that whenever I install something new I will have some time to reflect on whether I actually need that new app or not, and most often than not, the answer is no.

 

After finding myself another time completely sucked by all the internet bullshit, finding a huge difficulty doing whichever task involves using a computer, I think I am finally sure to address the need of better moderation on the internet.

Not for platforms, but for people.

So many people have these kind of problem with the internet: there is too much dispersion, it is hard to use it while staying focused on a single task and it's hard not getting hooked by one of the countless activities you can find online. Weren't PC conceived to be "bycicles for the brains"? The internet was supposed to be a place where to share things to each other. It's a tool, but a tool needs to be at the service of who's using it, and so many people nowadays have no fucking idea of what they are doing. And even between tech savvy people (I include myself here too), how many of us do you think could decide to stop using all the bad side (because we know it's bad, I mean we're on Lemmy) of the internet just with will force?

People should have the right to use the internet it as they please, but as we have so many tools for finding and consuming mindlessly everything on the web, and as they are pushed towards us so strongly, I think it's right to give more options to "opt out" as well, for one that desires so.

I think we lack tools for moderation, for making a clear distinction between "I wanna consume this kind of content" and "I wanna stay the hell away from all this bullshit".

It's cool there are alternatives: Lemmy it's really safer as a space compared to the hell that's Reddit now, but I think we should go deeper than that and decide to opt out better from what we don't like as well, and while the focus should still be "build a better internet/software/hardware", I think we need to address the problem of the difficulties on taking distances from certain aspects of the currently unavoidable and somewhat desperate situation of the web.

Linux has a clear solution for managing one's activity on a computer: users, groups and ownership. The admin has the complete freedom to shape the environment for the users. And it's very effective, once a directory belongs to another user, you cannot read it without the other user consent (or the admin). There's not so much space for bypassing this, and it's effective.

But what do we have for the web?

We can use browser extensions, proxies, DNS filtering, VPNs, blacklists etc etc.. But bypass methods for all this kind of filtering is one web search away. At least most of that.

I've come to a point that I am thinking only strict whitelisting with only the few sites you want could be good, blocking every other connection. But it still looks incredibly hard with so many sites using CDNs now, and so many new domains registered.

We should be able to have something like users on accessing web content too: Jane is allowed to visit streaming sites, Bob wanna focus on studying and can only visit cultural content. But I think categorization and moderation of an ever changing content, which is not as "static" as on an OS, needs ever changing moderating tools as well.

I think AI could have an amazing role in this, they can scrape content before we visit it and understand if it is suitable for our purpose. And since content always changes, ai will be always changing as well. I am also thinking that setting something like an "AI in the middle" in between https requests could have it's role, even if privacy concerns would need to be addressed. I like the concept of something like openai's omni-moderation API for example.

Projects like TOR focus on breaking censorship and that is amazing, but I don't see why a user shouldn't be able to censor some content reliably by himself if he wants to (on a client level).

I don't know, but I feel like a better control on how we use the web would be needed, if someone wanna have a talk/brainstorm I can make a Matrix room.

[–] [email protected] 13 points 1 week ago* (last edited 1 week ago)

I don't fucking care of having an even slimmer addictive machine in my pockets. Give me a phone that weights 400g but that has a fucking replaceable battery (that lasts 2/3 days), a good OS, doesn't track me and I can set up as I want.

[–] [email protected] 1 points 1 week ago (1 children)

And that would be enough to bypass root settings?

If someone wants to prevent users to mess with the system should he just disallow downloads entirely/confine the user into an intranet?

 

Let's say I want to enforce certain settings, such as the use of a proxy in network settings for certain users.

Isn't this easily bypassable by for example by installing TOR browser or using a VPN app in the user space?

How does system mangers can be sure users will only use the system as planned by the sysadmin? I'm especially interested in network settings, but in general I would be interested to know more about this/be pointed towards the right direction.

Thank you!

[–] [email protected] 5 points 1 week ago* (last edited 1 week ago) (1 children)

Enough focus to read documentation.

That's really it. If your purpose is just self hosting learning bash could also be helpful. And yeah Linux would be a great choice.

But mostly, if you want to self host an instance of Nextcloud correctly and without having to deal with too many unexpected things, you have to read the documentation and do not rush. Most self hosted stuff isn't "install and use", because you'll be your own server manager, and everything requires attention to be managed.

Docker or not docker you will have to deal with configuration, settings, requirements and updates.

So understanding how to read the docs/search and open github issues and taking time to read everything would be the most important skill for me.

Also writing down what you are doing would indeed be helpful too, in order not to lose track of what you're doing on your server. (Check out Ansible).

Most apps out there simply need you to know about permissions, systemctl services and package managers.

Try to always find a specific package for your distro for everything you install (eg. .deb for Debian), and have strategies when this is not possible (aka using a Python venv when installing python programs).

 

This is what I've found:

In C and C++, two different operators are used for calling methods: you use . if you’re calling a method on the object directly and -> if you’re calling the method on a pointer to the object and need to dereference the pointer first. In other words, if object is a pointer, object->something() is similar to (*object).something().

What about Rust?

Rust doesn’t have an equivalent to the -> operator. Instead, Rust has what is called automatic referencing and dereferencing.

In other words, the following are the same:

p1.distance(&p2); (&p1).distance(&p2); Note: this automatic referencing behavior works because methods have a clear receiver-the type of self. Given the receiver and name of a method, Rust can figure out definitively whether the method is reading (&self), mutating (&mut self), or consuming (self).

I am not sureI understood the note correctly, what does it mean that there is a clear receiver? Also, doesn't Rust actually have an operator for dereferencing (*) as well?

 

Hi! I've been thinking about it, why people decide to program? Why do people chose a lonely job? Why do they decide to work every day in front of a screen in an office or at home? Why passing your day solving puzzle after puzzle?

I am a very social person, and sometimes being alone, for long times, in my office makes me feel incredibly sad (I don't program as a job but I am lucky enough that I have time to study and work on open source software from there sometimes). Yes, it's good that I am not under a bright hot sun in summer and I am not always fatigued by the harshness of a physically demanding job, but at the same time being lonely so much time with something that requires so much focus have its cons as well.

I have some experience in more physical jobs and, while it was definitely more tiring, it was good to have someone to talk to, for example, and to detatch from your thoughts for a while. You can also procrastinate so much being in front of a PC and finding the skills and tweaks to not do it, especially for someone who was addicted to the internet, is another job by itself.

Deciding to study programming for me (all on my own by reading documentation) was an incredibly hard decision and today it still requires a huge amount of will and strength. I was depressed for years and the cognitive impairment coming from depression (and who knows maybe from genetics) is something I am starting to unwind only now. I believe someone is what it is, but the power of change is always there, and cannot be ignored.

I might have an etremely hard time to study and do it veeery slowly while other people can be at university and pass exam after exam, but I'm also conscious I was starting from nothing, nothing at all. From the pits of years of suicidal depression, sometimes filled with substance abuse.

I will be honest, it was and sometimes still is excruciatingly painful.

Coming out from there was the hardest thing I did in my life and it took years. I still need to work on traumas, and that probably takes most of my energies still today.

I see programming and computers not only as something to focus my (so strong) neurotic energies on, something to help me build my cognitive skills, or a possibly well payed job which I could do from everywhere, but also as something to work on and to improve life for other people.

If you read books like digital minimalism by cal Newport, stolen focus by Johan hari, or program or be programmed by Douglas rushkoff you can understand why software needs to be better and to be for people. I lived it by myself: internet, smartphone and mainstream software is becoming more and more hooking, less and less of an instrument and more and more of a tool to control people. I was addicted for years: a fragile person laying towards the shadow of a world that seemed to fully accept me, while it was using and taking out of me every drop of the little hope and energy i had instead.

I could work as a frontend webdev, I have all the skills I need to host WordPress or static websites on a VPS. I have some JavaScript base knowledge, I can use SCSS and HTML. And that would probably give me some very good extra income. I was even asked to work as a webdev but that never went on, I simply feel like I didn't care enough and it kinda faded. (Probably most of people would think I am incredibly stupid, and probably I am).

So I asked myself: why do you program? What is the purpose? Why do I prefer to keep my very low income job instead of trying making some decent money with webdev? Why I decided to start learning Rust from zero again instead of focusing on something highly demanded like JavaScript? Why do I prefer to work for free on a free Hugo theme that can build thousands of websites (that would be payed decently) instead of selling the websites themselves?

I think I finally understand it now, it is because I suffered, and I suffered a lot.

I cannot bear someone else in the world suffering that kind of pain. And if I will be able to build, one day, software that helps someone else to come out of this dystopian matrix which is the current software landscape, to which i was so so ipnotized, I will be the happiest person in the world.

I will never be as skilled as an engineer, I will never understand the complicated maths behind coputer machines, I will also probably keep being very poor, and I will probably never change the world. But I feel like software right now lacks humanity, lacks emotion, and since I feel I have so much of both and some skills on it, it is my duty to at least try to do something as difficult as trying to put both of them into my development. There are probably countless super skilled engineers working for big techs, but how many of them put their full hearth into what they are doing?

This is why I program, and it can be ad painful as fulfilling at the same time, other than extremely hard in a not very rewarding approach.

Why you do it?

[–] [email protected] -3 points 1 month ago

Absolutely Debian stable, the first thing i wanted in Linux was stability, coming from windows you want something that "just works" and I think Debian stable + Gnome is the perfect choice for this!

 

I am trying to understand the std::process::Termination trait.

As I'm not really used to read libraries, I took this as a challenge to try understanding a bit more about how to read them as well.

I think trying to build a library would give me better understanding, but for now...

Termination is quite easy, from the trait page I can see that this trait has single method: report, which returns an ExitCode.

pub trait Termination {
    fn report(self) -> ExitCode;
}

But when I try to dig in further and i read the page related to ExitCode, it confuses me a bit.

ExitCode is a struct, therefore it behaves like a type with many fields which define the types contained in the struct.

I cannot really understand what's the point of this type.. I don't see any fields defined in the struct and this part confuses me a lot:

The standard library provides the canonical SUCCESS and FAILURE exit codes as well as From for ExitCode for constructing other arbitrary exit codes.

I even thought this meant it was an enum which had the SUCCESS, FAILURE etc as variants, but this does not seem the case.

Can you help me to understand how this specific structs work, what exactly does it do and how I should read library pages like this one?

[–] [email protected] 1 points 2 months ago

My god this is so fucking clever and so fucking good to hear!!

 

In python, when you install stuff with pip, it is recommended to use a venv, to avoid breaking dependencies for a program when uninstalling another one, or when two programs need two different versions of the same dependence.

I was wondering if with Rust is the same, or if Cargo manages it all on its own (kind of like apt does), and I shouldn't care about it.

Also since I know Linux kernel is using some Rust, isn't there a risk of breaking my system if I uninstall a program that need some deps that the system itsel needs?

 

Let's say I have a struct Event which implements the method permalink:

struct Event {
    base_url: String,
    rel_permalink: String,
    permalink: String,
    title: String,
}

impl Event {
    fn permalink(&self) -> String {
        let permalink = format!("{}{}", self.base_url, self.rel_permalink);
        permalink
    }
}

The method takes 2 fields of the struct and the target would be to return the definition of another field.

Later I instantiate an event1: Event:

let event1 = Event {
                base_url: base_url,
                rel_permalink: rel_permalink.to_string(),
                title: node.value().name().to_string(),
                permalink = permalink(),
            };

Essentially I would like the field permalink to be the value returned by the method permalink, is something like this possible, is this correct? I couldn't find something similar in the docs..

Pheraps using an associated function as constructor would be a better way to handle a similar situation?

Thank you so much!

17
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 

Hi!

First of all sorry if this is the wrong place to ask, if it is, please point me to a better suited channel!

Anyway I've got this old 2TB HDD attached to a rpi 4b, it worked flawlessly until now, the last few days it started disconnecting randomly..

If i reboot it mounts back again.

This is the df output:

/dev/sdb1       1.8T  535G  1.2T  31% /mnt/2tb

And this is sudo dmesg | grep sdb (the device is sdb ofc).

[   14.970908] sd 1:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[   14.978857] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[   14.984484] sd 1:0:0:0: [sdb] Write Protect is off
[   14.989382] sd 1:0:0:0: [sdb] Mode Sense: 43 00 00 00
[   14.989684] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   15.044802] sd 1:0:0:0: [sdb] Preferred minimum I/O size 4096 bytes
[   15.051196] sd 1:0:0:0: [sdb] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes)
[   15.065585]  sdb: sdb1
[   15.068403] sd 1:0:0:0: [sdb] Attached SCSI disk
[   22.631983] EXT4-fs (sdb1): recovery complete
[   22.660922] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Quota mode: none.

The device has an external power supply of its own, so it's not a power issue.. This setup worked for a couple of years.

I cannot see anything wrong here, pheraps is the HDD which is going bad?

 
fn get_links(link_nodes: Select) -> Option<String> {

        let mut rel_permalink: Option<String> = for node in link_nodes {
            link = String::from(node.value().attr("href")?);

            return Some(link);
        };

        Some(rel_permalink)
    }

This is what I'm trying to do, and I've been stuck with this code for an hour, I simply don't know how to put this function togheter.. Essentially I would like to take some link_nodes and just return the link String, but I'm stuck in the use of Option with the ? operator.. Pheraps trying to write it with match would clear things out(?)

Also I come from JavaScript in which expressions do not have their own scope, meaning I'm having troubles to understand how to get out a variable from a for loop, should I initialize the rel_permalink variable as the for loop result?

This are the errors i get:

error[E0308]: mismatched types
  --> src/main.rs:55:49
   |
55 |           let mut rel_permalink: Option<String> = for node in link_nodes {
   |  _________________________________________________^
56 | |             link = String::from(node.value().attr("href")?);
57 | |
58 | |             return Some(link);
59 | |         };
   | |_________^ expected `Option<String>`, found `()`
   |
   = note:   expected enum `Option<String>`
           found unit type `()`
note: the function expects a value to always be returned, but loops might run zero times
  --> src/main.rs:55:49
   |
55 |         let mut rel_permalink: Option<String> = for node in link_nodes {
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^ this might have zero elements to iterate on
56 |             link = String::from(node.value().attr("href")?);
   |                                                          - if the loop doesn't execute, this value would never get returned
57 |
58 |             return Some(link);
   |             ----------------- if the loop doesn't execute, this value would never get returned
   = help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
view more: next ›