Skip Navigation
Lanky_Pomegranate530 Lanky_Pomegranate530 @midwest.social

Atheist , Leftist, Gamer ,Programmer ,Reddit Mod, Discord Admin, Master of the Web.

Linktree

Note: Any DM's regarding ban appeals will be ignored. Please ask the other mods of what ever community you were banned from instead.

Posts 1.3K
Comments 88
Need help with Networking homework. FTP program using UDP.
  • I lowered the buffersize to 5 and sent the 21 byte test file and it was able to go through. However When I made the buffersize 3 (because my DONE packet was 4 bytes) is hanged and it appended the word DONE without the E.

  • Need help with Networking homework. FTP program using UDP.

    So I am working on a homework project for my network architure class were I have to devlop an FTP program using UDP (not TCP). I was able to get my GET and PUT functions to send a 21byte test file and it worked. However when I tried to do a 1MB file the program hanged and did not send all of the data. I need to be able to send files of 1MB, 25MB, 50MB, and 100MB. Here is my code.

    GET (Client Side)

    ``` private static void getFile(String serverFilePath, String clientFilePath) throws IOException { clientFilePath = clientFilePath.replaceAll("^\"|\"$", ""); //Strip quotes if any. if(!clientFilePath.startsWith("/")) clientFilePath = currentDir + "/" + clientFilePath;

    sendMessage("GET " + serverFilePath);

    //Write file to client try (FileOutputStream fos = new FileOutputStream(clientFilePath)) { while (true) { byte[] buffer = new byte[BUFFER_SIZE]; DatagramPacket packet = new DatagramPacket(buffer, buffer.length); socket.receive(packet);

    String data = new String(packet.getData(), 0, packet.getLength()); if (data.equals("DONE")) break;

    fos.write(packet.getData(), 0, packet.getLength()); } } System.out.println("[Client] File downloaded successfully."); } PUT (Client Side) private static void putFile(String clientFilePath, String serverFilePath) throws IOException { clientFilePath = clientFilePath.replaceAll("^\"|\"$", ""); //Strip quotes if any. if(!clientFilePath.startsWith("/")) clientFilePath = currentDir + "/" + clientFilePath;

    sendMessage("PUT " + serverFilePath);

    //Upload file to server try (FileInputStream fis = new FileInputStream(clientFilePath)) { byte[] buffer = new byte[BUFFER_SIZE]; int bytesRead; while ((bytesRead = fis.read(buffer)) != -1) { DatagramPacket packet = new DatagramPacket(buffer, bytesRead, serverAddress, SERVER_PORT); socket.send(packet); } sendMessage("DONE"); } System.out.println("[Client] File uploaded successfully."); } ```

    GET (Server Side) ``` private static void handleGet(String filePath, InetAddress clientAddress, int clientPort) throws IOException { filePath = filePath.replaceAll("^\"|\"$", ""); //Strip quotes if any. if(!filePath.startsWith("/")) filePath = currentDir + "/" + filePath;

    //Check is file exists File file = new File(filePath); if (!file.exists()) { sendMessage("[Server] Error File not found", clientAddress, clientPort); return; }

    //Write file to server try (FileInputStream fis = new FileInputStream(file)) { byte[] buffer = new byte[BUFFER_SIZE]; int bytesRead; while ((bytesRead = fis.read(buffer)) != -1) { DatagramPacket packet = new DatagramPacket(buffer, bytesRead, clientAddress, clientPort); socket.send(packet); } sendMessage("DONE", clientAddress, clientPort); } } ```

    PUT (Server Side) ``` private static void handlePut(String filePath, InetAddress clientAddress, int clientPort) throws IOException { filePath = filePath.replaceAll("^\"|\"$", ""); //Strip quotes if any. if(!filePath.startsWith("/")) filePath = currentDir + "/" + filePath;

    File file = new File(filePath); try (FileOutputStream fos = new FileOutputStream(file)) { while (true) { byte[] buffer = new byte[BUFFER_SIZE]; DatagramPacket packet = new DatagramPacket(buffer, buffer.length); socket.receive(packet);

    String data = new String(packet.getData(), 0, packet.getLength()); if (data.equals("DONE")) break;

    fos.write(packet.getData(), 0, packet.getLength()); } } sendMessage("DONE", clientAddress, clientPort); } ```

    2
    WSL goes brrr
  • You can get Wine on mac

  • Nevar Forget
  • You are right. The people who are saying that Jill Stein is a fascist clearly know nothing about her or her platform.

  • Nevar Forget
  • Jill Stien only had 2% of the vote in 2016. That is nothing. Most of those people would have stayed home. The reason Hillary lost was because she was a bad canidiate who was unable to resonate with young voters.

  • Hip hip hooray daddy!
  • Elon look so stupid.

  • Atheism @lemmy.ml Lanky_Pomegranate530 @midwest.social
    www.psypost.org New study links brain network damage to increased religious fundamentalism

    Recent research found that damage to specific brain networks, primarily in the right hemisphere, is linked to higher levels of religious fundamentalism. These brain regions are involved in cognitive functions like reasoning, belief formation, and moral decision-making.

    New study links brain network damage to increased religious fundamentalism
    2
    arstechnica.com Android apps are blocking sideloading and forcing Google Play versions instead

    "Select Play Partners" can block unofficial installation of their apps.

    Android apps are blocking sideloading and forcing Google Play versions instead
    5
    arstechnica.com Android apps are blocking sideloading and forcing Google Play versions instead

    "Select Play Partners" can block unofficial installation of their apps.

    Android apps are blocking sideloading and forcing Google Play versions instead
    2

    THEY'RE DOING IT: DeSantis "reviewing" signatures on abortion ballot petitions

    1
    Atheism @lemmy.ml Lanky_Pomegranate530 @midwest.social

    Pope Francis pushes false claim that both presidential candidates are "against life"

    2

    Pope Francis pushes false claim that both presidential candidates are "against life"

    21
    www.snopes.com Arizona GOP Launches 'Eat Less Kittens' Billboards Referencing Unfounded Conspiracy Theory

    The Arizona Republican Party posted that 12 billboards — clearly inspired by Chick-fil-A's own advertising — were live in the Phoenix metro area.

    Arizona GOP Launches 'Eat Less Kittens' Billboards Referencing Unfounded Conspiracy Theory
    21

    Based

    11

    Seriously this is a joke. Do NOT try this

    59
    libmtp error when copying from ntfs to phone on Linux
  • Thanks for linking me to the to this page. I did some more diging and I managed to figure out the actual problem. I was using a program called CompactGUI2 which allows you to use the NTFS file comprssion to save space. The minute I uncompressed the files from the Windows side I saw the Lock icons go away when I booted back into Linux.

  • libmtp error when copying from ntfs to phone on Linux
  • I just download the appimage version of duckstation on the Linux side to see if it could run the game but it was unable to find my games in the ROMs Directory. Then I tried going to System > Start File and When I tried to launch the game that way I got this error.

    What is even more weird is that I was able to launch the copy on my ext4 partition despite the fact the the BIOS I selected is in the ntfs partition.

    Edit: I just tried opening the BIN and CUE files from the ntfs partition and got on error saying that the file does not exist despite the file being visible from the file manager. I also noticed that the one on the ntfs partition had some lock icons while the ext4 one did not. I also saw a windows directory in the cue file on the windows C: drive which I found very weird because I usually store all my games on the D: drive of my system. The copy on my ext4 also how this Windows Directory.

  • libmtp error when copying from ntfs to phone on Linux
  • I just installed the program but it says that it cannot find any devices.

  • libmtp error when copying from ntfs to phone on Linux
  • Do you mean like a different file manager? I just tried using Thunar instead of Nautilis and got the same error.

  • libmtp error when copying from ntfs to phone on Linux

    Ok I was copying a bunch of games from one of my Windows drives over to my phone while booted into Linux. And I got this error that says "libmtp error: Could not open source file". Thankfully I was able to copy the files when I was booted into Windows but it would be nice if I could Transfer files from my Windows drives without having to reboot into Windows. Is there a way I can fix this problem.

    I think it might have to do with the ntfs file system because I copied one of the files from the phone back to my Desktop which is ext4 and then back to the phone without any issues. I already tried installing ntfs-3g which was already installed on my distro.

    13
    www.gamingonlinux.com Microsoft donates the Mono Project to the Wine team

    Well, this is surprising isn't it? Microsoft are handing over the Mono Project to the Wine developers with a thank you note.

    Microsoft donates the Mono Project to the Wine team
    27
    Atheism @lemmy.ml Lanky_Pomegranate530 @midwest.social
    invidious.privacyredirect.com After censoring atheists, TX Gov. Greg Abbott finally pays $358,000+ in legal fees (Livestream)

    Gov. Greg Abbott took down a "Secular Nativity" display in 2015. After fighting a lengthy legal battle, he's finally paying the price for it. This is a clip from my recent livestream: https://youtube.com/live/rf01MCb2p0I The article this is based on is here: https://www.friendlyatheist.com/p/t...

    After censoring atheists, TX Gov. Greg Abbott finally pays $358,000+ in legal fees (Livestream)
    0
    Is there a way I can reinstall Linux Mint without messing up my Windows Partition?
  • I went to that directory and did a cat on the history.log and got this. I also tried looking for the meta package you were talking about and installed mint-meta-cinnamon.

    Edit: Holy Shit. I just tried installing gnome and got my desktop back. Thank you so much.

  • Is there a way I can reinstall Linux Mint without messing up my Windows Partition?
  • Ok is what happened. I was on the UNF subreddit trying to figure out how to connect my laptop to the schools wifi on linux because my university uses the thing call OnGuard which is only required for Mac and Windows. A redditor link me to this post and it turned out that the reason why I was unable to connected to the schools wifi was because the network had my MAC address was tied to Windows when I originally connected my computer to the Wi-Fi. So I tried to follow the instructions on how to spoof my mac address which I was able to do it manually but then when I tried set it up to do it automatically by installing udev and editing some files using this link in the post I rebooted my computer login into gnome on x11 and did an ifconfig and noticed that my wireless adapter changed from wlp0s20f3(which is my usually the wireless inferface on my system) to wlan0 and was unable to connect to the internet so I then tried removing udev and then out of nowwhere the system showed a CLI. I tried to reboot but it took me Back to the CLI again so I then tried to reinstall udev and reboot which did nothing. Then I tried to remove the files that I had created and that did not work either and that was when I tried to restored from timeshift.

    Here is a picture of my command history

  • Is there a way I can reinstall Linux Mint without messing up my Windows Partition?

    Long story short I was messing around in the terminal and messed up my Linux Mint Installation and now when I boot into Linux I only get a CLI and don't even see the Linux mint logo. I tried to restore to a previous state using Timeshift but it did not work so I ended up taking a live usb and backing up all my important documents to an external drive. I want to just do a fresh installation but unfortunally for me the boot drive is also the same drive I use to boot into Windows (which I am still able to boot into from GRUB). Is there a way I can reinstall the OS without affecting my ability to boot into Windows?

    9

    No Trump lives for himself

    28

    Todays Mission

    23

    Transphobic meme saying the dems are the weird ones

    29

    This was posted with no irony

    2
    Why Are You Staying On Windows 11?
  • I dual booted Linux Mint with Windows 10 on my gaming laptop so that I wouldn't have to upgrade to Windows 11 or buy a new computer.

  • This is Joe Buddens America, we used to be free, now we’re not, cuz of woke 😔😔😔

    28
    Cloned Windows 10 drive keeps taking me to automatic repair after using clonezilla
  • Thanks for the reply. I was able to clone it last night using that software. Thank you.

  • Cloned Windows 10 drive keeps taking me to automatic repair after using clonezilla
  • I just booted into the old drive and plug the new drive into using an nvme to usb c and it did not show up on disk management. However when I used an adapter to plug it in to the usb 2.0 and 3.0 inferfaces it showed up and I saw this:

    note: Disk 2 is the new drive and Disk 1 is the original.

  • Cloned Windows 10 drive keeps taking me to automatic repair after using clonezilla
  • EFI. The BIOS is locked and I cannot disable secure boot.

  • Cloned Windows 10 drive keeps taking me to automatic repair after using clonezilla

    Ok so I was trying to clone 512gb nvme ssd to my new 2tb drive with clonezilla and it keeps taking me to automatic repair. I unplugged the original drive and replaced it with the new one before booting. I ran a chkdsk both times before cloning.

    The first time I cloned the drive i used these settings:

    device to device beginer disk to local disk Chose my source and target Skip disk checking -k0 use source partition table

    Then I tried these settings:

    device to device expert disk to local disk Chose my source and target Left everything as default -k1 Create partition table proportionally

    I also plan on partitioning half of the drive so that I can dual boot linux as Window 10 is reaching eol and I don't want anything to do with Windows 11 and I still need Windows for gaming.

    23