Skip to content

Instantly share code, notes, and snippets.

View oscartbeaumont's full-sized avatar

Oscar Beaumont oscartbeaumont

View GitHub Profile
@oscartbeaumont
oscartbeaumont / demo.sh
Created January 22, 2019 23:48
Caddy Bug Demo
# Alpine Linux Installation
# Port 8443 mapped to 443
# Port 8080 mapped to 80
apk add ca-certificates nano
mkdir /workspace
cd /workspace
wget https://github.com/mholt/caddy/releases/download/v0.11.2/caddy_v0.11.2_linux_amd64.tar.gz
tar -xvzf caddy_v0.11.2_linux_amd64.tar.gz
nano Caddyfile
https://lan.otbeaumont.me {
@oscartbeaumont
oscartbeaumont / webserver2.go
Created January 26, 2019 07:12
A Basic Go Webserver Using Lego listening on the ports 8443 and 8080.
package main
import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"fmt"
"log"
@oscartbeaumont
oscartbeaumont / webserver3.go
Created January 26, 2019 11:59
A Basic Go Webserver Using Certmagic listening on the ports 8443 and 8080.
package main
import (
"log"
"net/http"
"github.com/mholt/certmagic"
)
func main() {
@oscartbeaumont
oscartbeaumont / deploy.sh
Created January 28, 2019 13:10
Test Alpine Linux Deploy Script
#!/bin/sh#!/bin/sh
# Pre:
# setup-interfaces
# Follow Instruction
# setup-dns -d local 1.1.1.1 1.0.0.1
# ifup eth0
###########
# Check The User Parsed The Correct Arguments
@oscartbeaumont
oscartbeaumont / Dockerfile
Created January 28, 2019 15:08
Caddy Dockerfile
FROM golang:alpine
RUN apk add git
RUN go get -u github.com/caddyserver/builds
RUN go get -u github.com/mholt/caddy
WORKDIR /go/src/github.com/mholt/caddy/caddy
RUN go run build.go -goos=linux -goarch=amd64
# TODO Add Plugins - ipfilter,
# The Final Stage
RUN cp ./caddy /bin/caddy
@oscartbeaumont
oscartbeaumont / Dockerfile
Created January 28, 2019 15:57
Caddy Dockerfile 2
FROM golang:alpine
RUN apk add git
RUN go get -u github.com/caddyserver/builds
RUN go get -u github.com/mholt/caddy
WORKDIR /go/src/github.com/mholt/caddy/caddy
RUN go run build.go -goos=linux -goarch=amd64
# TODO Add Plugins - ipfilter,
# The Final Stage
RUN cp ./caddy /bin/caddy
@oscartbeaumont
oscartbeaumont / test.pac
Last active May 11, 2019 14:08
Test Proxy Config For My Laptop
function FindProxyForURL(url, host) {
if (timeRange(21, 7)) {
return "SOCKS5 10.0.0.122:1080";
}
return "DIRECT";
}
@oscartbeaumont
oscartbeaumont / cloud-init.yml
Last active July 7, 2019 02:53
k3OS Demo Deployment Config
hostname: cirrus-server
ssh_authorized_keys:
- github:oscartbeaumont
k3os:
dns_nameservers:
- 1.1.1.1
- 1.0.0.1
ntp_servers:
@oscartbeaumont
oscartbeaumont / server.yaml
Last active July 26, 2019 07:17
A Clear Linux Deployment Configuration
#clear-linux-config
block-devices: [
{name: "installer", file: "installer.img"}
]
targetMedia:
- name: ${installer}
type: disk
children:
@oscartbeaumont
oscartbeaumont / run.bat
Last active December 22, 2020 05:09
Powershell reconfigure Winget to support Microsoft Store applications
powershell -Command "$settings = Get-Content '$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json' -raw | ConvertFrom-Json; $settings.experimentalFeatures.experimentalMSStore = true; $settings | ConvertTo-Json -depth 32 | Set-Content '$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json'"