Skip Navigation
Stable diffusion on Arch Linux with a 7900 XTX?
  • It's an error with a dependency written in Rust, the workaround is to use an older toolchain (1.72), it is fixed in the newer code of tokenizers, but probably it is not updated in AUTOMATIC1111 yet: you should check their bug tracker

    To have more info you can read this issue: Link

  • Vermont Institute of Natural Science Owl Fest - Sat April 13
  • This is one of the cutest, more adorable, murder-bird I've seen in a while~

  • Understanding instead of road rage
  • Did she tell you why she was doing it or did she only give you some platitudes and thanks?

    Because a lot of people are not used to be talked to, and even if they are all rage inside the car, they get scared quite fast when someone fully geared on a motorbike knocks on their window - and tbh I think it is pretty understandable.

    Still, good on you, I usually just let them go and change road - when feasible. There's no need to waste a good riding day with some knucklehead.

  • proton VPn
  • Considering you are not using the Flatpak anymore it is, indeed, strange. The only reasons I can think of are: your network manager is using the wrong network interface to route your traffic ( if you go on an ip checking site like for example ipinfo do you see yours or the VPN's IP?) or that you have WebRTC enabled and the broadcaster is getting your real ip through that.

    For the first case it can get pretty complicated, but it is probably an error during the installation of the VPN app or you set up multiple network managers and it gets confused on which one to configure. You should also enable the Advanced Kill Switch in the configuration.

    For the second case you could try adding something like the Disable WebRTC add-on for firefox and check if it works. Remember to enable it for Private Windows too.

    The last thing I can think of is that you allowed the broadcaster to get your real geolocation (in firefox it should be a small icon on the left of the address bar), or you are leaking some kind of information somewhere: there are a bunch of site that check for ip leak, but I don't know if that goes too deep for you.
    If you want to check anyway the first two results from DDG are browserleaks and ipleak. Mullvad offered one too but it is currently down.

    EDIT: If you enable the Advanced Kill Switch, and the app is working correctly, internet will not work while you are not connected to a VPN server or until you disable the switch again, so pay attention to that.

  • A Great Day for Great Photos of some Great Grays
  • Not as scary as a look as the one from the angry burrowing owl you met before.. but up there! Haha

  • can I install more than 2 linux based operative systems on a notebook?
  • Probably when you installed the second linux you overwrote the boot loader instead of adding a new UEFI entry point.

    But I've never had a Mac, so take this with a pinch of salt, and honestly considering things can change based on what, in which order, and how you installed things.. it could be something else.

  • Tuxedo Laptops - Any good?
  • Unfortunately, in general, people tend to just read, vote, and then forget about it without checking back: that's why I always try to add some source or ways to verify what I post.

    And - in this specific case - probably some people just like LTT, I assume.

  • Don't forget to add sudo for maximum performance
  • On the contrary, in my opinion if they are clearly labelled as a joke, they are a great way for people who don't understand them to ask why and, in the process, being a little more informed on what not to do and what it's dangerous.

    Especially because there's really no risk of emulation in this case.

  • Some more Cedar and a review of the experience
  • That's a signature look of superiority if I ever saw one! Love it!

  • Tuxedo Laptops - Any good?
  • Linus is an investor in the framework company: Source on the framework forums that links to the video on youtube

    spoiler

    Why not directly link to the video? Because I don't want to! :P

  • Tuxedo Laptops - Any good?
  • Currently they have direct shipping for some EU's members (Germany, France, Ireland, Netherlands, Austria, Italy, Spain, Belgium) Source

    And I think the shipment costs are currently already in the price for the laptop Source

    But I've not bought one so I don't have direct experience

  • Featured
    Lemmy Apps Directory (MEGATHREAD)
  • Could you consider using ISO 8601 style dates (YYYY-MM-DD) ? Or words for the months?

    Aside from that: great job!

  • Possibly a double-standard?
  • Probably, but I want to point out that the - arguably - most important, intelligent and charismatic character in all of Star Trek lore is an Irish too.

    Spoiler

    O'Brien is the only major Star Trek character described as both ethnically Irish and born in Ireland; Colm Meaney, the actor who portrays him, is Irish.

  • Conversations gratuita per 48h
  • Per chi non lo sapesse, l'app è anche presente su F-Droid, dove è sempre gratuita: link

    Il codice sorgente dovrebbe esser su codeberg (link) per chi volesse compilarla da solo o avere maggiori informazioni.

    Credo non vi siano differenze fra le due versioni, eccetto il fatto che per partecipare alle Beta bisogna avere la versione Google Play. Ma potrei sbagliare.

    EDIT: Al momento di questo post la versione F-Droid sembra esser indietro qualche patch (2.13.0 invece di 2.13.3), che è abbastanza tipico per la piattaforma. Changelog

  • Mozilla Announces Layoffs, Renews Focus on Firefox
  • Because, as pointed in the page, Servo is being developed as a(n embeddable) Rendering Engine, not as a full blown end user Browser.
    Its alternatives are not Chrome, Safari or Firefox, but Webkit, Blink and Gecko

    There's an example GUI called Servoshell, but it is more of a testing ground and example on how to embed the engine in an app than a serious alternative to anything currently in the market.

    Already this kind of work is difficult and daunting. Adding to it a full GUI would make it completely impossible for the current size and financial backing Servo has.

    Big words aside it just means that Servo wants to be only one of the parts that compose a real browser: the one that takes HTML, Javascript, WASM and translates them into the things you see on your monitor. All the user facing functionality are left to the devs of the app that embed it.

  • Please explain this comic
  • As a small addendum this - honestly amazing - post was the spark for the whole couple thing: Happy Thanksgiving! 23 Nov 2017

    And to be precise, it was because of this image:

  • WhatsApp Chats Will Soon Work With Other Encrypted Messaging Apps
  • I feel there's some kind of miscommunication going on here.

    Probably I'm not understanding what you are putting forward, but to be clear: They are not doing this because they want to. They are doing it because they are forced to do it by the DMA.
    It's true that allegedly they were working on some kind of interoperability layer already. For years now. But no evidence of it being more than lip service to avoid being regulated has ever surfaced - as far as I know.

    Which would have been in line with your "Do Nothing".

  • WhatsApp Chats Will Soon Work With Other Encrypted Messaging Apps
  • as an unwilling Whatsapp user the ability to migrate without having to convince all my social circles to do anything but check a checkbox sounds like a huge step forward.

    That's the point. I feel it will not be a "simple checkbox", and they will make it the most obnoxious process they can using the Best Dark Patterns the industry has to offer.

    Already the general public is not interested in the alternatives or the concept of interoperability - wanting something that Just Works™ - putting in front even the smallest step (and some scary text!) will make the percentage of willing people become even lower.
    And that's not all. As it is portraited in the article by the Threema's spokeperson it is pretty clear that Meta will just try to make the maintenance of the communication layer as cumbersome as they can - both technically and bureaucratically.
    They are explicitly the ones keeping the reins of the standard, the features, the security model, the exchanged data and who, how and when will be approved.

    So from one side if they make it hard and scary enough to tank the use rate, they will have the excuse of not being there enough people to give priority to fix it or add features, and from the other side if maintaining the interoperability will be difficult and time consuming enough, the people and businesses from the alternatives or wrappers will not have the incentive to do or keep doing it for the long haul. As we can already see in the article.

    Is it better than nothing? Sure, probably. Will it be a slow cooking, easy to break, easy to get excluded from, just bare minimum to comply to the letter but not the spirit of the law? I feel that's a pretty good bet to make.

    Let's be clear: I will be extremely happy if all the red flags and warning bells that I saw in the article will just end up being figments of my imagination. But yes, I'm very pessimistic - maybe even too much - when I see these kind of corporate speech and keywords.

  • WhatsApp Chats Will Soon Work With Other Encrypted Messaging Apps
  • “One of the core requirements here, and this is really important, is for users for this to be opt-in,” says Brouwer. “I can choose whether or not I want to participate in being open to exchanging messages with third parties. This is important, because it could be a big source of spam and scams.”

    Let me translate this for you: "We will make users hop on the most cumbersome, frustrating and inefficient way we can think of to enable interoperability. And making it defaulted to off will mean people using other apps will need to find other channels to ask for it to be enabled on our users' end, making it worthless.

    And don't forget: we will put a bunch of scary warnings, and only allow to go all in, with no middle ground or granularity!"

    Great stuff, thank you. I can't wait.

    “We don't believe interop chats and WhatsApp chats can evolve at the same pace,” he says, claiming it is “harder to evolve an open network” compared to a closed one.

    Ah, so they are going for the Apple's approach with iMessage and Android sms. Cool, cool.

    I hope my corporate-to-common translator is broken, because this does just sound bad.

  • [Community challenge 22] Busy Bees: Animals with Jobs
  • Let's go with a great classic:

    Prompt

    Made in ComfyUI

    Model: SDXL Yamer's Anime
    vae: sdxl_vae.safetensors

    Prompt:

    • Positive: Masterpiece, A sad anthropomorphic sloth working in a cubicle, tie and shirt, elegant trousers, employee, frowning
    • Negative: text, watermark

    Seed: 217690652583363

    Empty Latent 1216 x 832, clip_scale 2.0

    KSampler: 22 steps, 6.5 cfg; euler, normal

    Overall a pretty vanilla generation.

  • Rust, Bot e Lemmy: Un piccolo esempio introduttorio!

    Ciao a tutti! La discussione dell'altro giorno riguardo a Bot per Lemmy mi ha invogliato a perder un po' di tempo libero e buttare giù un semplicissimo script in Rust che crea un nuovo post quando viene invocato, seguendo i dati in un file di configurazione.

    Anche se si tratta, fondamentalmente, di qualcosa d'incredibilmente semplice l'ho creato in modo da dar esempi pratici a molti degli argomenti che spesso, chi inizia Rust, ha difficoltà a trovare in un insieme coerente.

    Per esser chiari questa non è - volutamente - la più efficiente o idiomatica versione del codice per eseguire il compito, ma ho cercato di mantenerla semplice da capire e tendenzialmente idiomatica, evitando tutte quelle forme che potrebbero intimidire o confondere, anche se migliori.

    E, soprattutto, questo non è un tutorial. Vuole solo dare una prospettiva ampia.

    Dentro ci sono esempi di:

    • Option
    • match
    • Del crate reqwest, usato per inviare una richiesta POST.
    • Come leggere un file di configurazione con toml e serde.
    • Il random in Rust, che non è integrato direttamente nella Standard Library ma per cui bisogna usare il crate rand (o similari).
    • Come ottenere e formattare una data con il crate time. Normalmente ho sempre usato chrono, quindi questa è stata un'esperienza nuova anche per me! haha
    • Diversi modi per interpolare le stringhe.
    • Come attivare per un crate delle feature non default nel proprio cargo.toml
    • panic! AKA Come far crashare il proprio programma! ...volutamente!
    • expect non è il male! Ha il suo posto anche all'interno di programmi più solidi e non solo per veloce prototipi.

    Ora non voglio venderlo per più di quello che è, ma credo sia una buona base di partenza per qualcuno che è interessato a Rust ma non lo ha mai visto con esempi reali, semplici e non mono argomento. Ho aggiunto anche diversi commenti che spero possano aiutare a comprenderne il flusso.

    Quindi, per finire, funziona? Sì! È solido e resiliente? Nope. È una buona base per far qualcosa di meglio se volessi imparare e giocare un po' con Rust? Credo di sì.

    Se volete provarlo e fare dei test, il metodo migliore è usare le istanze di test ufficiali di Lemmy:

    Oppure la palestra qui su feddit.it (credo?)

    Una buona alternativa sono anche i servizi come https://httpbun.org/ o https://httpbin.org/ (down al momento dei miei test).

    FAQ

    Perché non su github? > Al momento non ho un account che posso usare per queste cose, mi dispiace!

    Ma basta che copio i file? > Beh, sì, ma sarebbe il caso di creare un nuovo progetto con cargo new --bin simplecofeebot e sovrascrivere/modificare i file.

    Cosa succede se faccio cargo run? > Che invii una richiesta errata a feddit.it, perché non c'è alcun token jwt nel file di configurazione. > Nel caso in cui tu inserisca un token jwt allora - se non modifichi nulla - dovrebbe inviare una nuova discussione nella comunità del Caffé, chiamata "Caffè Italia DD/MM/AAAA" con la data del giorno d'invio, ed un messaggio fra quelli nella body_pool. Quindi meglio non farlo, o si finisce per spammare il caffé. :D

    Perché nel Caffè invece di Informatica?! > Leggendo le regole della comunità !informatica@feddit.it mi sembra di capire sia solo incentrata sulle notizie!

    Puoi compilarlo per me? > Nope. Non consiglio di usarlo seriamente così come è.

    Questo codice è un macello! > Grazie, mi sono impegnato! Se hai notato bug, typo o cose insensate per favore commenta qui sotto!

    Licenza??? > MIT o Apache 2!

    ---

    Cargo.toml

    ```toml [package] name = "simplecofeebot" version = "0.1.0" edition = "2021" publish = false license = "MIT OR Apache-2.0"

    See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

    [dependencies] toml = "0.7.6" reqwest = { version = "0.11.18", features = ["blocking", "json"] } time = { version = "0.3.23", features = ["std", "local-offset", "formatting"] } serde = { version = "1.0.174", features = ["derive"] } serde_json = "1.0.103" rand = "0.8.5" ```

    /simplecofeebot.toml

    ```toml [instance] url = "https://feddit.it"

    curl --get -d "name=caffeitalia" https://feddit.it/api/v3/community

    community_id = 11869

    [authentication]

    curl --header "Content-Type: application/json" --request POST --data '{"username_or_email":"UsernameFigo","password":"PasswordComplicata"}' https://feddit.it/api/v3/user/login

    session_token = ""

    [text] body_pool = [ "Salve!", "Che piacere vederla, commendatore, il solito?", "Un bel caffettino?", ]

    title_pool = ["hmhm", "oh no"]

    ```

    src/main.rs

    ```Rust // In poche parole questi sono gli import. use std::{fs::File, io::Read, path::Path};

    use rand::{rngs::ThreadRng, Rng}; use serde::Deserialize; use serde_json::json; use time::{format_description, OffsetDateTime};

    // Creiamo una serie di Struct per contenere i vari // dati presenti nel file di configurazione. // derive è una macro procedurale che // genererà per noi determinate parti di codice. // Deserialize è fondamentale e proviene dal crate // serde, su cui toml fa affidamento. #[derive(Debug, Deserialize)] struct Config { instance: InstanceConfig, authentication: AuthenticationConfig, text: TextConfig, }

    #[derive(Debug, Deserialize)] struct InstanceConfig { url: String, community_id: i32, }

    #[derive(Debug, Deserialize)] struct AuthenticationConfig { session_token: String, }

    #[derive(Debug, Deserialize)] struct TextConfig { // Perché un Option? Perché la pool di titoli nel file // di configurazione può esserci o non esserci, è, per // l'appunto, opzionale. // Potremo facilmente controllare che il valore sia presente // in base al suo tipo: // Some(Vec<String>) - un vettore contenente stringhe // None - un'Option vuota title_pool: Option<Vec<String>>, body_pool: Option<Vec<String>>, }

    fn main() { // Specifica la posizione ed il nome del file di configurazione. let path = Path::new("./simplecofeebot.toml"); // Apri il file di configurazione e controlla che l'operazione non dia errore. let (config, title, body): (Config, String, String) = match File::open(path) { // Il file è stato aperto con successo, quindi usiamo un pattern // per estrarre il contenuto del nostro tipo Result<File, Error>. Ok(mut file) => { // Creiamo una nuova Stringa che verrà utilizzata come buffer per il contenuto // del nostro file di configurazione. // Deve esser mut perché dobbiamo modificarla. let mut doc = String::new(); // Ed ora tentiamo di trasportare il contenuto del file dentro la stringa di buffer! match file.read_to_string(&mut doc) { // Non siamo interessati a quello che read_to_string ritorna dentro l'Ok() // quindi usiamo _ per indicare che non serve una variabile dove inserirlo. Ok(_) => { // Usiamo il crate Rand per creare un generatore di numeri casuali locale. let mut rng = rand::thread_rng(); // Finalmente usiamo il crate toml per analizzare il file di configurazione. let config: Config = match toml::from_str(doc.as_str()) { // Il match può ritornare un valore al suo completamento, quindi, // nel caso sia andato tutto bene, ritorniamo il valore contenuto // all'interno del nostro Ok. Ok(s) => s, Err(err) => { // Oh no! // Qualcosa è andato storto e non ci è possibile recuperare // da questo errore. Ci tocca chiudere il programma con un bel // e salutare crash. Cerchiamo almeno di spiegare il perché... panic!( "Errore! Impossibile analizzare il file di configurazione!\n{}", err ); } }; // Per rendere il titolo un po' meno monotono aggiungiamo un suffisso // estratto a caso fra le stringhe date nell'apposito spazio nel file di // configurazione. // Useremo una funzione chiamata pick_random, definita poco sotto! let title_suffix = config .text .title_pool .as_ref() .map_or(String::new(), |v| pick_random(&mut rng, v));

    let body_default = "Salve!".to_owned();

    let mut body = config .text .body_pool .as_ref() .map_or(body_default.clone(), |v| pick_random(&mut rng, v));

    // Abbiamo fatto in modo che, in caso il nostro utente non // abbia definito body_pool nella configurazione, allora vi sia // la String "Salve!" come body, ma cosa succede nel caso in cui // il nostro utente abbia passato [""] o []? // Dato che abbiamo preso una decisione esecutiva d'avere come // default "Salve!", allora è il caso d'aggiungere // un altro controllo... if body.is_empty() { body = body_default; }

    // Rimandiamo indietro una bella Tupla d'elementi.. questo // puzza solo a me? // Se si fa affidamento su un dato strutturato, per muoverlo // in giro, forse sarebbe il caso di creare direttamente una // nuova Struct ed esser sicuri di quel che passiamo! (config, generate_title(title_suffix), body) } Err(err) => { // Hmm.. probabilmente il file non era codificato in UTF-8! Oh no! Anche qui... // niente configurazione, niente funzionalità! panic!( "Errore! Sei sicuro che il file di configurazione sia in UTF-8 valido?\n{}", err ); } } } // C'è stato un errore durante l'apertura del file! Err(err) => { // Niente file di configurazione significa che non abbiamo accesso al token JWT.. // Anche se avessimo dei default per gli altri elementi non è possibile andare oltre, // l'unica via è un bel crash! panic!( "Errore! Impossibile aprire il file in \"{}\":\n{}", path.display(), err ) } };

    // Ora che abbiamo il nostro titolo ed il nostro corpo del messaggio // è arrivato il momento di postarli! Ma come fare? // A piccoli passi! // Sarebbe opportuno controllare che l'url dell'istanza sia // almeno formalmente corretto. // Perché non fare tutti i controlli subito appena analizzato // il file di configurazione, così da non sprecare // tempo e computazioni? È un ottima domanda! // E la strategia giusta sarebbe di spostare tutto ciò che // riguarda la configurazione in un suo modulo a parte, // far tutte le validazioni del caso, e solo dopo procedere! // ...ma qui siamo bonari, ci fidiamo del nostro utente! // Saltiamo direttamente ad usare un nuovo crate per // inviare richieste: reqwest! let client = reqwest::blocking::Client::new(); // Cosa succede se, per caso, l'url dell'istanza è malformato, pieno // di spazi bianchi o con un bel / alla fine..? E se non inizia con // il protocollo? let api_endpoint = format!("{}/api/v3/post", config.instance.url); // Questi son un sacco di dati da prendere e di cui fidarsi così, senza // pensarci.. // Però siamo avventurosi! Creiamo direttamente il json sulla fiducia. // Per farlo utilizziamo una macro che proviene da serde_json. // Esistono molte altre vie, ma questa è quella più semplice da // gestire in modo sano, se dovessimo mai decidere d'implementare // altre casistiche. let req = json!({ "auth": config.authentication.session_token, "name": title, "community_id": config.instance.community_id, "body": body, }); // Ed ora proviamo ad inviare la richiesta! match client.post(api_endpoint).json(&req).send() { Ok(response) => { // Sembra esser tutto riuscito! Mettiamo un bel messaggino con // un sacco d'informazioni inutili nella console, giusto per // dar un po' di fastidio al nostro amato utente! // In più con un unwrap messo così c'è sempre la possibilità // d'avere un divertente crash al momento meno opportuno! println!("La discussione con il titolo \"{title}\" è stata inviata correttamente.\nRisposta: {}", response.text().unwrap()) // Ma un momento... Se l'url era sbagliato e abbiam ricevuto // indietro un 404, 503 o qualche altro problema che ha impedito al // post d'esser ricevuto? Al momento il nostro script direbbe // sempre che tutto è andato bene! Ooooops! // Forse potremmo controllare response.status() e fare un bel match... } Err(err) => eprint!( "Errore! Non è stato possibile inviare la discussione!\n{}\n", err ), } }

    fn pick_random(trng: &mut ThreadRng, trg: &Vec<String>) -> String { // hmm.. cosa succede se viene passato un vettore vuoto...? // Meglio controllare! E in Rust anche l'if può direttamente // ritornare un valore. if trg.is_empty() { // È un po' triste e non esattamente il massimo.. Ma una stringa // vuota è pur sempre un'opzione! // Notare come trasformiamo "" da una &'static str in una String usando // to_owned(). "".to_owned() } else { // Invece se c'è almeno un elemento allora procediamo all'estrazione! // Notare come len() ritorni la lunghezza del vettore, quindi // [0, 1, 2] ha una len() di 3, però l'ultimo elemento ha un'id // di 2! // Un'altra ottimizzazione possibile sarebbe nel caso avessimo // un solo elemento... ma.. Ne vale la pena? trg.get(trng.gen_range(0..=(trg.len() - 1))) .unwrap() .to_owned() } }

    fn generate_title(suffix: String) -> String { // Creiamo un descrittore per il formato della data da inserire nel titolo. // Nel caso ci sia qualche errore crashamo direttamente usando expect, // perché siamo bravi mettiamo anche un messaggio che cerca di spiegare il // motivo più probabile per il nostro crash.. Potrebbe esser utile in futuro, se // qualcuno decidesse di render il descrittore configurabile! let date_format = format_description::parse("[day]/[month]/[year]").expect( "La stringa che stai cercando di usare per formattare la data non sembra corretta!", ); // Cerchiamo d'ottenere la datetime della macchina locale... let date = match OffsetDateTime::now_local() { Ok(datetime) => datetime.date(), Err(_) => { // Impossibile ottenere la data locale, con tristezza usiamo quella UTC. // Potrebbe capitare che il giorno sia diverso, per colpa dei fusi orari.. eprintln!("Errore! Impossibile ottenere la data locale: verrà usata quella UTC."); OffsetDateTime::now_utc().date() } } .format(&date_format) .expect("Non siamo riusciti a formattare la data..?");

    format!("Caffè Italia {} {}", date, suffix) .trim() .to_owned() } ```

    --- Alcune possibili migliorie semplici ed interessanti potrebbero esser:

    • Una gestione migliore degli errori, usando l'operatore '?', ed il crate anyhow.
    • Potremmo anche creare degli errori migliori con thiserror!
    • Abbiamo già il crate time.. Perché non aggiungere dei timestamp ai messaggi nella console?
    • Creare diversi moduli per gestire in modo più generale e specifico (Ah! Sembra un ossimoro ma non lo è!) le varie funzioni!
    • Dopo aver creato la discussione, se ha accesso ai poteri da mod, pinnarla!
    • Magari sanitizzare un po' le stringe provenienti dal file config? Anche solo un trim sarebbe un bel passo avanti! Anche quando l'utente è fidato cercare di coprire gli errori più comuni è sempre una buona idea!
    • Cosa succede se il session_token è scaduto..? Magari si potrebbe direttamente fare il login?
    • Magari trasformarlo per, oltre al file di configurazione, accettare anche dei parametri da linea di comando, usando un crate come Clap!
    • Attualmente lo script posta quando è invocato.. Magari potremmo creare un loop e una configurazione per postare a determinate date/orari? Certo, un cron job quando disponibile è sempre la scelta migliore.. Ma se proprio ci si sta annoiando...!
    0
    Mechanize Mechanize @feddit.it

    I did nothing and I'm all out of ideas!

    Posts 1
    Comments 83