Most example code taken from A Tour of Go, which is an excellent introduction to Go. If you're new to Go, do that tour. Seriously.
- Imperative language
| #!/bin/bash | |
| echo export TMOUT=1000000 >> /root/.bash_profile | |
| cat /root/.bash_profile | |
| source .bash_profile | |
| cp /etc/ssh/sshd_config /etc/ssh/sshd_config_bak | |
| echo ClientAliveInterval=60 >> /etc/ssh/sshd_config | |
| service sshd restart | |
| cat /etc/ssh/sshd_config | |
| service sshd restart | |
| exit |
| import os | |
| from autobahn.resource import WebSocketResource, WSGIRootResource | |
| from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol | |
| from flask import Flask, render_template | |
| from twisted.application import internet, service | |
| from twisted.internet import reactor | |
| from twisted.python.threadpool import ThreadPool | |
| from twisted.web.server import Site |
Most example code taken from A Tour of Go, which is an excellent introduction to Go. If you're new to Go, do that tour. Seriously.