• 0 Posts
  • 6 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle
  • Oth@lemmy.ziptoProgrammer Humor@lemmy.mlPHP Moment
    link
    fedilink
    English
    arrow-up
    94
    arrow-down
    2
    ·
    edit-2
    4 months ago

    Tell me you’ve never used PHP without telling me you’ve never used PHP.

    It’s known for giving a complete stack trace, it’s nearest neighbours and their god damn grandkids the moment it so much as coughs up a warning. For the longest time it was notorious for doing this as the default error logging level.

    I’m aware it’s cool to hate on PHP, but it has plenty of things to dislike without straight-up inventing nonsense.


  • Everyone else is just telling you to do things in a way that is different, and while they are correct (you should use a unit.d/systems script for this depending on your distro), I’m going to actually answer your question since I know sometimes you just need a quick and simple way.

    Depending on your version of cron, it may support special statements instead of the * * * * * notation for time.

    The one you want is @reboot. Replace all entries of the schedule syntax with that, including the @, and the command will be executed only once when the system boots up.

    Use that to start a script that checks for network connectivity on a loop with a sleep statement. Break the loop when you have connectivity, then execute your command, and exit the script.

    Don’t ignore the correct way though. You’re better off executing this as a systemd (or equivalent) script. It’s barely more effort, and has the benefit of some nice built in logging and integrations.



  • My tried-and-tested method has saved my (company’s clients) ass a few times.

    Every Mysql/MariaDB server has at least one replication target. This replicant is not used for access by the infra, and can be paused, restarted, etc with no issue and is configured with this in mind.

    We run a mysqldump on the replicant. Depending on the resiliency required, we store the dump on the replicant and/or a third location.

    The tools differ, but the practice applies to pretty much every database system and the database has the benefit of not being interrupted during the backup (replication is paused during the backup, and resumed after completion). This also has the benefit of already having replication configured, and adding a secondary redundant instance you can swap out for the master (or using the backup replicant in a pinch) means disaster recovery is much faster.

    Also, I dislike many things about Azure’s offerings, but their Flexible Database for MySQL does the above for you as one nicely packaged solution for a reasonable-but-not-cheap price.


  • Oth@lemmy.ziptoStarfield@lemmy.zipDifficulty bugged or am I bad?
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    10 months ago

    If you’re on PC, there’s a few configuration file tweaks you can do to make enemies less spong-y. Enemies gain 20HP per level in this game, and thus get very tanky, very fast. This doesn’t change per difficulty. The damage scaling modifier does, but not enough to counter this.

    I’ve set this to 5HP and increased how much damage I take as well. Feels much better that way, in my opinion. Legendary enemies still have more health, but not to an insane degree.

    Do you want me to share the settings?