Given this file layout ...
.
├── server.go
└── templates
├── profiles.html
└── layout.html
#!/usr/bin/python2 | |
import argparse | |
import sys | |
import subprocess | |
from itertools import takewhile | |
from macholib import MachO, ptypes | |
def parse_rwx(text): | |
return ('r' in text and 1) | ('w' in text and 2) | ('x' in text and 4) |
#!/boot/bzImage | |
# Linux kernel userspace initialization code, translated to bash | |
# (Minus floppy disk handling, because seriously, it's 2017.) | |
# Not 100% accurate, but gives you a good idea of how kernel init works | |
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st> | |
# Based on Linux 4.10-rc2. | |
# Note: pretend chroot is a builtin and affects the current process | |
# Note: kernel actually uses major/minor device numbers instead of device name |
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |
ARG IMAGE=kindest/node | |
ARG VERSION=1.19 | |
ARG MINOR=1 | |
ARG OS=xUbuntu_20.04 | |
FROM ${IMAGE}:v${VERSION}.${MINOR} | |
ARG VERSION | |
ARG OS |
#!/bin/bash | |
# References | |
# http://www.computerhope.com/unix/nc.htm#03 | |
# https://github.com/daniloegea/netcat | |
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze | |
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982 | |
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip | |
# http://www.dest-unreach.org/socat/ | |
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES |
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
.
// Simple demo of a GO CGI program that takes | |
// file uploads. | |
// | |
// NOTE NOTE DANGER DANGER | |
// Absolutely No filename/path sanitizing is done, | |
// don't run this in production unless you want hackers | |
// to overwrite your server. This is only a demo of | |
// how to untangle the go stdlib form-related datatypes | |
// and use them to take file uploads. | |
// |