• 0 Posts
  • 10 Comments
Joined 2 years ago
cake
Cake day: July 17th, 2024

help-circle
    • When does 4 become 5?

    4.5 >=? Lots of programming languages define casting as the largest integer value, not the the rounded value. Outside of programming, there are scenarios where 4 cannot be rounded to 5 either… Like a height requirement for a ride at an amusement park. Though, it might seem natural to round it to humans.

    • When does green become black in a gradient?

    With computer languages, we define colors with red, blue, and green. The above is a gradient on horizontal x-axis, with

    (r = 0, g = x, b = 0) 
    

    This is more complicated. If we surveyed 1 million people, maybe we’d get a plot that defined the start of green as something like the following.

    And then maybe we could take the the average and state that as green.

    Though, is that really good enough description of green to serve as a legal definition of green? Maybe lawyers would select significantly different results than the general population when surveyed for the value of green. Maybe the results should be restricted to lawyers?

    • And when does 2 become 7?

    If we restricted it pixels to a 3x5 grid…

    We could possibly define 2 and 7.

    But then is this a 2 or a 7?










  • I just use autossh for it.

    I run an ssh connection to a VPS I pay like $5, which forwards a port there. The screen in the following command isn’t required, but I have it so I don’t have to keep the terminal window open.

    screen -d -m -S autossh.eastusa.keepalive autossh -M 33333 -R VPS_IP_HERE:5555:localhost:22 root@VPS_IP_HERE
    

    Then from other computers, to connect back

    ssh -L 5555:localhost:5555 root@VPS_IP_HERE
    ssh root@localhost -p 5555
    

    For remote computers connecting back, the first ssh connects to the VPS and forwards a port to the remote computer. Then the 2nd ssh connection uses the forwarded port to complete the ssh connection to the computer behind the IP that can’t port forward.