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

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

help-circle





  • Here you go

    #include <iostream>
    #include <csignal>
    #include <unistd.h>
    
    void sigusr1_handler(int signal)
    {
    	std::cout << "Signal USR1" << std::endl;
    }
    
    int main()
    {
    	std::cout << "Installed handler for USR1" << std::endl;
    	std::signal(SIGUSR1, sigusr1_handler);
    	while (1 == 1)
    	{
    		usleep(5000000);	// 5 seconds
    		std::cout << "Waiting for signal" << std::endl;
    	}
    }
    

    That will help you read at least one of them.


  • Well it’s not a scam. It works exactly as advertised. But, just like in casinos, the house is always the winner.

    I made a multi-threaded UK lottery simulator that draws 68 million lotteries per second on my machine. It shows the ROI on average is around 30% meaning the “house” (lottery company/government/charities) gets 70%. Here’s the last line after 5.1billion draws:

    Draws: 5,130,046,351. 3: 56,022,165, 4: 2,521,545, 5: 38,525 5+b 5,918 Jackpots: 113. Losses: 2,491,081,393. Cost £10,260,092,702, Winnings £3,058,100,000 ROI: 29.810%. 68,548,225.400 draws/s

    Yes that means you will wait on average 45.4 million draws before you hit the jackpot.

    In any case. You could implement the meme like the lottery and make money and I assure you, if you made the full info public people WOULD send you money and you’d keep the 70%…


  • This is exactly it. It’s always been a risk of being an estate agent/real estate agent. You take on the up-front cost on the basis you will make it back overall in commission in the long term.

    12 or so years ago, we were looking at rental properties. And not only was there none of this nonsense. They were finding extra properties to look at, in addition to the one(s) we asked for. They wanted to sell and understood they need to put in the time up-front to get that.

    But, if you can get the seller AND the buyer to pay you for your services? Damn, is that a win for them?


  • So, I think a decade or so ago (maybe more), the bigger corpos went full mask off, and stopped even pretending they cared about anything but making more money. Screw the employees, screw the customer, screw the regulatory departments. Money only.

    It seems this is filtering down to more and more businesses.

    I am not sure how it is over there. Here in the UK the number of rental properties has dropped drastically. I suspect, it’s because of a few changes legally here that make it not quite so lucrative to buy-to-let any more. In any case, rather than bring house prices down, it just made the rentals still on the market go up in price. As an example today for my postcode there are over 80 properties for sale (excluding retirement/shared properties) and only around 10 for rent with the same filters. It used to be closer to half the number of rental properties up until around 5 or so years ago.

    If there’s a seller’s (well landlord’s/renter’s I guess) market, they could for sure make people pay to get an edge on gaining an increasingly rare rental. It’s downright scummy. But, I expect nothing less any more.


  • Oh, I forgot about Azerothcore (which is a fork from Trinitycore, and absorbed some changes from certain private server source that has been released in the past).

    Which you choose I think depends on what you want.

    Trinitycore has a more strict development policy of doing things properly and not for example concentrating too much on getting boss fights etc “right”. It’s more of a technical project than “ready to go private server”.

    Whereas (and this is as I understand it, I’ve not done any work for the project directly) Azerothcore is a bit more lax in their requirements. Now, don’t take this to mean they accept bad code. It just means they don’t have the stricter guidelines that trinitycore have.

    I could be wrong though. I’ve been out of the game for a while now.


  • 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.




  • But this is the crucial thing. It wasn’t in the repository. It was in the tarball. It’s a very careful distinction because, people generally reviewed the repository and made the assumption that what’s there, is all that matters.

    The changes to the make process only being present in the tarball was actually quite an ingenius move. Because they knew that the process many distro maintainers use is to pull the tarball and work from that (likely with some automated scripting to make the package for their distro).

    This particular path will probably be harder to reproduce in the future. Larger projects I would expect have some verification process in place to ensure they match (and the backup of people independently doing the same).

    But it’s not to say there won’t in the future be some other method of attack the happens out of sight of the main repository and is missed by the existing processes.