Off-and-on trying out an account over at @[email protected] due to scraping bots bogging down lemmy.today to the point of near-unusability.

  • 14 Posts
  • 1.84K Comments
Joined 2 years ago
cake
Cake day: October 4th, 2023

help-circle
  • I sat down to log into a couple MUDs yesterday. Didn’t stick with it — the combat still hasn’t evolved enough for me — but you could play that on anything capable of displaying text on a screen and running telnet.

    It looks like some crazy person has been doing a TCP/IP stack for the 128K Mac, the first Macintosh ever released, from 1984, as well as a telnet client. So you can technically lug a 42-year-old computer out of an antique store and play currently-being-developed Internet games…though you won’t be getting color, since that came a while down the road.

    If you get some device that can expose a serial console on some system to TCP/IP — not sure how far back you need to go for that — you could technically play it on a teletype from the 1930s.

    The “some device” will have to be later, though, so that’s maybe kinda cheaty.

    Technically, Debian Linux has been run on an Intel CPU from 1971, but it isn’t fast enough to be a practical host for such a teletype in that environment. Even stripped down forms of Linux are going to be “too big” to be such a host.

    It does sound like the Commodore 64 has a package, Novaterm 10, that runs TCP/IP and telnet, but I don’t know whether it can output to the C64’s serial port rather than video display; you could play locally on one of those, but probably not run on a teletype. That being said, it probably shows that it’s technically-possible, since I’m sure that if it can run a virtual terminal program, it has the resources to just dump the text to an actual terminal via a serial port. I’d guess that there’s probably some system out there circa 1980 that someone has probably built that can both run a TCP/IP stack and expose a serial console to a 1930s teletype to play current Internet games.


  • I agree with you that it’s a good game, and it’s very playable on an older computer, but it’s actually not the lightest-weight game from a CPU standpoint. I mean, realistically, that thing should be able to get by with very little CPU usage and essentially none if you’re not pushing buttons, but it actually uses a fair bit of CPU time when you’re just sitting there staring at the screen. It’s actually kind of bugged me, because while it’s irrelevant on a desktop, it really consumes more battery on a not-plugged-in-to-wall-power laptop than is necessary, and it’d otherwise be such a phenomenal game for disconnected laptop use.

    Go run top and just leave the game sitting there and it’ll be keeping an average of multiple cores hot on my laptop at 240 Hz running at vsync rate. And the world state isn’t changing – the game is turn-based.

    You can constrain the framerate down to 10 FPS — and that significantly reduces CPU usage, down to an average of 37% of a core, on my system, at the cost of limiting the speed at which the game runs autoexplore, since it will always draw at least one frame in a given state, and at the cost of making the game feel sluggish and unresponsive.

    And you’ll get that CPU usage even if you turn off all the graphical “glitz” have it just showing ASCII.

    My guess is that they probably could probably benefit by (a) having a lightweight visual “display” thread that doesn’t do anything expensive, just update any animations and draw that to the screen, and if there are no animations, not even run a refresh at all, and (b) having a separate “heavyweight” thread for game logic that only runs if the world state has changed (autoexplore, automove, resting, or the player has pressed a key).

    Cataclysm: Dark Days Ahead, which is a similar game (internally a turn-based game that’s basically generating an ASCII grid that can provide some light graphical glitz and tiles) also consumes a lot of CPU time when idle.

    If you want another game of a similar sort that uses a surprising amount of CPU time, Dwarf Fortress. That being said, Dwarf Fortress is real time, so one can’t beat it up as much for consuming CPU time while the player is idle.



  • My guess — without trying to dig up statistics — is that the single component most-likely to fail in an old PC is gonna be rotational hard drives. Virtually all of my rotational drives have eventually died, aside from a few that were just so small and taking up space where I could mount other things that I no longer bothered using them.

    I’ve seen fans die (not necessarily completely wedge up, but have the bearings go and become increasingly-obnoxious in sound).

    And those are basically the only mechanical components in a computer.

    Behind that, there’s input devices with keyswitches wearing out, but unless you’re using a laptop, replacing the input device is just unplugging the old one and plugging in a new one.

    I’m not gonna say that motherboards don’t fail, but I can’t immediately think of something that would die. Decades back, I remember that there was a spate of bad capacitors that made their way to a bunch of motherboards and would eventually fail, but I haven’t seen anything like that recently.

    searches

    Looks like it was 1999–2007:

    https://en.wikipedia.org/wiki/Capacitor_plague

    The capacitor plague was a problem related to a higher-than-expected failure rate of non-solid aluminium electrolytic capacitors between 1999 and 2007, especially those from some Taiwanese manufacturers,[1][2] due to faulty electrolyte composition that caused corrosion accompanied by gas generation; this often resulted in rupturing of the case of the capacitor from the build-up of pressure.

    High failure rates occurred in many well-known brands of electronics, and were particularly evident in motherboards, video cards, and power supplies of personal computers.

    A 2003 article in The Independent claimed that the cause of the faulty capacitors was due to a mis-copied formula. In 2001, a scientist working in the Rubycon Corporation in Japan stole a mis-copied formula for capacitors’ electrolytes. He then took the faulty formula to the Luminous Town Electric company in China, where he had previously been employed. In the same year, the scientist’s staff left China, stealing again the mis-copied formula and moving to Taiwan, where they created their own company, producing capacitors and propagating even more of this faulty formula of capacitor electrolytes.[3]

    Those would probably be from the DDR/DDR2 era, though.

    I do think that it’s probably possible that some motherboard components might age out. Like, people may want to use newer versions of radio stuff, like WiFi or Bluetooth. You can maybe do that via USB, but the on-motherboard stuff might become more of a liability than the CPU or something.

    I don’t think that I’ve ever personally had other computer components just up and fail other than the 13th and 14th gen Intel CPUs that internally destroyed themselves. It’s always been non-solid-state stuff, things with moving parts, that fail for me. I mean, I’ve damaged solid-state components myself via things that I’ve done, but it’s always damage that I incurred.

    thinks

    Oh, CMOS batteries eventually fail, but they’re usually — not always — mounted on motherboards with holders that permit replacement. I’ve had to replace those.

    I did have a headphones amplifier that was attached to my computer where some solder joints got a bad connection and I had to open it and resolder it, but I don’t know if I’d call that a “computer component” just because it was plugged into a computer.

    thinks more

    I did have the power supply used for a fluorescent backlight in a laptop display start to fail once. But, honestly, my experience has been that unless you actively go in and damage something, most solid state parts will just keep on trucking.


  • I also kind of think that the strongest argument for console gaming is competitive multiplayer, not single player.

    The fact that the consoles are closed and locked down inherently provides resistance to cheating and such, where the open PC world tries to (poorly) replicate a closed environment via kernel anti-cheat stuff. The console world having (well, more-or-less) one option when it comes to hardware means that everyone playing against each other has a fairly-level playing field — same input hardware, and people don’t get an edge from having fancier rendering hardware.

    For single-player gaming, those console strengths become weaknesses — for single-player games, it’s preferable for the player to be able to do things like freely mod games, upgrade hardware to get fancier graphics, provide a lot of options as to what input stuff to use, etc. It doesn’t hurt anyone else for me to have the game running however I want, so I should be able to do so. On the PC, a player gets to enjoy all that.

    If I were a console vendor and I were worried about the PC as a competing platform, I’d think that I’d try to emphasize my competitive multiplayer games, not single-player games.


  • The real problem with this sort of thing is that there’s no legal way to avoid it. If you’re operating a motor vehicle on public roads, you need to have a plate visible. You can’t obscure it.

    The laws requiring that visibility were made in an era where it wasn’t possible for someone like Flock to enable anyone who can aim a camera at a road to mass-log and aggregate and data-mine the movement it provides.

    The only real technical solution would be to back out the laws requiring license plates to be visible (and it wouldn’t be perfect, since Flock will still look for identifying oddities on a vehicle and try to log that too, like collision damage). But if you do that, then you lose an important tool for dealing with motor vehicle theft and finding vehicles involved in crimes.

    And there aren’t restrictions on selling or doing whatever companies want with the data. Or with data that they get from facial recognition/gait data in the future, or that sort of thing.

    My own personal preference would be for ALPRs to be generally illegal, outside of maybe some areas where logging is normally done by the government, like at border crossings. That’d be hard to enforce – someone could always run a rogue ALPR and it’d be hard to find — but it’d probably keep the scale down, avoid the mass deployment that makes the surveillance omipresent.

    And I think that it’s worth remembering that even if you are comfortable with, say, Flock’s policy on dealing with data, there’s no guarantee that they aren’t compromised — a lot of very sensitive databases have been compromised in the past.

    In the past, technical limitations permitted a certain level of privacy in society. It just wasn’t technically possible to build mass surveillance at scale, so it didn’t happen. But…as those technical barriers that some of us just took for granted go away, I think it’s worth asking whether we want to engineer in legislative barriers, to ensure that there is a certain amount of privacy provided members of society.


  • Yeah, honestly, if it becomes enough of an issue, maybe eBay and similar should create separate sections for machines with memory and those without. I mean, there are reasons people would want to get a system without memory too, especially if one’s looking for other parts, but I do totally get that it’s super-obnoxious if there isn’t a way to filter those out and one is looking for one with memory.

    checks

    It doesn’t look like eBay has a “0 GB” memory category, annoyingly enough, but they do have a “Not specified” category with a ton of listings. That’s not absolutely the same thing, since if you filter “Not specified” out, I’m sure that it might also exclude some listings that have an unknown amount of memory, but I’d guess that that’d get you most of the way there, and I do see people clearly listing machines with no memory in that category.

    EDIT: Honestly, the rate of mis-classified listings there by users is pretty bad, even aside from eBay not providing a “0 GB” category. I was very surprised to see that there were a bunch of 512 GB listings. Looks like that’s essentially all people selling machines with 512 GB SSDs and choosing the wrong option.


  • I don’t know of a pre-wrapped utility to do that, but assuming that this is a Linux system, here’s a simple bash script that’d do it.

    #!/bin/bash
    
    # Set this.  Path to a new, not-yet-existing directory that will retain a copy of a list
    # of your files.  You probably don't actually want this in /tmp, or
    # it'll be wiped on reboot.
    
    file_list_location=/tmp/storage-history
    
    # Set this.  Path to location with files that you want to monitor.
    
    path_to_monitor=path-to-monitor
    
    # If the file list location doesn't yet exist, create it.
    if [[ ! -d "$file_list_location" ]]; then
        mkdir "$file_list_location"
        git -C "$file_list_location" init
    fi
    
    # in case someone's checked out things at a different time
    git -C "$file_list_location" checkout master
    find "$path_to_monitor"|sort>"$file_list_location/files.txt"
    git -C "$file_list_location" add "$file_list_location/files.txt"
    git -C "$file_list_location" commit -m "Updated file list for $(date)"
    

    That’ll drop a text file at /tmp/storage-history/files.txt with a list of the files at that location, and create a git repo at /tmp/storage-history that will contain a history of that file.

    When your drive array kerplodes or something, your files.txt file will probably become empty if the mount goes away, but you’ll have a git repository containing a full history of your list of files, so you can go back to a list of the files there as they existed at any historical date.

    Run that script nightly out of your crontab or something ($ crontab -e to edit your crontab).

    As the script says, you need to choose a file_list_location (not /tmp, since that’ll be wiped on reboot), and set path_to_monitor to wherever the tree of files is that you want to keep track of (like, /mnt/file_array or whatever).

    You could save a bit of space by adding a line at the end to remove the current files.txt after generating the current git commit if you want. The next run will just regenerate files.txt anyway, and you can just use git to regenerate a copy of the file at for any historical day you want. If you’re not familiar with git, $ git log to find the hashref for a given day, $ git checkout <hashref> to move where things were on that day.

    EDIT: Moved the git checkout up.



  • There is existing DDR4 in existing machines that can be scavenged that would otherwise probably just be thrown out. I understand that secondhand memory was an industry even before the surge, remember reading a recent article about some California company that would strip servers of old DIMMs and sell them, mostly to China. The CEO was being interviewed, said that sales had surged recently.

    searches

    I don’t think that these guys are them, think this is a different California company doing basically the same thing, but illustrates the point:

    https://www.ramexchange.net/

    1GB–128 GB modules (DDR2 / DDR3 / DDR4 / DDR5)

    At Ram Exchange, we supply new, used, and refurbished RAM for a wide range of applications. Whether you’re upgrading a personal computer, laptop, data center, or need on-board ICs for custom projects, our team is here to help.

    We also provide IT Asset Disposition (ITAD) services, dedicated to helping businesses securely and responsibly manage their end-of-life IT assets. We offer a comprehensive suite of tailored services—including certified data destruction, secure electronics recycling, remarketing, and asset redeployment—transforming IT disposal into a seamless process that maximizes value and environmental responsibility.

    Large-Scale Purchasing Power

    We buy excess memory in bulk from around the globe, including from publicly traded companies and Fortune 500 enterprises. With our extensive purchasing capabilities, no quantity is too large for us to handle.

    I mean, I’ve thrown out old DIMMs. Wasn’t worth my time hassling with trying to resell them. But if they’re worth enough due to price increases, it’ll increase the number of companies who are willing to go to the effort to recoup some of the value of the DIMMs. Companies can buy them, re-certify them, and sell them.

    Obviously, that’s not an unlimited supply, but the window in which it’s of increased interest is probably only something like three years, so it doesn’t have to last forever (or even fully offset the shortage to make sense to do, just partially-mitigate it).



  • Is this worth the effort?

    In terms of electricity cost?

    I wouldn’t do it myself.

    If you want to know whether it’s going to save money, you want to see how much power it uses — you can use a wattmeter, or look up the maximum amount on the device ratings to get an upper end. Look up how much you’re paying per kWh in electricity. Price the hardware. Put a price on your labor. Then you can get an estimate.

    My guess, without having any of those numbers, is that it probably isn’t.






  • You would typically want to use static ip addresses for servers (because if you use DHCP the IP is gonna change sooner or later, and it’s gonna be a pain in the butt).

    In this case, he controls the local DHCP server, which is gonna be running on the OpenWRT box, so he can set it to always assign whatever he wants to a given MAC.


  • tal@lemmy.todaytoSelfhosted@lemmy.world[Solved] OpenWrt & fail2ban
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    6 days ago

    except that all requests’ IP addresses are set to the router’s IP address (192.168.3.1), so I am unable to use proper rate limiting and especially fail2ban.

    I’d guess that however the network is configured, you have the router NATting traffic going from the LAN to the Internet (typical for a home broadband router) as well as from the home LAN to the server.

    That does provide security benefits in that you’ve basically “put the server on the Internet side of things”, and the server can’t just reach into the LAN, same as anything else on the Internet. The NAT table has to have someone on the LAN side opening a connection to establish a new entry.

    But…then all of those hosts on the LAN are going to have the same IP address from the server’s standpoint. That’s the experience that hosts on the Internet have towards the same hosts on your LAN.

    It sounds like you also want to use DHCP:

    Getting the router to actually assign an IP address to the server was quite a headache

    I’ve never used VLANs on Linux (or OpenWRT, and don’t know how it interacts with the router’s hardware).

    I guess what you want to do is to not NAT traffic going from the LAN (where most of your hardware lives) and the DMZ (where the server lives), but still to disallow the DMZ from communicating with the LAN.

    considers

    So, I don’t know whether the VLAN stuff is necessary on your hardware to prevent the router hardware from acting like a switch, moving Ethernet packets directly, without them going to Linux. Might be the case.

    I suppose what you might do — from a network standpoint, don’t know off-the-cuff how to do it on OpenWRT, though if you’re just using it as a generic Linux machine, without using any OpenWRT-specific stuff, I’m pretty sure that it’s possible — is to give the OpenWRT machine two non-routable IP addresses, something like:

    192.168.1.1 for the LAN

    and

    192.168.2.1 for the DMZ

    The DHCP server listens on 192.168.1.1 and serves DHCP responses for the LAN that tell it to use 192.168.1.1 as the default route. Ditto for hosts in the DMZ. It hands out addresses from the appropriate pool. So, for example, the server in the DMZ would maybe be assigned 192.168.2.2.

    Then it should be possible to have a routing table entry to route 192.168.1.1 to 192.168.2.0/24 via 192.168.2.1 and vice versa, 192.168.2.1 to 192.168.1.0/24 via 192.168.1.1. Linux is capable of doing that, as that’s standard IP routing stuff.

    When a LAN host initiates a TCP connection to a DMZ host, it’ll look up its IP address in its routing table, say “hey, that isn’t on the same network as me, send it to the default route”. That’ll go to 192.168.1.1, with a destination address of 192.168.2.2. The OpenWRT box forwards it, doing IP routing, to 192.168.2.1, and then that box says “ah, that’s on my network, send it out the network port with VLAN tag whatever” and the switch fabric is configured to segregate the ports based on VLAN tag, and only sends the packet out the port associated with the DMZ.

    The problem is that the reason that home users typically derive indirect security benefits from use NAT is that it intrinsically disallows incoming connections from the server to the LAN. This will make that go away — the LAN hosts and DMZ hosts will be on separate “networks”, so things like ARP requests and other stuff at the purely-Ethernet level won’t reach each other, but they can freely communicate with each other at the IP level, because the two 192.168.X.1 virtual addresses will route packets between each the two networks. You’re going to need to firewall off incoming TCP connections (and maybe UDP and ICMP and whatever else you want to block) inbound on the 192.168.1.0/24 network from the 192.168.2.0/24 network. You can probably do that with iptables at the Linux level. OpenWRT may have some sort of existing firewall package that applies a set of iptables rules. I think that all the traffic should be reaching the Linux kernel in this scenario.

    If you get that set up, hosts at 192.168.2.2, on the DMZ, should be able to see connections from 192.168.1.2, on the LAN, using its original IP address.

    That should work if what you had was a Linux box with three Ethernet cards (one for each of the Internet, LAN, and WAN) and the VLAN switch hardware stuff wasn’t in the picture; you’d just not do any VLAN stuff then. I’m not 100% certain that any VLAN switching fabric stuff might muck that up — I’ve only very rarely touched VLANs myself, and never tried to do this, use VLANs to hack switch fabric attached directly to a router to act like independent NICs. But I can believe that it’d work.

    If you do set it up, I’d also fire up sudo tcpdump on the server. If things are working correctly, sudo ping -b 192.168.1.255 on a host on the LAN shouldn’t show up as reaching the server. However, ping 192.168.2.2 should.

    You’re going to want traffic that doesn’t match a NAT table entry and is coming in from the Internet to be forwarded to the DMZ vlan.

    That’s a high-level of what I believe needs to happen. But I can’t give you a hand-holding walkthrough to configure it via off-the-cuff knowledge, because I haven’t needed to do a fair bit of this myself — sorry on that.

    EDIT: This isn’t the question you asked, but I’d also add that what I’d probably do myself if I were planning to set something like this up is get a small, low power Linux machine with multiple NICs (well, okay, probably one NIC, multiple ports). That cuts the switch-level stuff that I think that you’d likely otherwise need to contend with out of the picture, and then I don’t think that you’d need to deal with VLANs, which is a headache that I wouldn’t want, especially if getting it wrong might have security implications. If you need more ports for the LAN, then just throw a regular old separate hardware Ethernet switch on the LAN port. You know that the switch can’t be moving traffic between the LAN and DMZ networks itself then, because it can’t touch the DMZ. But I don’t know whether that’d make financial sense in your case, if you’ve already got the router hardware.