• 0 Posts
  • 4 Comments
Joined 2 years ago
cake
Cake day: April 19th, 2022

help-circle


    • full disk encryption on everything except the router (no point in encrypting the router)
      • the server doesn’t have a display connected for obvious reasons, so I’m manually unlocking it via ssh on each boot
        • obviously, the SSH keys are different, so the server has a different IP in initrd. That said, I still don’t have any protection against malicious modification of initrd or UEFI
    • the server scans all new SSL certificates in realtime using certspotter and notifies me of any new certificates issued for my domains that it doesn’t know about (I use Cloudflare so it triggers relatively often, but I still do checks on who the issuer is)
    • firewall blocks outgoing 25 so nobody can impersonate my mailserver

  • a couple notes

    • you should declare all variables with let before you assign them, it’s good practice and you can enforce it by enabling strict mode - put "use strict"; at the beginning of your function (or the entire script). Of course it’s only needed in browsers, strict mode is usually enabled by default in most tools.
    • try not to execute extra code if you can help it. For example, in this case only the final reversedWord value matters, so you can do it at the end as opposed to on every iteration. Your code right now works in O(N^2) - with every new character in the string its speed decreases exponentially, but it should work in O(N) - a linear time. If you couldn’t create reversedWord at the end, you could still initialize it with an empty string and append some text with += on every iteration, that still works in O(N) time as you don’t have to recreate the entire string on every iteration.