Thursday, September 24, 2015

How to clear terminal screen in Clojure

Print some ANSI characters
(print (str (char 27) "[2J")) ; clear screen
(print (str (char 27) "[;H")) ; move cursor to the top left corner of the screen
Credit: http://codereview.stackexchange.com/questions/17603/critique-my-clojure-game-of-life-code

Find out which process is using a particular port

I was never be able to remember options for netstat command. This option for lsof seems to be easier. Note that it requires a root access.
lsof -i :80
Change 80 to any port number you like.

Creadit: http://unix.stackexchange.com/a/106572

Config number of file descriptors on Linux

Check file descriptor limit for a process. Vary depending on owner of the process $ cat /proc/{process-id}/limits Check current number of...