• 0 Posts
  • 115 Comments
Joined 2 years ago
cake
Cake day: July 3rd, 2023

help-circle


  • The one use case is running STUN/TURN server for NAT hole punching, that requires two separate servers, or one server with two IP addresses. You will only need that to run masterserver for games that support hole punching, or to run VoIP telephony / teleconference server.

    Another use case is reliability, when your server is connected to several network providers, it will keep working if one of them has an outage, and will naturally have a different IP address for each network link. But your VPS does not have several network links, otherwise they would advertize that in bold red letters.








  • You need to enter these commands in the Linux terminal app, not in the X server app. Once the two apps connect, it should be possible to launch another terminal inside the X server.

    • Go to your phone Settings > About Phone and tap “Build number” seven times. You will receive notification that your phone now has developer options enabled.

    • Settings > System > Developer Options > Linux development environment. On that page, tap the On/Off slider.

    • You will find an icon for the new Terminal app on your home screen. It’s going to download 500 MB of data when you open it.

    • Long-press the Terminal app icon, tap Info > Mobile data, and enable Unrestricted data usage.

    • Now you can download more packages inside your Linux virtual machine using apt-get command, as described in my previous post.











  • printf is superior and more concise, and snprintf is practically the only C string manipulation function that is not painful to use.

    Try to print a 32-bit unsigned int as hexadecimal number of exactly 8 digits, using cout. You can do std::hex and std::setw(8) and std::setfill('0') and don’t forget to use std::dec afterwards, or you can just, you know, printf("%08x") like a sane person.

    Just don’t forget to use -Werror=format but that is the default option on many compilers today.

    C++23 now includes std::print which is exactly like printf but better, so the whole argument is over.