Linux
Table of Contents
1. Greg Kroah Hartman on the Linux Kernel
https://youtu.be/L2SED6sewRw?si=xr2RwLyOMzrMcAjm&t=864
https://youtu.be/vyenmLqJQjs?si=E5E4OAlrDrllb5Y9&t=181
Figure 1: Linux Hierarchy
1.1. Kernel moves really fast
1.2. There is no conventional test
https://youtu.be/L2SED6sewRw?si=xr2RwLyOMzrMcAjm&t=864 There is no test in the traditional/popular sense of test.
Kernel is tested by running it.
Developers test it. Because there are hundreds of permutations of configs and conditions to test.
Zero day test (https://youtu.be/vyenmLqJQjs?si=leZ1mJ60eKRJXkjA&t=1493)
- Intel has 0-day bots that build the public linux kernel trees on different configurations and test a bunch of things
2. Articles
3. Server Setup
3.1. Starting web sever at port 80
Port 80 is previlage and a non root process can't open a port 80. There are few options: (https://superuser.com/a/892391)
- Start the server as root: very risky
- Using
setcap
give port binding capacity to the process: allows opening any port other than 80 too - Use
authbind
: this is an extra program to install
Instead simply use iptables and setup port forwarding:
- Start your server normally at any unprevilaged port (say 8000)
- Then port forward port 80 to port 5000 using iptables
(From https://coderwall.com/p/plejka/forward-port-80-to-port-3000)
## Forward external requests to 80 towards 500 sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 5000
Note that this doesn't forward internal requests to port 80 towards port 5000. So if you try `curl localhost:80` it won't work. Either use port 5000 : `curl localhost:5000` or use public ip/domain name of your server: `curl public-ip-of-server:80`.