Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS

https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

either

https://blogs.msdn.microsoft.com/sqlnativeclient/2017/02/04/odbc-driver-13-1-for-linux-released/

참고:
https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/connection-string-keywords-and-data-source-names-dsns

nano ~/.odbc.ini
[SKWINDB]
DSN = SKWINDB
Driver = ODBC Driver 13 for SQL Server
Server = tcp:192.168.0.15,3537  #ip, port number, usually 1433

리눅스 계정과 맞아야 한다. 그렇지 않으면, R에서 odbc.ini path를 찾을 수 없어서 에러가 난다.

Inside your R script

library(RODBC)
conn <- odbcConnect("SKWINDB", "db_username", "db_password")
sql <- "select * from someTable"
df <- sqlQuery(conn, sql)
odbcClose(conn)

phantom.js, netcat, ps -ef, ps -aux

server:

while true;do nc -l 10000 < index.html; done

or

while true; do { echo -ne "HTTP/1.0 200 OK\r\n\r\n"; cat index.html; } | nc -l -p 10000; done

client:

echo "hello" | nc localhost 10000

ps-ef

ps -ef | head -10