I’m the administrator of kbin.life, a general purpose/tech orientated kbin instance.

  • 0 Posts
  • 17 Comments
Joined 2 years ago
cake
Cake day: June 29th, 2023

help-circle
  • I think so. I would consider perhaps allowing a short time without power before doing that. To handle short cuts and brownouts.

    So perhaps poll once per minute, if no power for more than 5 polls trigger a shutdown. Make sure you can provide power for at least twice as long as the grace period. You could be a bit more flash and measure the battery voltage and if it drops below a certain threshold send a more urgent shutdown on another gpio. But really if the batteries are good for 20mins+ then it should be quite safe to do it on a timer.

    The logic could be a bit more nuanced, to handle multiple short power cuts in succession to shorten the grace period (since the batteries could be drained somewhat). But this is all icing on the cake I would say.



  • My understanding is that the only issues were the write hole on power loss for raid 5/6 and rebuild failures due to un-seen damage to surviving drives.

    Issues with single drive rebuild failures should be largely mitigated by regular drive surface checks and scrubbing if the filesystem supports it. This should ensure that any single drive errors that might have been masked by raid are removed and all drives contain the correct data.

    The write hole itself could be entirely mitigated since the OP is building their own system. What I mean by that is that they could include a “mini UPS” to keep 12v/5v up long enough to shut down gracefully in a power loss scenario (use a GPIO for “power good” signal). Now, back in the day we had raid controllers with battery backup to hold the cache memory contents and flush it to disk on regaining power. But, those became super rare quite some time ago now. Also, hardware raid was always a problem with getting a compatible replacement if the actual controller died.

    Is there another issue with raid 5/6 that I’m not aware of?



  • Linux secure boot was a little weird last I checked. The kernel and modules don’t need to be secure boot signed. Most distros can use shim to pass secure boot and then take over the secure boot process.

    There are dkms kernel modules that are user compiled. These are signed using a machine owner key. So the machine owner could for sure compile their own malicious version and still be in a secure boot context.


  • Actually how is your ISP giving out IPs to you? Mine uses IPv6 PD to give me a /48. And I then use SLAAC locally on the first /64 prefix on my LAN. Plus another /64 for VPN connections.

    If you mean receiving RA/ND packets from your ISP (which are used to assign SLAAC IPs) then you need to allow icmpv6 packets (if you don’t want to be able to be pinged, just block echo requests, ICMP in v4 and v6 carry important messages otherwise).

    If your ISP uses DHCPv6 Prefix delegation you will need to allow packets to UDP port 546 and run a DHCPv6 client capable of handling PD messages.

    If you have a fixed prefix, then you probably don’t need to use your ISPs SLAAC at all. You could just put your router on a fixed IP as <yourprefix>::1 and then have your router create RA/ND packets (radvd package in linux, not sure what it would be on pfsense) and assign IPs within your network that way.

    If you have a dynamic prefix… It’s a problem I guess. But probably someone has done it and a google search will turn up how they handled it.


  • I believe the privacy concerns are made moot if all consumer level routers by default blocked incoming untracked connections and you need to poke holes in the firewall for the ports you need.

    Having said that, even knowing the prefix it’s a huge address space to port scan through. So it’s pretty secure too with privacy extensions enabled.

    But for sure the onus is on the router makers for now.






  • OK so it’s fairly simple. You need to install the acl package (or whatever equivalent package contains getfacl/setfacl. Then you can use that to dump the data from an entire structure into a file (I also then bzip that). Then I backup all installed packages to help with a restore too.

    So the script looks like:

    #!/bin/bash
    cd /etc
    /usr/bin/getfacl -R . | /usr/bin/bzip2 -9 >PERMISSION_BACKUP.bz2
    chmod 600 PERMISSION_BACKUP.bz2
    cd /home
    /usr/bin/getfacl -R . | /usr/bin/bzip2 -9 >PERMISSION_BACKUP.bz2
    chmod 600 PERMISSION_BACKUP.bz2
    cd /root
    /usr/bin/getfacl -R . | /usr/bin/bzip2 -9 >PERMISSION_BACKUP.bz2
    chmod 600 PERMISSION_BACKUP.bz2
    cd /var
    /usr/bin/getfacl -R . | /usr/bin/bzip2 -9 >PERMISSION_BACKUP.bz2
    chmod 600 PERMISSION_BACKUP.bz2
    /usr/bin/apt list --installed | /usr/bin/bzip2 -9 >/root/INSTALLED-PACKAGES.bz2
    chmod 600 /root/INSTALLED-PACKAGES.bz2
    

    To restore you change to the folder the backup was taken from, unbzip the file (or uncompress live via pipe) and use setfacl --restore=<file>






  • Can Linux run programs that rely on frameworks like .NET or other Windows-specific libraries?

    So this one I thought I’d answer because I’ve done development in both NET framework and NET core and how it works is different for each (although things will usually work one way or another).

    For .NET framework applications, if the program is compiled for windows (the .exe) you can usually run it with mono (you generally don’t need wine, but there’s some caveats that mean sometimes you should use wine). This will include programs with GUIs. If the NET framework app calls other windows programs it is best to run it via wine, you will need to install the net framework within wine, but there’s a winetricks command for that. There are a few things that are generally niche things that do not work in linux net framework’s mono though. By niche the one I can think of, is serial port events. Very annoyingly they all exist, so the program will run but the events will never trigger an action in the programs. Very annoying, but luckily very rare/niche stuff.

    For .NET core, you can build directly to linux targets, and if the project you are working on does target NET core, then you can run the binary natively (note: you usually cannot build applications using forms to linux native binaries, for these you should run the windows exe with wine). You can also run the .exe files for this with wine and I’ve rarely had a problem with it.

    Note that if you develop .NET applications, you won’t be able to build anything that uses the standard forms GUI under linux. There are other UI frameworks out there you can use that are multi platform. For this reason, for the projects that do use windows forms, I have a VM with windows on that I boot up for this reason.

    In short, if you’re just running windows binaries, you will be generally fine with mono for framework and wine for core. For development “it’s complicated”.