Skip to content

Instantly share code, notes, and snippets.

View oscartbeaumont's full-sized avatar

Oscar Beaumont oscartbeaumont

View GitHub Profile
@oscartbeaumont
oscartbeaumont / Cargo.toml
Last active May 21, 2021 19:13
async-graphql Renaming Fields
[package]
name = "async-graphql-issue"
version = "0.1.0"
authors = ["Oscar Beaumont <[email protected]>"]
edition = "2018"
[dependencies]
async-graphql = "2.8.5"
tokio = { version = "0.2.22", features = ["full"] }
@oscartbeaumont
oscartbeaumont / setup.ps1
Created December 22, 2020 06:29
Setup Machine
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
echo "Configure Computer Name"
$computerName = Read-Host 'Enter New Computer Name'
Write-Host "Renaming this computer to: " $computerName -ForegroundColor Yellow
Rename-Computer -NewName $computerName
echo "Fixing time"
Set-TimeZone "W. Australia Standard Time"
net start w32time
@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'"
@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 / 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 / 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 / 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 / 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 / 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 / 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() {