(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.xml with the following command: | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl |
| #!/bin/bash | |
| # Simple tcp server using netcat | |
| # - depending on the netcat version either use nc -l 5555 or nc -l -p 5555 | |
| # - verify with `telnet locahhost 5555` | |
| # - quit the telnet with `ctrl-]` and then type quit | |
| # - the while loop is there so reopen the port after a client has disconnected | |
| # - supports only one client at a time | |
| PORT=5555; | |
| while :; do nc -l -p $PORT | tee output.log; sleep 1; done |
| package main | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "encoding/base64" | |
| "fmt" | |
| "io" | |
| ) |
| package main | |
| /* | |
| URL: https://github.com/mccoyst/myip/blob/master/myip.go | |
| URL: http://changsijay.com/2013/07/28/golang-get-ip-address/ | |
| */ | |
| import ( | |
| "net" | |
| "os" |
The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.
Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.
Netcat is like a swiss army knife for geeks. It can be used for just about anything involving TCP or UDP. One of its most practical uses is to transfer files. Non *nix people usually don't have SSH setup, and it is much faster to transfer stuff with netcat then setup SSH. netcat is just a single executable, and works across all platforms (Windows,Mac OS X, Linux).
On the receiving (destination) terminal, run:
nc -l -p 1234 > out.file # Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)| #!/usr/bin/env python | |
| """Simple server using epoll.""" | |
| from __future__ import print_function | |
| from contextlib import contextmanager | |
| import socket | |
| import select |