• 1 Post
  • 61 Comments
Joined 3 years ago
cake
Cake day: June 20th, 2023

help-circle
  • ok, so I think if it sees the device being plugged in, then it probably sees the card reader. You could try running lsusb to see all your USB devices, and lsblk -o NAME,FSTYPE,MOUNTPOINTS to see your block devices (disks), and see if it appears there also.

    It still may not be able to actually read the file system even though it sees it as a disk. One reason for that could be it’s not supported by your kernel. Do you know what file system the card is formatted with? If it appears in the lsblk output, it will say in the second column.

    Edit: when I tested this with my own card reader, I see this output:

    $ lsusb
    Bus 002 Device 002: ID 0bda:0301 Realtek Semiconductor Corp. multicard reader
    
    $ lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS
    NAME         SIZE TYPE FSTYPE MOUNTPOINTS
    sda          3.6T disk        
    ├─sda1        16M part        
    └─sda2       3.6T part ext4   /mnt/disk2
    sdb            0B disk        
    sdc            0B disk        
    sdd            0B disk        
    sde            0B disk        
    

    Each device (sda, sdb, sdc) is a physical disk. sda is my SSD. sdb, sdc, sdd, and sde are all “drives” from the multi-reader. Each type of card shows as its own, basically.

    Now if I plug a card in, I get a little icon in the system tray (disk and devices) where I can mount and open it. And this has appeared in my lsblk output:

    sdc         59.5G disk        
    └─sdc1      59.5G part exfat  
    

    That is a 64GB SD card formatted with exfat.





  • The biggest UX issue, in KDE in particular (though they made some improvements recently), is that a copy process will say it’s complete (with a notification), but you could be waiting several seconds or minutes before it’s actually done syncing

    The sync command will block until it’s done so you will know for sure. I believe ejecting the drive will sync before it reports success also.

    In my experience, simply waiting for the activity light to stop flashing is a good enough indication, but not all drives have one.




  • That’s fair. I think they’re are definitely systems where micro services are the best choice, but also that they are way over used or implemented too early. Too often it seems service boundaries follow the organization and not the domain model, because they only exist so multiple teams don’t have to talk to each other as often. I guess I’m saying there are more incorrect ways of doing micro services than correct ways.

    The worst I’ve seen though have been a single developer over engineering a system because they thought it was cool, but we replaced it with a simple batch script.



  • My back hurts typing this, but… back when I was young there was a whole community called the “scene” to explore just that question. The demoscene is still alive, but it’s perhaps a little more mainstream and “clean” than it used to be? Anyway, people are still cranking out awesome demos that explores the question: what can we do with programming? There are tons of YouTube videos of demos, old and new, but here is a video that talks about the scene and the history behind it.



  • Two ways I’ve handled this. If you have some orchestrator, like kubernetes, you can use the job feature to retry. In that case you just let the script exit with error status.

    If we’re staying with just cron and shell scripts, look at using flock(1) with timeout in a bash script (example). You can create a lock to prevent multiple copies running and it cleans up automatically. You can combine this with time-stamped files to enforce a minimum amount of time since last run, or whatever you like.

    I prefer having the retry handled outside the job itself, but I’ve used both approaches. I’ve grown to prefer separating the code for “doing the thing” from the code for “orchestrating the thing”, but it depends on what environment it runs in, how critical it is, and how who else may be supporting it.

    Finally, set up something to monitor it and alert you if it hasn’t run successfully for some time.


  • Fail2ban is just another tool in your toolbox. Defense in depth, as others mentioned.

    Fail2ban is primarily a tool to prevent brute force attacks, especially useful for services that don’t do their own throttling. For example I usually put ssh in fail2ban, but if Authelia’s built-in protection is good enough, then use that.

    Outside ssh, anything that could be used to brute force credentials should be in fail2ban if they’re exposed: web sites with simple auth, mail, etc.



  • I installed CacyOS on my MSI laptop with Nvidia m2060 + igpu and Intel CPU a couple of months ago. I can play genres through Steam just fine. It performs better than it did on Windows 11.

    I’ll be honest, I was amazed I had no issues getting it running. CachyOS has sone great tools to set things up and their wiki is excellent. I just followed the steps in there to set up GPU switching. I disabled secure boot, since that can get in the way of drivers loading, but they have instructions for that as well.

    Wi-Fi worked out of the box. I even have a luks encrypted root.

    The main issue I had was MSI specific hardware, like battery charging control, normally managed by the Dragon Center. I found an open source replacement for that.

    I can’t speak to the battery performance since I always use it plugged in. It’s a few years old so it’s probably not great anyway.

    Your mileage may vary. It’s probably going to be more off a struggle with hardware specific to the model of laptop rather than Nvidia.




  • I once, many years ago, worked with a programmer who had a strict rule of not introducing any functions unless the block of code was used at least twice.

    Every code base they were the main developer on had source files thousands of lines long with if-statements nested to the 9 levels of hell.

    We worked mostly in Perl and Deplhi (Pascal). Reading old code was… interesting. It’s wild when your Perl code is more readable than your Pascal.

    I’m happy to say I don’t work with them anymore.

    So yeah, break things into functions and name your functions and variables sensibly. Your future self will thank you.



  • I think it’s fair to want a more helpful error message, but that’s not necessarily the purpose for path. There is a real cost to every entry in your $PATH. Not as much as in the world of spinning rust, but some.

    There are some completion modules for shells that will suggest misspelled or even installable packages if it can’t find the command. Those are arguably better options.

    As for traditional systems, I remember a time where running arbitrary commands, even with an --help argument could be dangerous and we had to set least try ‘man command’ first.