Toolserver:Code snippets

Calculate replag
NB: This actually shows how long ago the last edit to the wiki was. If the wiki hasn't been edited for a while, it might appear the replag is higher than it really is, because the last edit was some time ago.

Kill processes
To get the process ID (pid), see viewing processes. Once you have the pid, you can kill it: kill pid

If the process doesn't exit, kill it harder: kill -9 pid

But be aware that kill -9 doesn't give the process any opportunity to clean up.

If the process is running in the foreground (i.e. from the shell), you can also kill it with CTRL-C. If that doesn't work, try CTRL-\ (which like kill -9, gives the process no opportunity to clean up).

To kill all your processes at once, including any and all ssh processes: pkill -u username

IPv4
Copped from http://www.geekzilla.co.uk/View0CBFD9A7-621D-4B0C-9554-91FD48AADC77.htm

'Unit' Testing
If you need to check various pieces of data against multiple tests and see what data passes each test a quick and dirty way to do that is like so