kionite231

joined 2 years ago
MODERATOR OF
[–] kionite231 1 points 2 weeks ago

oh I didn't know it, thank you so much for correcting me! =)

[–] kionite231 3 points 2 weeks ago (1 children)

Looks very coolπŸ˜ŽπŸ‘

[–] kionite231 5 points 2 weeks ago (1 children)

It's... weird, did you do something that accidentally deleted firefox?

[–] kionite231 3 points 2 weeks ago

Thanks for sharing, I am 21 years old.

You symptoms could still be manifesting if you’re young enough.

I hope this is not true, I don't want to be like we see on movies.

[–] kionite231 1 points 2 weeks ago

No, I don't experience visual hallucinations. however I like to imagine another world where everything happens as I like. eg, I have some kind of superpower etc

[–] kionite231 5 points 2 weeks ago (1 children)

No, there is no logic behind the fear of water and soap, I just feel like water and soap will harm me somehow.

Bathing is very difficult for me, I only bathe once in 3-4 days.

[–] kionite231 3 points 2 weeks ago

No I don't have auditory hallucinations. I only have delusion of reference and delusion of persecution. However I do laugh at my symptoms when I think someone wants to harm me. I immediately go like "It couldn't be that this person wants to harm me" then "yeah but he was looking at me he must be laughing at me" "No he was looking at me because I first looked at him" "He definitely laughed at me"

You know this kind of back and forth.

[–] kionite231 1 points 2 weeks ago (1 children)

Fortunately my parents are alive. This is the exact same thing my new psychiatrist is thinking. They are decreasing the dose of APs and increasing the dose of anti-depresent.

No they didn't do a brain scan yet.

[–] kionite231 3 points 2 weeks ago

yes, however they are too much lock down compare to a real Linux phone

[–] kionite231 5 points 2 weeks ago

I don't like how schizophrenia is represented in movies, they portrait schizophrenics as crazy person who want to kill other human, which is incorrect. for example you won't even know I am diagnosed with schizophrenia until I explicitly tell you. for everyone around me I am just a fine introvert person.

[–] kionite231 8 points 2 weeks ago (5 children)

I don't know why are you asking this same question to everyone posting in AMA community. are you trying to confirm if I am an LLM or not?

[–] kionite231 7 points 2 weeks ago (3 children)

sure, I mostly struggle when I go to my university, It makes me anxious thinking everyone is laughing at me and mocking me, I haven't made a single friend in university because of schizophrenia. I lost an internship too since they got an idea that something is wrong with me. right now I don't even know if I should tell my employer that I have schizophrenia, I don't want to lost my job however they won't know I have schizophrenia if I don't tell them myself.

 

Hello,

It's been some time since I changed my phychiatrist, ( I wrote the reason in a previous post). the new phychiatrist think that I don't have phychotic symptoms instead he think that I just have social anxiety since I only think that people are talking about me and want to harm me, I am not actually believe that. he says I don't have schizophrenia because I don't have any phychotic symptoms anymore. he is decreasing the dose of antiphychotic and increasing the dose of anti-depressant.

I am no longer sure if I even had schizophrenia or my previous phychiatrist misdiagnosed me.

 

Hello,

I try out new distro every week since I have a lot of free time and want to learn more about Linux. I was thinking that it would be interesting to make a Lemmy post every week talking about my experience with the distro and what I did with it. right now I have alpine linux installed and thinking about using it till next sunday.

feel free to suggest next distro that I should try out. (I have tried out a lot of distros but never wrote anything about the experience but now on I will be making post about it here on Lemmy :) )

0
test post (self.bot_testing)
 

This is a test

 

Thank you peertube.wtf !!

 

Greetings,

sometimes I want to read new comments on a particular post but I don't want to check it every hour to see new comments. It would be nice if I can just say "!remind 5h" so that I get a reminder to checkout a specific post which would have new comments after 5 hour.

I am thinking about making it myself in Rust, but if there is already a bot here and I don't know, please tell me.

 

Hello,

I am trying to get sound working in FreeBSD. I read 9th chapter of FreeBSD handbook(https://docs.freebsd.org/en/books/handbook/multimedia/). I have succesfully configured the sound card, it shows in dmesg | grep pcm and also in cat /dev/sndstat. however when I try to use beep command to test the speaker, it doesn't work ( I can't hear anything from the sound card).

 
 

What I learned about Rust while making pastebin in Rust

First iteration

Hello, I have recently started to make a pastebin to learn more about Rust and understand the underlying concept of Rust so I first made a very naive pastebin where I used axum to serve the files and used a TCPListener to handle file upload. I didn't use axum to handle file upload because I didn't know how to do it, so basically my program was listening to two different port 8080 and 3000 where on port 3000 I served the files and on 8080 I handle file upload using simple TCP connection. I also used a static variable to name the uploaded file, but in Rust mutable static variable considered unsafe since it could lead to race condition, but at that time I didn't know much about Atomic variables so I wraped the code with unsafe.

Second iteration

I uploaded my code of First iteration to Lemmy, and people on Lemmy gave me a lot of suggestions, like using Atomic variable to eliminate the need of unsafe block and using axum to handle file upload. so I implemented that.

Third iteration

there are still some security issue like anyone can scrape entire pastebin since I was using an incremental file name. also if I rerun the pastebin It will reset the file name variable and it would overwrite previously uploaded files, to overcome this issue a person on Lemmy suggested that I should use uuid, that way it would solve those security issue.

Final thoughts

so yeah, that was it, I learned a lot about Rust and programming in general, thank you all on the Lemmy to teach me these cool stuff :D

 

Hello, last time I shared my dirty code of pastebin and people suggested me a lot of things so I have implemented those. now the code is reduced to only 42 lines of code :D

last post: https://lemmy.ca/post/36410861

here is the code:

use axum::{extract::Path, routing::get, routing::post, Router};
use std::fs::{read_to_string, File};
use std::io::prelude::*;
use std::sync::atomic::{AtomicUsize, Ordering};

const MAX_FILE_SIZE: usize = 1024 * 1024 * 10;
static mut FILE_COUNT: AtomicUsize = AtomicUsize::new(0);

async fn handle(Path(id): Path<String>) -> String {
    if let Ok(content) = read_to_string(id) {
        return content;
    }
    return String::from("ERROR: File not found");
}

async fn submit_handle(bytes: String) -> String {
    dbg!(&bytes);
    if bytes.len() > MAX_FILE_SIZE {
        // Don't store the file if it exceeds max size
        return String::from("ERROR: max size exceeded");
    }
    unsafe {
        let path = FILE_COUNT.load(Ordering::Relaxed);
        FILE_COUNT.store(path+1, Ordering::Relaxed);
        let mut output = File::create(path.to_string()).unwrap();
        write!(output, "{}", bytes).unwrap();
        let mut url = String::from("http://localhost:3000/");
        url.push_str(&path.to_string());
        return url;
    }
}

#[tokio::main]
async fn main() {
    let app = Router::new()
        .route("/", get(|| async { "Paste something in pastebin! use curl -X POST http://localhost:3000/submit -d 'this is some data'" }))
        .route("/{id}", get(handle))
        .route("/submit", post(submit_handle));

    let listener = tokio::net::TcpListener::bind("127.0.0.1:3000").await.unwrap();
    axum::serve(listener, app).await.unwrap();
}

 

Hello,

I was making a pastebin in Rust which I shared to the Rust community but there was one person who asked "why didn't you use upload functionality of axum" (I implemented the upload functionality using by simply using TCP connection). now I think that it might be a good idea to have file upload using axum but I couldn't find how to do it in their documentation. could someone point me to the right direction please? :)

view more: β€Ή prev next β€Ί