Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nshalman on github.
  • I am nahamu (https://keybase.io/nahamu) on keybase.
  • I have a public key whose fingerprint is A20A EC40 115E 5201 91F9 893E 8FA5 71E5 06FD 2543

To claim this, I am signing this object:

@nshalman
nshalman / Caddyfile
Created July 7, 2022 13:27
Tailscale caddyfile with redirect
{
default_bind 127.0.0.1
}
nodename.tailthing-scalething.ts.net {
bind nodename.tailthing-scalething.ts.net
reverse_proxy 127.0.0.1:8080
}
http://nodename {
@nshalman
nshalman / user-data-server.sh
Last active December 23, 2022 16:49
Cloud-init script for Ubuntu to install Tailscale, code-server, and Caddy
#!/bin/bash
# Customize these
USER=user
TSKEY=tskey-auth-BLAHBLAHBLAH
export DEBIAN_FRONTEND=noninteractive
apt-get update
@nshalman
nshalman / README
Last active June 6, 2023 17:43 — forked from jperkin/README
Testing the lx brand on SmartOS
Grab /jperkin/public/lx/lenny.tar.gz from Manta
$ echo "10.0.0.0 255.255.255.0" >>/etc/netmasks
$ zoneadm -z lenny install -d /path/to/lenny.tar.gz
$ zlogin -C lenny
@nshalman
nshalman / wireguard-example.sh
Created June 30, 2023 16:29
wireguard example for SmartOS
#!/bin/bash -x
################ CHANGE THESE ##################
# Your Home IP or DNS record
WG_ADDRESS=wireguard.example.com
# UDP port forwarded to this machine
WG_PORT=12345
# DNS entries for the client to use when on VPN
WG_DNS=8.8.8.8
# Unused private IPs for this connection
@nshalman
nshalman / gz.sh
Created July 13, 2022 02:21
Tailscale in LX branded zones
vmadm create -f lx-tailscale.json
ZONENAME=$(vmadm list -Ho zonename alias=lx-tailscale)
zonecfg -z ${ZONENAME?} "add device ; set match=tun ; end"
vmadm reboot ${ZONENAME?}
zlogin ${ZONENAME?}