I will tutor you

      • cummunist [he/him,they/them]
        ·
        4 years ago

        On a more serious note, would you happen to know what can cause input lag in a game ran with wine (proton to be more precise)? Not like I expect it to be very stable but still.

        • Bloodshot [he/him,any]
          hexagon
          ·
          4 years ago

          Do you mean input latency, or a huge framerate dip when you move the mouse? I know the latter is an old bug that might be fixed now, it has to do with Wine sending a billion events with mice with high polling rates. For that, using a different physical mouse can help.

          I'm not sure about the former. My searching online would indicate that Wine is still polling X11 for input events, rather than reading the device file. Is it "small" (playing an FPS feels worse) or "large" (let go of mouse and cursor is still moving)?

          • cummunist [he/him,they/them]
            ·
            4 years ago

            I'm not sure of the nature, but definitely closer to the former. It looks as if the game is sometimes straight up not reading my mouse click input on on one tick/frame, and sometimes takes time to read the "mouse button release event". To give a more concrete example (the game in question is squad), when my rifle is set to semi-auto mod and I try to shoot, it will sometimes straight up not shoot, even tho I clicked left mouse button. In automatic mode, clicking just once will shoot a burst, while supposed to shoot just a single bullet. This issue doesn't seem to be happening consistently so it definitely won't be too much an issue but I'm still curious.

    • Bloodshot [he/him,any]
      hexagon
      ·
      4 years ago

      I use Ruby when I can. Lots of Bash. I've done some in Python recently, Java some time ago. D.

      • gayhobbes [he/him]
        ·
        4 years ago

        I'm struggling with where to focus next, I have a highly technical job and I need to brush up, but I don't know where to go.

        • Bloodshot [he/him,any]
          hexagon
          ·
          4 years ago

          If you're looking to get hired, chase trends. If you want to learn languages for your own fulfilment, or to stay sharp, you should learn whatever is the most exciting to you. The skills will be highly transferable anyway.

          • gayhobbes [he/him]
            ·
            4 years ago

            Oh I'm not trying to get hired, I'm just trying to bolster my current abilities. I've come to recognize I have more sympathy and abilities on the developer side anyway. I'm not an ops or sysadmin guy.

    • Bloodshot [he/him,any]
      hexagon
      ·
      4 years ago

      The first thing you're missing is backing everything you want to keep up in a separate location.

      For 4, yes, Linux supports NTFS (what Windows uses) and just about every other filesystem you'd see.

      For drivers, almost everything is in the kernel; that is, you don't have to do anything, you just get them with almost any distro.

      The common exceptions to that are NVIDIA graphics drivers, for which the free ones are usually insufficient, and Intel wifi chips, which have proprietary drivers.

      When you're installing, the installer should give you give you the option, when partitioning, to create a LUKS encrypted drive. You should do this; it's easier to encrypt your disk now than it is after you've installed this. This requires a separate /boot: the bootloader doesn't know how to encrypt the disk, so you need to put Linux on a separate unencrypted partition so you can boot it and decrypt your /.

  • coppercrystalz [he/him]
    ·
    4 years ago

    Alright, I'm new to Python and I'm trying to make hangman in it. I convert the word picked to a list of all of it's characters then run a for loop when the player makes a guess to see if the guess is equal to any of the items in the list. If the guess is equal to a character in the list it fills that letter in in another list of underscores the same length as the original word list by taking the position of the letter in the original list and putting the guessed letter in the same position in the underscore list. This works fine except for when there are multiples of the same letter in a word, in which case only the position of the first instance of that letter is filled in in the underscore list. After going through the debugger step by step, I saw that what happens in that even when the for loop is on the second instance of the letter, only the position of the first instance is returned.

    So my question is, if there are multiple instances of the same item in a list, how do you make it so that when checking the position of the item Python returns the position of the nth instance instead of just the first?

    • Bloodshot [he/him,any]
      hexagon
      ·
      edit-2
      4 years ago

      I assume you're using array.index(char), which returns the first index. index also accepts a start argument, so ['a', 'b', 'b', 'a'].index('a', 1) will return 3.

      A bit more natural way to write this is to loop over the search list, and just check for equality, like this:

      def indices(array, search):
          indices = []
          for index, value in enumerate(array):
              if search == value:
                  indices.append(index)
      
          return indices
      

      This can be its own function or inline. Above, I use enumerate, which allows you to iterate over both the index and the value.

  • sexywheat [none/use name]
    ·
    4 years ago

    I've been grappling with this issue for a long time. I'm getting to the point where the distro is a couple releases behind so I might just reformat and start over, but I guess there's no guarantee that I won't face the same problem again.

    I've tried multiple monitors too, same problem on each. I've got two graphics cards in this box but I haven't gotten around to configuring the second one to test (I guess it's not as simple as just plugging it in on linux lol who would have guessed)

    • Bloodshot [he/him,any]
      hexagon
      ·
      4 years ago

      This, to me, would usually indicate a graphics driver problem. It's hard for me to diagnose without a bunch more information.

      • sexywheat [none/use name]
        ·
        4 years ago

        Yeah I kind of figured. I'll dick around with it some more and if I can't figure it out I'll just wipe the damn box clean and start over. If I still have problems after that, I'll ping you haha thanks.

    • Bloodshot [he/him,any]
      hexagon
      ·
      4 years ago

      Sorry, but that doesn't count as Linux help.

      BTW do you actually work on Hurd?

      • gammison [none/use name]
        ·
        4 years ago

        No, I've thought about it though. I took a decent amount of OS, and took a grad course in formal verification of software systems. Mainly though I do cryptography and cs theory, gonna start a MS this semester. If anything the only software project I should really be contributing to is verification or crypto libraries.

  • coppercrystalz [he/him]
    ·
    4 years ago

    Also another question, Linux occasionally crashes on me, I've switched to the LTS kernel to see if that prevents it. Where can I find news on Linux development and how often new LTS kernels come out?

    • Bloodshot [he/him,any]
      hexagon
      ·
      4 years ago

      lwn.net is the best resource if you can't read lkml, which is usually very technical.

      A more stable (i.e. older) kernel may or may not help with any crashes. If there is a clear kernel panic (it switches to a black screen with white text and tells you it's a kernel panic), it might. A more frequent cause of crashing is graphics drivers: nouveau, the free NVIDIA driver, is notoriously buggy. These will manifest by a sudden and complete "freeze", where the last frame is displayed on screen but the system is otherwise unresponsive.

      If you have an NVIDIA card, switching to NVIDIA's proprietary driver will probably be much more stable, at the cost of software freedom.

      • coppercrystalz [he/him]
        ·
        4 years ago

        Actually, I'm using AMD's open source drivers. So far I haven't had any crashes, so I think switching kernels solved my problem. Thanks for the resource!

        • Bloodshot [he/him,any]
          hexagon
          ·
          4 years ago

          If you just want to know what the latest stable, mainline, etc. kernels are, rather than news articles, the frontpage of https://www.kernel.org/ has everything. Your distribution might also maintain multiple versions of the kernel.

    • gammison [none/use name]
      ·
      4 years ago

      For your crash, check your journal, it should offer clues as to why the crash is happening.

        • gammison [none/use name]
          ·
          edit-2
          4 years ago

          The journal is a log of every kernel level event in your system, loading and unloading hardware, modules, logging sucessful display manager starts etc. You can can check it with journalctl. I should note this is for if you use systemd as your startup system, which you may or may not be. What distro do you use? Whatever start up system you use should have a logging function you can probe.

          • Bloodshot [he/him,any]
            hexagon
            ·
            4 years ago

            Also make sure that this is persisted (kept) between boots; this is configured in /etc/systemd/journald.conf

            journalctl -k shows only kernel events.

  • ami [they/them,he/him]
    ·
    4 years ago

    any advice for someone looking to get into this field? I don't have a degree and was looking mainly to get some knowledge/certs. Any direction you could point me in? I've found a lot of resources but it's a bit overwhelming and not sure where to start. Mainly wanting to get into the field with the hope of working remotely but idk whatever ya got I'd be appreciative.

    • Bloodshot [he/him,any]
      hexagon
      ·
      4 years ago

      Yep! I'm also entirely self-taught, no degree.

      The first thing to note is that almost all certificates are useless. There are a few that are respected, like the Red Hat certificates (e.g. RHCSA) and Cisco (for networking), but most ops and all programming certificates (as far as I know) aren't a huge deal.

      The rest of this advice will be *nix specific, I don't use Windows or know anything about administrating it.

      If you're really new, the first thing to do is to try and figure out how the system you're running right now works. If you're looking to be a *nix admin, that means running it and using it regularly. If you don't want to use it as your desktop, that's fine, just dedicate an old computer as a server. Install a distro on it. Install three. Get used to using SSH, to your shell (you can use any shell you'd like, but try to be fluent in Bourne, it's by far the most common so it behooves you to be able to read it). Start digging into how to do common things with command line utilities. What processes are running (ps)? How do I stop one? What's the filesystem layout? If I install a package, how does that work? What is the package format, how might I build one? What's my init (probably systemd) and how does that function? What's the boot process like? What does the kernel do?

      You don't have to understand this all at once, just pick something you're curious about and pursue it until you understand it from a high level. A good test is if you're able to point to a component and describe what is responsible for it, what piece of software, or process running on the system.

      Once you understand how things work from a high level, pick a service or technology you think sounds cool and install it. Configure it. Network with it. You can play with containers using LXC or Docker, or install an SQL database and write a toy program to interface with it. Try out LVM, LUKS. Try different filesystems. Get used to configuring services, almost all of them will use a plain text configuration file.

      Spin up VMs, or containers. Play with configuration management, be able to press a button and have four VMs come up from scratch and be configured with different roles: a web server, a database, a backend, and a NAS (you do not have to write the backend service, fill out the website, or populate the database, just have them configured to talk to one another).

      If, at this point, you don't know what to pursue, look up some job listings and pick technologies off of the requirements list and install and configure them. This will get to be pretty routine. You can't do this with everything (if they require you to have maintained a fleet of hundreds of servers in AWS, you obviously cannot just do that), but you can for a lot.

      Acquire a drive for automating things. If you do something more than three times, write a script. You'll find that, with the right tool, almost everything in *nix is interfaceable with via shell script.

      For the modern world, grumpy sysadmins who manage everything via a bunch of bespoke scripts only they know how to use are singular points of failure, and that's looked down upon. You can still be grumpy, but you'll want to really learn and understand git, and how to write code that others can read and extend. Companies are moving away from individualised servers that each have to be specially configured to a pool of resources (computers, VMs, containers) that are utilised automatically, or somewhat automatically by a C/M service backed by a backed up, version controlled repository. Configuration becomes code.

      If this is a lot, just remember to pursue one thing at a time. Going from "Oh, I wonder how networking works" to "I ran some commands to try and created a bridge and now the internet doesn't work but LAN does?" to "I spent four hours trying to fix this problem I created" is a great way to learn to do this stuff.

      • ami [they/them,he/him]
        ·
        4 years ago

        Damm, this was super helpful. Thank you for the time and energy you put into typing the reply and explaining everything. Also, appreciate you reaching out. Haha is this what community feels like.